Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9da92403
Commit
9da92403
authored
Apr 22, 2011
by
Matteo Bruni
Committed by
Alexandre Julliard
Apr 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Split pow instruction handling in the ARB backend.
parent
db8d681a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
20 deletions
+31
-20
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+31
-20
No files found.
dlls/wined3d/arb_program_shader.c
View file @
9da92403
...
@@ -2733,51 +2733,62 @@ static DWORD abs_modifier(DWORD mod, BOOL *need_abs)
...
@@ -2733,51 +2733,62 @@ static DWORD abs_modifier(DWORD mod, BOOL *need_abs)
return
mod
;
return
mod
;
}
}
static
void
shader_hw_log
_pow
(
const
struct
wined3d_shader_instruction
*
ins
)
static
void
shader_hw_log
(
const
struct
wined3d_shader_instruction
*
ins
)
{
{
struct
wined3d_shader_buffer
*
buffer
=
ins
->
ctx
->
buffer
;
struct
wined3d_shader_buffer
*
buffer
=
ins
->
ctx
->
buffer
;
char
src0
[
50
],
src1
[
50
],
dst
[
50
];
char
src0
[
50
],
dst
[
50
];
struct
wined3d_shader_src_param
src0_copy
=
ins
->
src
[
0
];
struct
wined3d_shader_src_param
src0_copy
=
ins
->
src
[
0
];
BOOL
need_abs
=
FALSE
;
BOOL
need_abs
=
FALSE
;
const
char
*
instr
;
const
char
*
instr
;
BOOL
arg2
=
FALSE
;
switch
(
ins
->
handler_idx
)
switch
(
ins
->
handler_idx
)
{
{
case
WINED3DSIH_LOG
:
instr
=
"LG2"
;
break
;
case
WINED3DSIH_LOG
:
instr
=
"LG2"
;
break
;
case
WINED3DSIH_LOGP
:
instr
=
"LOG"
;
break
;
case
WINED3DSIH_LOGP
:
instr
=
"LOG"
;
break
;
case
WINED3DSIH_POW
:
instr
=
"POW"
;
arg2
=
TRUE
;
break
;
default:
default:
ERR
(
"Unexpected instruction %d
\n
"
,
ins
->
handler_idx
);
ERR
(
"Unexpected instruction %d
\n
"
,
ins
->
handler_idx
);
return
;
return
;
}
}
/* LOG
, LOGP and POW
operate on the absolute value of the input */
/* LOG
and LOGP
operate on the absolute value of the input */
src0_copy
.
modifiers
=
abs_modifier
(
src0_copy
.
modifiers
,
&
need_abs
);
src0_copy
.
modifiers
=
abs_modifier
(
src0_copy
.
modifiers
,
&
need_abs
);
shader_arb_get_dst_param
(
ins
,
&
ins
->
dst
[
0
],
dst
);
shader_arb_get_dst_param
(
ins
,
&
ins
->
dst
[
0
],
dst
);
shader_arb_get_src_param
(
ins
,
&
src0_copy
,
0
,
src0
);
shader_arb_get_src_param
(
ins
,
&
src0_copy
,
0
,
src0
);
if
(
arg2
)
shader_arb_get_src_param
(
ins
,
&
ins
->
src
[
1
],
1
,
src1
);
if
(
need_abs
)
if
(
need_abs
)
{
{
shader_addline
(
buffer
,
"ABS TA, %s;
\n
"
,
src0
);
shader_addline
(
buffer
,
"ABS TA, %s;
\n
"
,
src0
);
if
(
arg2
)
shader_addline
(
buffer
,
"%s%s %s, TA;
\n
"
,
instr
,
shader_arb_get_modifier
(
ins
),
dst
);
{
shader_addline
(
buffer
,
"%s%s %s, TA, %s;
\n
"
,
instr
,
shader_arb_get_modifier
(
ins
),
dst
,
src1
);
}
else
{
shader_addline
(
buffer
,
"%s%s %s, TA;
\n
"
,
instr
,
shader_arb_get_modifier
(
ins
),
dst
);
}
}
}
else
if
(
arg2
)
else
{
shader_addline
(
buffer
,
"%s%s %s, %s;
\n
"
,
instr
,
shader_arb_get_modifier
(
ins
),
dst
,
src0
);
}
}
static
void
shader_hw_pow
(
const
struct
wined3d_shader_instruction
*
ins
)
{
struct
wined3d_shader_buffer
*
buffer
=
ins
->
ctx
->
buffer
;
char
src0
[
50
],
src1
[
50
],
dst
[
50
];
struct
wined3d_shader_src_param
src0_copy
=
ins
->
src
[
0
];
BOOL
need_abs
=
FALSE
;
/* POW operates on the absolute value of the input */
src0_copy
.
modifiers
=
abs_modifier
(
src0_copy
.
modifiers
,
&
need_abs
);
shader_arb_get_dst_param
(
ins
,
&
ins
->
dst
[
0
],
dst
);
shader_arb_get_src_param
(
ins
,
&
src0_copy
,
0
,
src0
);
shader_arb_get_src_param
(
ins
,
&
ins
->
src
[
1
],
1
,
src1
);
if
(
need_abs
)
{
{
shader_addline
(
buffer
,
"%s%s %s, %s, %s;
\n
"
,
instr
,
shader_arb_get_modifier
(
ins
),
dst
,
src0
,
src1
);
shader_addline
(
buffer
,
"ABS TA.x, %s;
\n
"
,
src0
);
shader_addline
(
buffer
,
"POW%s %s, TA.x, %s;
\n
"
,
shader_arb_get_modifier
(
ins
),
dst
,
src1
);
}
}
else
else
{
{
shader_addline
(
buffer
,
"
%s%s %s, %s;
\n
"
,
instr
,
shader_arb_get_modifier
(
ins
),
dst
,
src0
);
shader_addline
(
buffer
,
"
POW%s %s, %s, %s;
\n
"
,
shader_arb_get_modifier
(
ins
),
dst
,
src0
,
src1
);
}
}
}
}
...
@@ -5007,8 +5018,8 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
...
@@ -5007,8 +5018,8 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_LABEL */
shader_hw_label
,
/* WINED3DSIH_LABEL */
shader_hw_label
,
/* WINED3DSIH_LD */
NULL
,
/* WINED3DSIH_LD */
NULL
,
/* WINED3DSIH_LIT */
shader_hw_map2gl
,
/* WINED3DSIH_LIT */
shader_hw_map2gl
,
/* WINED3DSIH_LOG */
shader_hw_log
_pow
,
/* WINED3DSIH_LOG */
shader_hw_log
,
/* WINED3DSIH_LOGP */
shader_hw_log
_pow
,
/* WINED3DSIH_LOGP */
shader_hw_log
,
/* WINED3DSIH_LOOP */
shader_hw_loop
,
/* WINED3DSIH_LOOP */
shader_hw_loop
,
/* WINED3DSIH_LRP */
shader_hw_lrp
,
/* WINED3DSIH_LRP */
shader_hw_lrp
,
/* WINED3DSIH_LT */
NULL
,
/* WINED3DSIH_LT */
NULL
,
...
@@ -5027,7 +5038,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
...
@@ -5027,7 +5038,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_NOP */
shader_hw_nop
,
/* WINED3DSIH_NOP */
shader_hw_nop
,
/* WINED3DSIH_NRM */
shader_hw_nrm
,
/* WINED3DSIH_NRM */
shader_hw_nrm
,
/* WINED3DSIH_PHASE */
NULL
,
/* WINED3DSIH_PHASE */
NULL
,
/* WINED3DSIH_POW */
shader_hw_
log_
pow
,
/* WINED3DSIH_POW */
shader_hw_pow
,
/* WINED3DSIH_RCP */
shader_hw_rcp
,
/* WINED3DSIH_RCP */
shader_hw_rcp
,
/* WINED3DSIH_REP */
shader_hw_rep
,
/* WINED3DSIH_REP */
shader_hw_rep
,
/* WINED3DSIH_RET */
shader_hw_ret
,
/* WINED3DSIH_RET */
shader_hw_ret
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment