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
f0de1622
Commit
f0de1622
authored
Apr 06, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 06, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store the destination modifiers in struct wined3d_shader_dst_param.
parent
decc1cec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
18 deletions
+23
-18
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+14
-12
baseshader.c
dlls/wined3d/baseshader.c
+1
-0
glsl_shader.c
dlls/wined3d/glsl_shader.c
+7
-6
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
f0de1622
...
...
@@ -814,7 +814,7 @@ static void pshader_hw_cnd(const struct wined3d_shader_instruction *ins)
char
dst_wmask
[
20
];
char
dst_name
[
50
];
char
src_name
[
3
][
50
];
BOOL
sat
=
(
ins
->
dst
[
0
].
token
&
WINED3DSP_DSTMOD_MASK
)
&
WINED3DSPDM_SATURATE
;
BOOL
sat
=
ins
->
dst
[
0
].
modifiers
&
WINED3DSPDM_SATURATE
;
DWORD
shift
=
(
ins
->
dst
[
0
].
token
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
/* FIXME: support output modifiers */
...
...
@@ -848,7 +848,7 @@ static void pshader_hw_cmp(const struct wined3d_shader_instruction *ins)
char
dst_name
[
50
];
char
src_name
[
3
][
50
];
DWORD
shift
=
(
ins
->
dst
[
0
].
token
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
BOOL
sat
=
(
ins
->
dst
[
0
].
token
&
WINED3DSP_DSTMOD_MASK
)
&
WINED3DSPDM_SATURATE
;
BOOL
sat
=
ins
->
dst
[
0
].
modifiers
&
WINED3DSPDM_SATURATE
;
/* FIXME: support output modifiers */
...
...
@@ -877,7 +877,7 @@ static void pshader_hw_dp2add(const struct wined3d_shader_instruction *ins)
char
dst_name
[
50
];
char
src_name
[
3
][
50
];
DWORD
shift
=
(
ins
->
dst
[
0
].
token
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
BOOL
sat
=
(
ins
->
dst
[
0
].
token
&
WINED3DSP_DSTMOD_MASK
)
&
WINED3DSPDM_SATURATE
;
BOOL
sat
=
ins
->
dst
[
0
].
modifiers
&
WINED3DSPDM_SATURATE
;
pshader_get_register_name
(
ins
->
shader
,
ins
->
dst
[
0
].
token
,
dst_name
);
shader_arb_get_write_mask
(
ins
,
ins
->
dst
[
0
].
token
,
dst_wmask
);
...
...
@@ -900,7 +900,6 @@ static void pshader_hw_dp2add(const struct wined3d_shader_instruction *ins)
static
void
shader_hw_map2gl
(
const
struct
wined3d_shader_instruction
*
ins
)
{
SHADER_BUFFER
*
buffer
=
ins
->
buffer
;
DWORD
dst
=
ins
->
dst
[
0
].
token
;
const
DWORD
*
src
=
ins
->
src
;
const
char
*
instruction
;
char
arguments
[
256
];
...
...
@@ -939,6 +938,7 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins)
if
(
shader_is_pshader_version
(
ins
->
reg_maps
->
shader_version
))
{
/* Output token related */
const
struct
wined3d_shader_dst_param
*
dst
;
char
output_rname
[
256
];
char
output_wmask
[
20
];
char
operands
[
4
][
100
];
...
...
@@ -953,11 +953,12 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins)
ERR
(
"Opcode
\"
%#x
\"
has no parameters
\n
"
,
ins
->
handler_idx
);
return
;
}
dst
=
&
ins
->
dst
[
0
];
/* Process modifiers */
if
(
dst
&
WINED3DSP_DSTMOD_MASK
)
if
(
dst
->
modifiers
)
{
DWORD
mask
=
dst
&
WINED3DSP_DSTMOD_MASK
;
DWORD
mask
=
dst
->
modifiers
;
saturate
=
mask
&
WINED3DSPDM_SATURATE
;
centroid
=
mask
&
WINED3DSPDM_MSAMPCENTROID
;
...
...
@@ -969,7 +970,7 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins)
if
(
centroid
)
FIXME
(
"Unhandled modifier(%#x)
\n
"
,
mask
>>
WINED3DSP_DSTMOD_SHIFT
);
}
shift
=
(
dst
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
shift
=
(
dst
->
token
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
modifier
=
(
saturate
&&
!
shift
)
?
"_SAT"
:
""
;
/* Generate input register names (with modifiers) */
...
...
@@ -979,9 +980,9 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins)
}
/* Handle output register */
pshader_get_register_name
(
ins
->
shader
,
dst
,
output_rname
);
pshader_get_register_name
(
ins
->
shader
,
dst
->
token
,
output_rname
);
strcpy
(
operands
[
0
],
output_rname
);
shader_arb_get_write_mask
(
ins
,
dst
,
output_wmask
);
shader_arb_get_write_mask
(
ins
,
dst
->
token
,
output_wmask
);
strcat
(
operands
[
0
],
output_wmask
);
arguments
[
0
]
=
'\0'
;
...
...
@@ -1001,7 +1002,7 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins)
arguments
[
0
]
=
'\0'
;
if
(
ins
->
dst_count
)
{
vshader_program_add_param
(
ins
,
dst
,
FALSE
,
arguments
);
vshader_program_add_param
(
ins
,
ins
->
dst
[
0
].
token
,
FALSE
,
arguments
);
for
(
i
=
0
;
i
<
ins
->
src_count
;
++
i
)
{
strcat
(
arguments
,
","
);
...
...
@@ -1585,6 +1586,7 @@ static void shader_hw_mnxn(const struct wined3d_shader_instruction *ins)
for
(
i
=
0
;
i
<
nComponents
;
i
++
)
{
tmp_dst
.
register_idx
=
ins
->
dst
[
0
].
register_idx
;
tmp_dst
.
modifiers
=
ins
->
dst
[
0
].
modifiers
;
tmp_dst
.
token
=
((
ins
->
dst
[
0
].
token
)
&
~
WINED3DSP_WRITEMASK_ALL
)
|
(
WINED3DSP_WRITEMASK_0
<<
i
);
tmp_ins
.
src
[
1
]
=
ins
->
src
[
1
]
+
i
;
shader_hw_map2gl
(
&
tmp_ins
);
...
...
@@ -1631,7 +1633,7 @@ static void shader_hw_nrm(const struct wined3d_shader_instruction *ins)
char
src_name
[
50
];
char
dst_wmask
[
20
];
DWORD
shift
=
(
ins
->
dst
[
0
].
token
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
BOOL
sat
=
(
ins
->
dst
[
0
].
token
&
WINED3DSP_DSTMOD_MASK
)
&
WINED3DSPDM_SATURATE
;
BOOL
sat
=
ins
->
dst
[
0
].
modifiers
&
WINED3DSPDM_SATURATE
;
pshader_get_register_name
(
ins
->
shader
,
ins
->
dst
[
0
].
token
,
dst_name
);
shader_arb_get_write_mask
(
ins
,
ins
->
dst
[
0
].
token
,
dst_wmask
);
...
...
@@ -1658,7 +1660,7 @@ static void shader_hw_sincos(const struct wined3d_shader_instruction *ins)
char
src_name
[
50
];
char
dst_wmask
[
20
];
DWORD
shift
=
(
ins
->
dst
[
0
].
token
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
BOOL
sat
=
(
ins
->
dst
[
0
].
token
&
WINED3DSP_DSTMOD_MASK
)
&
WINED3DSPDM_SATURATE
;
BOOL
sat
=
ins
->
dst
[
0
].
modifiers
&
WINED3DSPDM_SATURATE
;
pshader_get_register_name
(
ins
->
shader
,
ins
->
dst
[
0
].
token
,
dst_name
);
shader_arb_get_write_mask
(
ins
,
ins
->
dst
[
0
].
token
,
dst_wmask
);
...
...
dlls/wined3d/baseshader.c
View file @
f0de1622
...
...
@@ -851,6 +851,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
dst_param
.
addr_token
=
0
;
pToken
+=
shader_get_param
(
pToken
,
shader_version
,
&
dst_param
.
token
,
&
dst_param
.
addr_token
);
dst_param
.
register_idx
=
dst_param
.
token
&
WINED3DSP_REGNUM_MASK
;
dst_param
.
modifiers
=
dst_param
.
token
&
WINED3DSP_DSTMOD_MASK
;
}
/* Predication token */
...
...
dlls/wined3d/glsl_shader.c
View file @
f0de1622
...
...
@@ -1292,28 +1292,28 @@ static DWORD shader_glsl_append_dst(SHADER_BUFFER *buffer, const struct wined3d_
void
shader_glsl_add_instruction_modifiers
(
const
struct
wined3d_shader_instruction
*
ins
)
{
glsl_dst_param_t
dst_param
;
DWORD
m
ask
;
DWORD
m
odifiers
;
if
(
!
ins
->
dst_count
)
return
;
m
ask
=
ins
->
dst
[
0
].
token
&
WINED3DSP_DSTMOD_MASK
;
if
(
!
m
ask
)
return
;
m
odifiers
=
ins
->
dst
[
0
].
modifiers
;
if
(
!
m
odifiers
)
return
;
shader_glsl_add_dst_param
(
ins
,
&
ins
->
dst
[
0
],
&
dst_param
);
if
(
m
ask
&
WINED3DSPDM_SATURATE
)
if
(
m
odifiers
&
WINED3DSPDM_SATURATE
)
{
/* _SAT means to clamp the value of the register to between 0 and 1 */
shader_addline
(
ins
->
buffer
,
"%s%s = clamp(%s%s, 0.0, 1.0);
\n
"
,
dst_param
.
reg_name
,
dst_param
.
mask_str
,
dst_param
.
reg_name
,
dst_param
.
mask_str
);
}
if
(
m
ask
&
WINED3DSPDM_MSAMPCENTROID
)
if
(
m
odifiers
&
WINED3DSPDM_MSAMPCENTROID
)
{
FIXME
(
"_centroid modifier not handled
\n
"
);
}
if
(
m
ask
&
WINED3DSPDM_PARTIALPRECISION
)
if
(
m
odifiers
&
WINED3DSPDM_PARTIALPRECISION
)
{
/* MSDN says this modifier can be safely ignored, so that's what we'll do. */
}
...
...
@@ -2090,6 +2090,7 @@ static void shader_glsl_mnxn(const struct wined3d_shader_instruction *ins)
for
(
i
=
0
;
i
<
nComponents
;
++
i
)
{
tmp_dst
.
register_idx
=
ins
->
dst
[
0
].
register_idx
;
tmp_dst
.
modifiers
=
ins
->
dst
[
0
].
modifiers
;
tmp_dst
.
token
=
((
ins
->
dst
[
0
].
token
)
&
~
WINED3DSP_WRITEMASK_ALL
)
|
(
WINED3DSP_WRITEMASK_0
<<
i
);
tmp_ins
.
src
[
1
]
=
ins
->
src
[
1
]
+
i
;
shader_glsl_dot
(
&
tmp_ins
);
...
...
dlls/wined3d/wined3d_private.h
View file @
f0de1622
...
...
@@ -453,6 +453,7 @@ typedef struct SHADER_OPCODE
struct
wined3d_shader_dst_param
{
UINT
register_idx
;
DWORD
modifiers
;
DWORD
token
;
DWORD
addr_token
;
};
...
...
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