Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
82379f22
Commit
82379f22
authored
Oct 09, 2006
by
Ivan Gyurdiev
Committed by
Alexandre Julliard
Oct 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move D3DSP dest modifier related items into the WINED3D namespace.
parent
76b571cb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
50 deletions
+74
-50
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+20
-20
baseshader.c
dlls/wined3d/baseshader.c
+12
-12
glsl_shader.c
dlls/wined3d/glsl_shader.c
+11
-11
vertexshader.c
dlls/wined3d/vertexshader.c
+9
-7
wined3d_private_types.h
dlls/wined3d/wined3d_private_types.h
+22
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
82379f22
...
...
@@ -208,24 +208,24 @@ static const char* shift_tab[] = {
static
void
pshader_get_write_mask
(
const
DWORD
output_reg
,
char
*
write_mask
)
{
*
write_mask
=
0
;
if
((
output_reg
&
D3DSP_WRITEMASK_ALL
)
!=
D3DSP_WRITEMASK_ALL
)
{
if
((
output_reg
&
WINED3DSP_WRITEMASK_ALL
)
!=
WINE
D3DSP_WRITEMASK_ALL
)
{
strcat
(
write_mask
,
"."
);
if
(
output_reg
&
D3DSP_WRITEMASK_0
)
strcat
(
write_mask
,
"r"
);
if
(
output_reg
&
D3DSP_WRITEMASK_1
)
strcat
(
write_mask
,
"g"
);
if
(
output_reg
&
D3DSP_WRITEMASK_2
)
strcat
(
write_mask
,
"b"
);
if
(
output_reg
&
D3DSP_WRITEMASK_3
)
strcat
(
write_mask
,
"a"
);
if
(
output_reg
&
WINE
D3DSP_WRITEMASK_0
)
strcat
(
write_mask
,
"r"
);
if
(
output_reg
&
WINE
D3DSP_WRITEMASK_1
)
strcat
(
write_mask
,
"g"
);
if
(
output_reg
&
WINE
D3DSP_WRITEMASK_2
)
strcat
(
write_mask
,
"b"
);
if
(
output_reg
&
WINE
D3DSP_WRITEMASK_3
)
strcat
(
write_mask
,
"a"
);
}
}
/* TODO: merge with pixel shader */
static
void
vshader_program_add_output_param_swizzle
(
const
DWORD
param
,
int
is_color
,
char
*
hwLine
)
{
/** operand output */
if
((
param
&
D3DSP_WRITEMASK_ALL
)
!=
D3DSP_WRITEMASK_ALL
)
{
if
((
param
&
WINED3DSP_WRITEMASK_ALL
)
!=
WINE
D3DSP_WRITEMASK_ALL
)
{
strcat
(
hwLine
,
"."
);
if
(
param
&
D3DSP_WRITEMASK_0
)
{
strcat
(
hwLine
,
"x"
);
}
if
(
param
&
D3DSP_WRITEMASK_1
)
{
strcat
(
hwLine
,
"y"
);
}
if
(
param
&
D3DSP_WRITEMASK_2
)
{
strcat
(
hwLine
,
"z"
);
}
if
(
param
&
D3DSP_WRITEMASK_3
)
{
strcat
(
hwLine
,
"w"
);
}
if
(
param
&
WINE
D3DSP_WRITEMASK_0
)
{
strcat
(
hwLine
,
"x"
);
}
if
(
param
&
WINE
D3DSP_WRITEMASK_1
)
{
strcat
(
hwLine
,
"y"
);
}
if
(
param
&
WINE
D3DSP_WRITEMASK_2
)
{
strcat
(
hwLine
,
"z"
);
}
if
(
param
&
WINE
D3DSP_WRITEMASK_3
)
{
strcat
(
hwLine
,
"w"
);
}
}
}
...
...
@@ -569,20 +569,20 @@ void pshader_hw_map2gl(SHADER_OPCODE_ARG* arg) {
strcpy
(
tmpLine
,
curOpcode
->
glname
);
/* Process modifiers */
if
(
0
!=
(
dst
&
D3DSP_DSTMOD_MASK
))
{
DWORD
mask
=
dst
&
D3DSP_DSTMOD_MASK
;
if
(
0
!=
(
dst
&
WINE
D3DSP_DSTMOD_MASK
))
{
DWORD
mask
=
dst
&
WINE
D3DSP_DSTMOD_MASK
;
saturate
=
mask
&
D3DSPDM_SATURATE
;
centroid
=
mask
&
D3DSPDM_MSAMPCENTROID
;
partialprecision
=
mask
&
D3DSPDM_PARTIALPRECISION
;
mask
&=
~
(
D3DSPDM_MSAMPCENTROID
|
D3DSPDM_PARTIALPRECISION
|
D3DSPDM_SATURATE
);
saturate
=
mask
&
WINE
D3DSPDM_SATURATE
;
centroid
=
mask
&
WINE
D3DSPDM_MSAMPCENTROID
;
partialprecision
=
mask
&
WINE
D3DSPDM_PARTIALPRECISION
;
mask
&=
~
(
WINED3DSPDM_MSAMPCENTROID
|
WINED3DSPDM_PARTIALPRECISION
|
WINE
D3DSPDM_SATURATE
);
if
(
mask
)
FIXME
(
"Unrecognized modifier(0x%#x)
\n
"
,
mask
>>
D3DSP_DSTMOD_SHIFT
);
FIXME
(
"Unrecognized modifier(0x%#x)
\n
"
,
mask
>>
WINE
D3DSP_DSTMOD_SHIFT
);
if
(
centroid
)
FIXME
(
"Unhandled modifier(0x%#x)
\n
"
,
mask
>>
D3DSP_DSTMOD_SHIFT
);
FIXME
(
"Unhandled modifier(0x%#x)
\n
"
,
mask
>>
WINE
D3DSP_DSTMOD_SHIFT
);
}
shift
=
(
dst
&
D3DSP_DSTSHIFT_MASK
)
>>
D3DSP_DSTSHIFT_SHIFT
;
shift
=
(
dst
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINE
D3DSP_DSTSHIFT_SHIFT
;
/* Generate input and output registers */
if
(
curOpcode
->
num_params
>
0
)
{
...
...
@@ -877,7 +877,7 @@ void vshader_hw_mnxn(SHADER_OPCODE_ARG* arg) {
}
for
(
i
=
0
;
i
<
nComponents
;
i
++
)
{
tmpArg
.
dst
=
((
arg
->
dst
)
&
~
D3DSP_WRITEMASK_ALL
)
|
(
D3DSP_WRITEMASK_0
<<
i
);
tmpArg
.
dst
=
((
arg
->
dst
)
&
~
WINED3DSP_WRITEMASK_ALL
)
|
(
WINE
D3DSP_WRITEMASK_0
<<
i
);
tmpArg
.
src
[
1
]
=
arg
->
src
[
1
]
+
i
;
vshader_hw_map2gl
(
&
tmpArg
);
}
...
...
dlls/wined3d/baseshader.c
View file @
82379f22
...
...
@@ -606,12 +606,12 @@ void shader_dump_param(
if
(
!
input
)
{
/* operand output (for modifiers and shift, see dump_ins_modifiers) */
if
((
param
&
D3DSP_WRITEMASK_ALL
)
!=
D3DSP_WRITEMASK_ALL
)
{
if
((
param
&
WINED3DSP_WRITEMASK_ALL
)
!=
WINE
D3DSP_WRITEMASK_ALL
)
{
TRACE
(
"."
);
if
(
param
&
D3DSP_WRITEMASK_0
)
TRACE
(
"%c"
,
swizzle_reg_chars
[
0
]);
if
(
param
&
D3DSP_WRITEMASK_1
)
TRACE
(
"%c"
,
swizzle_reg_chars
[
1
]);
if
(
param
&
D3DSP_WRITEMASK_2
)
TRACE
(
"%c"
,
swizzle_reg_chars
[
2
]);
if
(
param
&
D3DSP_WRITEMASK_3
)
TRACE
(
"%c"
,
swizzle_reg_chars
[
3
]);
if
(
param
&
WINE
D3DSP_WRITEMASK_0
)
TRACE
(
"%c"
,
swizzle_reg_chars
[
0
]);
if
(
param
&
WINE
D3DSP_WRITEMASK_1
)
TRACE
(
"%c"
,
swizzle_reg_chars
[
1
]);
if
(
param
&
WINE
D3DSP_WRITEMASK_2
)
TRACE
(
"%c"
,
swizzle_reg_chars
[
2
]);
if
(
param
&
WINE
D3DSP_WRITEMASK_3
)
TRACE
(
"%c"
,
swizzle_reg_chars
[
3
]);
}
}
else
{
...
...
@@ -782,8 +782,8 @@ void shader_generate_main(
void
shader_dump_ins_modifiers
(
const
DWORD
output
)
{
DWORD
shift
=
(
output
&
D3DSP_DSTSHIFT_MASK
)
>>
D3DSP_DSTSHIFT_SHIFT
;
DWORD
mmask
=
output
&
D3DSP_DSTMOD_MASK
;
DWORD
shift
=
(
output
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINE
D3DSP_DSTSHIFT_SHIFT
;
DWORD
mmask
=
output
&
WINE
D3DSP_DSTMOD_MASK
;
switch
(
shift
)
{
case
0
:
break
;
...
...
@@ -796,13 +796,13 @@ void shader_dump_ins_modifiers(const DWORD output) {
default:
TRACE
(
"_unhandled_shift(%d)"
,
shift
);
break
;
}
if
(
mmask
&
D3DSPDM_SATURATE
)
TRACE
(
"_sat"
);
if
(
mmask
&
D3DSPDM_PARTIALPRECISION
)
TRACE
(
"_pp"
);
if
(
mmask
&
D3DSPDM_MSAMPCENTROID
)
TRACE
(
"_centroid"
);
if
(
mmask
&
WINE
D3DSPDM_SATURATE
)
TRACE
(
"_sat"
);
if
(
mmask
&
WINE
D3DSPDM_PARTIALPRECISION
)
TRACE
(
"_pp"
);
if
(
mmask
&
WINE
D3DSPDM_MSAMPCENTROID
)
TRACE
(
"_centroid"
);
mmask
&=
~
(
D3DSPDM_SATURATE
|
D3DSPDM_PARTIALPRECISION
|
D3DSPDM_MSAMPCENTROID
);
mmask
&=
~
(
WINED3DSPDM_SATURATE
|
WINED3DSPDM_PARTIALPRECISION
|
WINE
D3DSPDM_MSAMPCENTROID
);
if
(
mmask
)
FIXME
(
"_unrecognized_modifier(%#x)"
,
mmask
>>
D3DSP_DSTMOD_SHIFT
);
FIXME
(
"_unrecognized_modifier(%#x)"
,
mmask
>>
WINE
D3DSP_DSTMOD_SHIFT
);
}
/* First pass: trace shader, initialize length and version */
...
...
dlls/wined3d/glsl_shader.c
View file @
82379f22
...
...
@@ -504,7 +504,7 @@ static const char* shift_glsl_tab[] = {
* Will also change the reg_mask if necessary (not all register types are equal in DX vs GL) */
static
void
shader_glsl_add_dst
(
DWORD
param
,
const
char
*
reg_name
,
char
*
reg_mask
,
char
*
outStr
)
{
int
shift
=
(
param
&
D3DSP_DSTSHIFT_MASK
)
>>
D3DSP_DSTSHIFT_SHIFT
;
int
shift
=
(
param
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINE
D3DSP_DSTSHIFT_SHIFT
;
char
cast
[
6
];
if
((
shader_get_regtype
(
param
)
==
WINED3DSPR_RASTOUT
)
...
...
@@ -728,12 +728,12 @@ static void shader_glsl_get_output_register_swizzle(
char
*
write_mask
)
{
*
write_mask
=
0
;
if
((
param
&
D3DSP_WRITEMASK_ALL
)
!=
D3DSP_WRITEMASK_ALL
)
{
if
((
param
&
WINED3DSP_WRITEMASK_ALL
)
!=
WINE
D3DSP_WRITEMASK_ALL
)
{
strcat
(
write_mask
,
"."
);
if
(
param
&
D3DSP_WRITEMASK_0
)
strcat
(
write_mask
,
"x"
);
if
(
param
&
D3DSP_WRITEMASK_1
)
strcat
(
write_mask
,
"y"
);
if
(
param
&
D3DSP_WRITEMASK_2
)
strcat
(
write_mask
,
"z"
);
if
(
param
&
D3DSP_WRITEMASK_3
)
strcat
(
write_mask
,
"w"
);
if
(
param
&
WINE
D3DSP_WRITEMASK_0
)
strcat
(
write_mask
,
"x"
);
if
(
param
&
WINE
D3DSP_WRITEMASK_1
)
strcat
(
write_mask
,
"y"
);
if
(
param
&
WINE
D3DSP_WRITEMASK_2
)
strcat
(
write_mask
,
"z"
);
if
(
param
&
WINE
D3DSP_WRITEMASK_3
)
strcat
(
write_mask
,
"w"
);
}
}
...
...
@@ -816,7 +816,7 @@ static void shader_glsl_add_param(
/** Process GLSL instruction modifiers */
void
shader_glsl_add_instruction_modifiers
(
SHADER_OPCODE_ARG
*
arg
)
{
DWORD
mask
=
arg
->
dst
&
D3DSP_DSTMOD_MASK
;
DWORD
mask
=
arg
->
dst
&
WINE
D3DSP_DSTMOD_MASK
;
if
(
arg
->
opcode
->
dst_token
&&
mask
!=
0
)
{
char
dst_reg
[
50
];
...
...
@@ -825,14 +825,14 @@ void shader_glsl_add_instruction_modifiers(SHADER_OPCODE_ARG* arg) {
shader_glsl_add_param
(
arg
,
arg
->
dst
,
0
,
FALSE
,
dst_reg
,
dst_mask
,
dst_str
);
if
(
mask
&
D3DSPDM_SATURATE
)
{
if
(
mask
&
WINE
D3DSPDM_SATURATE
)
{
/* _SAT means to clamp the value of the register to between 0 and 1 */
shader_addline
(
arg
->
buffer
,
"%s%s = clamp(%s%s, 0.0, 1.0);
\n
"
,
dst_reg
,
dst_mask
,
dst_reg
,
dst_mask
);
}
if
(
mask
&
D3DSPDM_MSAMPCENTROID
)
{
if
(
mask
&
WINE
D3DSPDM_MSAMPCENTROID
)
{
FIXME
(
"_centroid modifier not handled
\n
"
);
}
if
(
mask
&
D3DSPDM_PARTIALPRECISION
)
{
if
(
mask
&
WINE
D3DSPDM_PARTIALPRECISION
)
{
/* MSDN says this modifier can be safely ignored, so that's what we'll do. */
}
}
...
...
@@ -1163,7 +1163,7 @@ void shader_glsl_mnxn(SHADER_OPCODE_ARG* arg) {
}
for
(
i
=
0
;
i
<
nComponents
;
i
++
)
{
tmpArg
.
dst
=
((
arg
->
dst
)
&
~
D3DSP_WRITEMASK_ALL
)
|
(
D3DSP_WRITEMASK_0
<<
i
);
tmpArg
.
dst
=
((
arg
->
dst
)
&
~
WINED3DSP_WRITEMASK_ALL
)
|
(
WINE
D3DSP_WRITEMASK_0
<<
i
);
tmpArg
.
src
[
1
]
=
arg
->
src
[
1
]
+
i
;
shader_glsl_dot
(
&
tmpArg
);
}
...
...
dlls/wined3d/vertexshader.c
View file @
82379f22
...
...
@@ -627,7 +627,7 @@ static void vshader_set_input(
/* Fake register; set reserved bit, regnum, type: input, wmask: all */
DWORD
reg_token
=
(
0x1
<<
31
)
|
D3DSP_WRITEMASK_ALL
|
(
WINED3DSPR_INPUT
<<
WINED3DSP_REGTYPE_SHIFT
)
|
regnum
;
WINE
D3DSP_WRITEMASK_ALL
|
(
WINED3DSPR_INPUT
<<
WINED3DSP_REGTYPE_SHIFT
)
|
regnum
;
This
->
semantics_in
[
regnum
].
usage
=
usage_token
;
This
->
semantics_in
[
regnum
].
reg
=
reg_token
;
...
...
@@ -991,7 +991,7 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_ExecuteSW(IWineD3DVertexShader* iface, W
p_send
[
i
]
=
&
s
[
i
];
}
}
else
{
/* output reg */
if
((
pToken
[
i
]
&
D3DSP_WRITEMASK_ALL
)
==
D3DSP_WRITEMASK_ALL
)
{
if
((
pToken
[
i
]
&
WINED3DSP_WRITEMASK_ALL
)
==
WINE
D3DSP_WRITEMASK_ALL
)
{
p_send
[
i
]
=
p
[
i
];
}
else
{
p_send
[
i
]
=
&
d
;
/* to be post-processed for modifiers management */
...
...
@@ -1027,11 +1027,13 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_ExecuteSW(IWineD3DVertexShader* iface, W
}
/* check if output reg modifier post-process */
if
(
curOpcode
->
num_params
>
0
&&
(
pToken
[
0
]
&
D3DSP_WRITEMASK_ALL
)
!=
D3DSP_WRITEMASK_ALL
)
{
if
(
pToken
[
0
]
&
D3DSP_WRITEMASK_0
)
p
[
0
]
->
x
=
d
.
x
;
if
(
pToken
[
0
]
&
D3DSP_WRITEMASK_1
)
p
[
0
]
->
y
=
d
.
y
;
if
(
pToken
[
0
]
&
D3DSP_WRITEMASK_2
)
p
[
0
]
->
z
=
d
.
z
;
if
(
pToken
[
0
]
&
D3DSP_WRITEMASK_3
)
p
[
0
]
->
w
=
d
.
w
;
if
(
curOpcode
->
num_params
>
0
&&
(
pToken
[
0
]
&
WINED3DSP_WRITEMASK_ALL
)
!=
WINED3DSP_WRITEMASK_ALL
)
{
if
(
pToken
[
0
]
&
WINED3DSP_WRITEMASK_0
)
p
[
0
]
->
x
=
d
.
x
;
if
(
pToken
[
0
]
&
WINED3DSP_WRITEMASK_1
)
p
[
0
]
->
y
=
d
.
y
;
if
(
pToken
[
0
]
&
WINED3DSP_WRITEMASK_2
)
p
[
0
]
->
z
=
d
.
z
;
if
(
pToken
[
0
]
&
WINED3DSP_WRITEMASK_3
)
p
[
0
]
->
w
=
d
.
w
;
}
#if 0
TRACE_VSVECTOR(output->oPos);
...
...
dlls/wined3d/wined3d_private_types.h
View file @
82379f22
...
...
@@ -134,6 +134,28 @@ typedef enum _WINED3DSHADER_PARAM_SRCMOD_TYPE {
WINED3DSPSM_FORCE_DWORD
=
0x7FFFFFFF
}
WINED3DSHADER_PARAM_SRCMOD_TYPE
;
/** Destination register modifiers **/
#define WINED3DSP_WRITEMASK_0 0x00010000
/* .x r */
#define WINED3DSP_WRITEMASK_1 0x00020000
/* .y g */
#define WINED3DSP_WRITEMASK_2 0x00040000
/* .z b */
#define WINED3DSP_WRITEMASK_3 0x00080000
/* .w a */
#define WINED3DSP_WRITEMASK_ALL 0x000F0000
/* all */
#define WINED3DSP_DSTMOD_SHIFT 20
#define WINED3DSP_DSTMOD_MASK (0xF << WINED3DSP_DSTMOD_SHIFT)
typedef
enum
_WINED3DSHADER_PARAM_DSTMOD_TYPE
{
WINED3DSPDM_NONE
=
0
<<
WINED3DSP_DSTMOD_SHIFT
,
WINED3DSPDM_SATURATE
=
1
<<
WINED3DSP_DSTMOD_SHIFT
,
WINED3DSPDM_PARTIALPRECISION
=
2
<<
WINED3DSP_DSTMOD_SHIFT
,
WINED3DSPDM_MSAMPCENTROID
=
4
<<
WINED3DSP_DSTMOD_SHIFT
,
WINED3DSPDM_FORCE_DWORD
=
0x7FFFFFFF
}
WINED3DSHADER_PARAM_DSTMOD_TYPE
;
#define WINED3DSP_DSTSHIFT_SHIFT 24
#define WINED3DSP_DSTSHIFT_MASK (0xF << WINED3DSP_DSTSHIFT_SHIFT)
/** opcodes types for PS and VS */
typedef
enum
_WINED3DSHADER_INSTRUCTION_OPCODE_TYPE
{
WINED3DSIO_NOP
=
0
,
...
...
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