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
5e473cb1
Commit
5e473cb1
authored
May 07, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
May 08, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Group register information into struct wined3d_shader_register.
parent
0bc112cf
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
168 additions
and
162 deletions
+168
-162
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+58
-58
baseshader.c
dlls/wined3d/baseshader.c
+29
-29
glsl_shader.c
dlls/wined3d/glsl_shader.c
+49
-46
shader_sm1.c
dlls/wined3d/shader_sm1.c
+6
-6
shader_sm4.c
dlls/wined3d/shader_sm4.c
+12
-12
vertexshader.c
dlls/wined3d/vertexshader.c
+3
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+11
-8
No files found.
dlls/wined3d/arb_program_shader.c
View file @
5e473cb1
...
...
@@ -423,7 +423,7 @@ static void shader_arb_get_write_mask(const struct wined3d_shader_instruction *i
char
*
ptr
=
write_mask
;
char
vshader
=
shader_is_vshader_version
(
ins
->
ctx
->
reg_maps
->
shader_version
.
type
);
if
(
vshader
&&
dst
->
reg
ister_
type
==
WINED3DSPR_ADDR
)
if
(
vshader
&&
dst
->
reg
.
type
==
WINED3DSPR_ADDR
)
{
*
ptr
++
=
'.'
;
*
ptr
++
=
'x'
;
...
...
@@ -574,8 +574,8 @@ static void shader_arb_add_src_param(const struct wined3d_shader_instruction *in
if
(
wined3d_src
->
modifiers
==
WINED3DSPSM_NEG
)
strcat
(
str
,
" -"
);
else
strcat
(
str
,
" "
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
wined3d_src
->
reg
ister_
type
,
wined3d_src
->
reg
ister_idx
,
!!
wined3d_src
->
rel_addr
,
register_name
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
wined3d_src
->
reg
.
type
,
wined3d_src
->
reg
.
idx
,
!!
wined3d_src
->
reg
.
rel_addr
,
register_name
,
&
is_color
);
strcat
(
str
,
register_name
);
shader_arb_get_swizzle
(
wined3d_src
,
is_color
,
swizzle
);
...
...
@@ -591,8 +591,8 @@ static void shader_arb_add_dst_param(const struct wined3d_shader_instruction *in
strcat
(
str
,
" "
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
wined3d_dst
->
reg
ister_
type
,
wined3d_dst
->
reg
ister_idx
,
!!
wined3d_dst
->
rel_addr
,
register_name
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
wined3d_dst
->
reg
.
type
,
wined3d_dst
->
reg
.
idx
,
!!
wined3d_dst
->
reg
.
rel_addr
,
register_name
,
&
is_color
);
strcat
(
str
,
register_name
);
shader_arb_get_write_mask
(
ins
,
wined3d_dst
,
write_mask
);
...
...
@@ -742,8 +742,8 @@ static void pshader_gen_input_modifier_line(IWineD3DBaseShader *iface, SHADER_BU
insert_line
=
1
;
/* Get register name */
shader_arb_get_register_name
(
iface
,
src
->
reg
ister_
type
,
src
->
reg
ister_idx
,
!!
src
->
rel_addr
,
regstr
,
&
is_color
);
shader_arb_get_register_name
(
iface
,
src
->
reg
.
type
,
src
->
reg
.
idx
,
!!
src
->
reg
.
rel_addr
,
regstr
,
&
is_color
);
shader_arb_get_swizzle
(
src
,
is_color
,
swzstr
);
switch
(
src
->
modifiers
)
...
...
@@ -811,7 +811,7 @@ static void pshader_hw_bem(const struct wined3d_shader_instruction *ins)
char
dst_name
[
50
];
char
src_name
[
2
][
50
];
char
dst_wmask
[
20
];
DWORD
sampler_code
=
dst
->
reg
ister_
idx
;
DWORD
sampler_code
=
dst
->
reg
.
idx
;
BOOL
has_bumpmat
=
FALSE
;
BOOL
is_color
;
int
i
;
...
...
@@ -825,8 +825,8 @@ static void pshader_hw_bem(const struct wined3d_shader_instruction *ins)
}
}
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
ister_
type
,
dst
->
reg
ister_idx
,
!!
dst
->
rel_addr
,
dst_name
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
.
type
,
dst
->
reg
.
idx
,
!!
dst
->
reg
.
rel_addr
,
dst_name
,
&
is_color
);
shader_arb_get_write_mask
(
ins
,
dst
,
dst_wmask
);
strcat
(
dst_name
,
dst_wmask
);
...
...
@@ -862,8 +862,8 @@ static void pshader_hw_cnd(const struct wined3d_shader_instruction *ins)
/* FIXME: support output modifiers */
/* Handle output register */
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
ister_
type
,
dst
->
reg
ister_idx
,
!!
dst
->
rel_addr
,
dst_name
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
.
type
,
dst
->
reg
.
idx
,
!!
dst
->
reg
.
rel_addr
,
dst_name
,
&
is_color
);
shader_arb_get_write_mask
(
ins
,
dst
,
dst_wmask
);
/* Generate input register names (with modifiers) */
...
...
@@ -898,8 +898,8 @@ static void pshader_hw_cmp(const struct wined3d_shader_instruction *ins)
/* FIXME: support output modifiers */
/* Handle output register */
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
ister_
type
,
dst
->
reg
ister_idx
,
!!
dst
->
rel_addr
,
dst_name
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
.
type
,
dst
->
reg
.
idx
,
!!
dst
->
reg
.
rel_addr
,
dst_name
,
&
is_color
);
shader_arb_get_write_mask
(
ins
,
dst
,
dst_wmask
);
/* Generate input register names (with modifiers) */
...
...
@@ -927,8 +927,8 @@ static void pshader_hw_dp2add(const struct wined3d_shader_instruction *ins)
BOOL
sat
=
dst
->
modifiers
&
WINED3DSPDM_SATURATE
;
BOOL
is_color
;
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
ister_
type
,
dst
->
reg
ister_idx
,
!!
dst
->
rel_addr
,
dst_name
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
.
type
,
dst
->
reg
.
idx
,
!!
dst
->
reg
.
rel_addr
,
dst_name
,
&
is_color
);
shader_arb_get_write_mask
(
ins
,
dst
,
dst_wmask
);
pshader_gen_input_modifier_line
(
ins
->
ctx
->
shader
,
buffer
,
&
ins
->
src
[
0
],
0
,
src_name
[
0
]);
...
...
@@ -1029,8 +1029,8 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins)
}
/* Handle output register */
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
ister_
type
,
dst
->
reg
ister_idx
,
!!
dst
->
rel_addr
,
output_rname
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
.
type
,
dst
->
reg
.
idx
,
!!
dst
->
reg
.
rel_addr
,
output_rname
,
&
is_color
);
strcpy
(
operands
[
0
],
output_rname
);
shader_arb_get_write_mask
(
ins
,
dst
,
output_wmask
);
strcat
(
operands
[
0
],
output_wmask
);
...
...
@@ -1069,7 +1069,7 @@ static void shader_hw_mov(const struct wined3d_shader_instruction *ins)
if
((
ins
->
ctx
->
reg_maps
->
shader_version
.
major
==
1
&&
!
shader_is_pshader_version
(
ins
->
ctx
->
reg_maps
->
shader_version
.
type
)
&&
ins
->
dst
[
0
].
reg
ister_
type
==
WINED3DSPR_ADDR
)
&&
ins
->
dst
[
0
].
reg
.
type
==
WINED3DSPR_ADDR
)
||
ins
->
handler_idx
==
WINED3DSIH_MOVA
)
{
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
...
...
@@ -1112,8 +1112,8 @@ static void pshader_hw_texkill(const struct wined3d_shader_instruction *ins)
/* No swizzles are allowed in d3d's texkill. PS 1.x ignores the 4th component as documented,
* but >= 2.0 honors it(undocumented, but tested by the d3d9 testsuit)
*/
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
ister_
type
,
dst
->
reg
ister_idx
,
!!
dst
->
rel_addr
,
reg_dest
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
.
type
,
dst
->
reg
.
idx
,
!!
dst
->
reg
.
rel_addr
,
reg_dest
,
&
is_color
);
if
(
ins
->
ctx
->
reg_maps
->
shader_version
.
major
>=
2
)
{
...
...
@@ -1145,8 +1145,8 @@ static void pshader_hw_tex(const struct wined3d_shader_instruction *ins)
DWORD
reg_sampler_code
;
/* All versions have a destination register */
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
ister_
type
,
dst
->
reg
ister_idx
,
!!
dst
->
rel_addr
,
reg_dest
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
.
type
,
dst
->
reg
.
idx
,
!!
dst
->
reg
.
rel_addr
,
reg_dest
,
&
is_color
);
/* 1.0-1.3: Use destination register as coordinate source.
1.4+: Use provided coordinate source register. */
...
...
@@ -1158,9 +1158,9 @@ static void pshader_hw_tex(const struct wined3d_shader_instruction *ins)
/* 1.0-1.4: Use destination register number as texture code.
2.0+: Use provided sampler number as texure code. */
if
(
shader_version
<
WINED3D_SHADER_VERSION
(
2
,
0
))
reg_sampler_code
=
dst
->
reg
ister_
idx
;
reg_sampler_code
=
dst
->
reg
.
idx
;
else
reg_sampler_code
=
ins
->
src
[
1
].
reg
ister_
idx
;
reg_sampler_code
=
ins
->
src
[
1
].
reg
.
idx
;
/* projection flag:
* 1.1, 1.2, 1.3: Use WINED3DTSS_TEXTURETRANSFORMFLAGS
...
...
@@ -1203,13 +1203,13 @@ static void pshader_hw_texcoord(const struct wined3d_shader_instruction *ins)
shader_arb_get_write_mask
(
ins
,
dst
,
tmp
);
if
(
shader_version
!=
WINED3D_SHADER_VERSION
(
1
,
4
))
{
DWORD
reg
=
dst
->
reg
ister_
idx
;
DWORD
reg
=
dst
->
reg
.
idx
;
shader_addline
(
buffer
,
"MOV_SAT T%u%s, fragment.texcoord[%u];
\n
"
,
reg
,
tmp
,
reg
);
}
else
{
char
reg_src
[
40
];
pshader_gen_input_modifier_line
(
ins
->
ctx
->
shader
,
buffer
,
&
ins
->
src
[
0
],
0
,
reg_src
);
shader_addline
(
buffer
,
"MOV R%u%s, %s;
\n
"
,
dst
->
reg
ister_
idx
,
tmp
,
reg_src
);
shader_addline
(
buffer
,
"MOV R%u%s, %s;
\n
"
,
dst
->
reg
.
idx
,
tmp
,
reg_src
);
}
}
...
...
@@ -1220,7 +1220,7 @@ static void pshader_hw_texreg2ar(const struct wined3d_shader_instruction *ins)
IWineD3DDeviceImpl
*
deviceImpl
=
(
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
;
DWORD
flags
;
DWORD
reg1
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg1
=
ins
->
dst
[
0
].
reg
.
idx
;
char
dst_str
[
8
];
char
src_str
[
50
];
...
...
@@ -1236,7 +1236,7 @@ static void pshader_hw_texreg2gb(const struct wined3d_shader_instruction *ins)
{
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
DWORD
reg1
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg1
=
ins
->
dst
[
0
].
reg
.
idx
;
char
dst_str
[
8
];
char
src_str
[
50
];
...
...
@@ -1250,7 +1250,7 @@ static void pshader_hw_texreg2gb(const struct wined3d_shader_instruction *ins)
static
void
pshader_hw_texreg2rgb
(
const
struct
wined3d_shader_instruction
*
ins
)
{
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
DWORD
reg1
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg1
=
ins
->
dst
[
0
].
reg
.
idx
;
char
dst_str
[
8
];
char
src_str
[
50
];
...
...
@@ -1274,10 +1274,10 @@ static void pshader_hw_texbem(const struct wined3d_shader_instruction *ins)
DWORD
reg_dest_code
;
/* All versions have a destination register */
reg_dest_code
=
dst
->
reg
ister_
idx
;
reg_dest_code
=
dst
->
reg
.
idx
;
/* Can directly use the name because texbem is only valid for <= 1.3 shaders */
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
ister_
type
,
dst
->
reg
ister_idx
,
!!
dst
->
rel_addr
,
reg_coord
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
.
type
,
dst
->
reg
.
idx
,
!!
dst
->
reg
.
rel_addr
,
reg_coord
,
&
is_color
);
for
(
i
=
0
;
i
<
This
->
numbumpenvmatconsts
;
i
++
)
{
if
(
This
->
bumpenvmatconst
[
i
].
const_num
!=
WINED3D_CONST_NUM_UNUSED
...
...
@@ -1297,7 +1297,7 @@ static void pshader_hw_texbem(const struct wined3d_shader_instruction *ins)
}
if
(
has_bumpmat
)
{
DWORD
src
=
ins
->
src
[
0
].
reg
ister_
idx
;
DWORD
src
=
ins
->
src
[
0
].
reg
.
idx
;
/* Sampling the perturbation map in Tsrc was done already, including the signedness correction if needed */
...
...
@@ -1341,7 +1341,7 @@ static void pshader_hw_texbem(const struct wined3d_shader_instruction *ins)
static
void
pshader_hw_texm3x2pad
(
const
struct
wined3d_shader_instruction
*
ins
)
{
DWORD
reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
.
idx
;
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
char
src0_name
[
50
];
...
...
@@ -1354,7 +1354,7 @@ static void pshader_hw_texm3x2tex(const struct wined3d_shader_instruction *ins)
IWineD3DPixelShaderImpl
*
This
=
(
IWineD3DPixelShaderImpl
*
)
ins
->
ctx
->
shader
;
IWineD3DDeviceImpl
*
deviceImpl
=
(
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
;
DWORD
flags
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
.
idx
;
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
char
dst_str
[
8
];
char
src0_name
[
50
];
...
...
@@ -1369,7 +1369,7 @@ static void pshader_hw_texm3x2tex(const struct wined3d_shader_instruction *ins)
static
void
pshader_hw_texm3x3pad
(
const
struct
wined3d_shader_instruction
*
ins
)
{
IWineD3DPixelShaderImpl
*
This
=
(
IWineD3DPixelShaderImpl
*
)
ins
->
ctx
->
shader
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
.
idx
;
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
SHADER_PARSE_STATE
*
current_state
=
&
This
->
baseShader
.
parse_state
;
char
src0_name
[
50
];
...
...
@@ -1384,7 +1384,7 @@ static void pshader_hw_texm3x3tex(const struct wined3d_shader_instruction *ins)
IWineD3DPixelShaderImpl
*
This
=
(
IWineD3DPixelShaderImpl
*
)
ins
->
ctx
->
shader
;
IWineD3DDeviceImpl
*
deviceImpl
=
(
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
;
DWORD
flags
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
.
idx
;
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
SHADER_PARSE_STATE
*
current_state
=
&
This
->
baseShader
.
parse_state
;
char
dst_str
[
8
];
...
...
@@ -1405,7 +1405,7 @@ static void pshader_hw_texm3x3vspec(const struct wined3d_shader_instruction *ins
IWineD3DPixelShaderImpl
*
This
=
(
IWineD3DPixelShaderImpl
*
)
ins
->
ctx
->
shader
;
IWineD3DDeviceImpl
*
deviceImpl
=
(
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
;
DWORD
flags
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
.
idx
;
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
SHADER_PARSE_STATE
*
current_state
=
&
This
->
baseShader
.
parse_state
;
char
dst_str
[
8
];
...
...
@@ -1441,8 +1441,8 @@ static void pshader_hw_texm3x3spec(const struct wined3d_shader_instruction *ins)
IWineD3DPixelShaderImpl
*
This
=
(
IWineD3DPixelShaderImpl
*
)
ins
->
ctx
->
shader
;
IWineD3DDeviceImpl
*
deviceImpl
=
(
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
;
DWORD
flags
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg3
=
ins
->
src
[
1
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
.
idx
;
DWORD
reg3
=
ins
->
src
[
1
].
reg
.
idx
;
SHADER_PARSE_STATE
*
current_state
=
&
This
->
baseShader
.
parse_state
;
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
char
dst_str
[
8
];
...
...
@@ -1485,8 +1485,8 @@ static void pshader_hw_texdepth(const struct wined3d_shader_instruction *ins)
* parameter. According to the msdn, this must be register r5, but let's keep it more flexible
* here
*/
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
ister_
type
,
dst
->
reg
ister_idx
,
!!
dst
->
rel_addr
,
dst_name
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
.
type
,
dst
->
reg
.
idx
,
!!
dst
->
reg
.
rel_addr
,
dst_name
,
&
is_color
);
/* According to the msdn, the source register(must be r5) is unusable after
* the texdepth instruction, so we're free to modify it
...
...
@@ -1509,7 +1509,7 @@ static void pshader_hw_texdepth(const struct wined3d_shader_instruction *ins)
static
void
pshader_hw_texdp3tex
(
const
struct
wined3d_shader_instruction
*
ins
)
{
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
DWORD
sampler_idx
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
sampler_idx
=
ins
->
dst
[
0
].
reg
.
idx
;
char
src0
[
50
];
char
dst_str
[
8
];
...
...
@@ -1533,12 +1533,12 @@ static void pshader_hw_texdp3(const struct wined3d_shader_instruction *ins)
BOOL
is_color
;
/* Handle output register */
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
ister_
type
,
dst
->
reg
ister_idx
,
!!
dst
->
rel_addr
,
dst_str
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
.
type
,
dst
->
reg
.
idx
,
!!
dst
->
reg
.
rel_addr
,
dst_str
,
&
is_color
);
shader_arb_get_write_mask
(
ins
,
dst
,
dst_mask
);
pshader_gen_input_modifier_line
(
ins
->
ctx
->
shader
,
buffer
,
&
ins
->
src
[
0
],
0
,
src0
);
shader_addline
(
buffer
,
"DP3 %s%s, T%u, %s;
\n
"
,
dst_str
,
dst_mask
,
dst
->
reg
ister_
idx
,
src0
);
shader_addline
(
buffer
,
"DP3 %s%s, T%u, %s;
\n
"
,
dst_str
,
dst_mask
,
dst
->
reg
.
idx
,
src0
);
/* TODO: Handle output modifiers */
}
...
...
@@ -1554,12 +1554,12 @@ static void pshader_hw_texm3x3(const struct wined3d_shader_instruction *ins)
char
src0
[
50
];
BOOL
is_color
;
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
ister_
type
,
dst
->
reg
ister_idx
,
!!
dst
->
rel_addr
,
dst_str
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
.
type
,
dst
->
reg
.
idx
,
!!
dst
->
reg
.
rel_addr
,
dst_str
,
&
is_color
);
shader_arb_get_write_mask
(
ins
,
dst
,
dst_mask
);
pshader_gen_input_modifier_line
(
ins
->
ctx
->
shader
,
buffer
,
&
ins
->
src
[
0
],
0
,
src0
);
shader_addline
(
buffer
,
"DP3 TMP.z, T%u, %s;
\n
"
,
dst
->
reg
ister_
idx
,
src0
);
shader_addline
(
buffer
,
"DP3 TMP.z, T%u, %s;
\n
"
,
dst
->
reg
.
idx
,
src0
);
shader_addline
(
buffer
,
"MOV %s%s, TMP;
\n
"
,
dst_str
,
dst_mask
);
/* TODO: Handle output modifiers */
...
...
@@ -1573,7 +1573,7 @@ static void pshader_hw_texm3x3(const struct wined3d_shader_instruction *ins)
static
void
pshader_hw_texm3x2depth
(
const
struct
wined3d_shader_instruction
*
ins
)
{
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
DWORD
dst_reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
dst_reg
=
ins
->
dst
[
0
].
reg
.
idx
;
char
src0
[
50
];
pshader_gen_input_modifier_line
(
ins
->
ctx
->
shader
,
buffer
,
&
ins
->
src
[
0
],
0
,
src0
);
...
...
@@ -1595,8 +1595,8 @@ static void shader_hw_mnxn(const struct wined3d_shader_instruction *ins)
{
int
i
;
int
nComponents
=
0
;
struct
wined3d_shader_dst_param
tmp_dst
=
{
0
};
struct
wined3d_shader_src_param
tmp_src
[
2
]
=
{{
0
}};
struct
wined3d_shader_dst_param
tmp_dst
=
{
{
0
}
};
struct
wined3d_shader_src_param
tmp_src
[
2
]
=
{{
{
0
}
}};
struct
wined3d_shader_instruction
tmp_ins
;
memset
(
&
tmp_ins
,
0
,
sizeof
(
tmp_ins
));
...
...
@@ -1641,7 +1641,7 @@ static void shader_hw_mnxn(const struct wined3d_shader_instruction *ins)
for
(
i
=
0
;
i
<
nComponents
;
i
++
)
{
tmp_dst
.
write_mask
=
WINED3DSP_WRITEMASK_0
<<
i
;
shader_hw_map2gl
(
&
tmp_ins
);
++
tmp_src
[
1
].
reg
ister_
idx
;
++
tmp_src
[
1
].
reg
.
idx
;
}
}
...
...
@@ -1687,8 +1687,8 @@ static void shader_hw_nrm(const struct wined3d_shader_instruction *ins)
BOOL
sat
=
dst
->
modifiers
&
WINED3DSPDM_SATURATE
;
BOOL
is_color
;
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
ister_
type
,
dst
->
reg
ister_idx
,
!!
dst
->
rel_addr
,
dst_name
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
.
type
,
dst
->
reg
.
idx
,
!!
dst
->
reg
.
rel_addr
,
dst_name
,
&
is_color
);
shader_arb_get_write_mask
(
ins
,
dst
,
dst_wmask
);
pshader_gen_input_modifier_line
(
ins
->
ctx
->
shader
,
buffer
,
&
ins
->
src
[
0
],
0
,
src_name
);
...
...
@@ -1717,8 +1717,8 @@ static void shader_hw_sincos(const struct wined3d_shader_instruction *ins)
BOOL
sat
=
dst
->
modifiers
&
WINED3DSPDM_SATURATE
;
BOOL
is_color
;
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
ister_
type
,
dst
->
reg
ister_idx
,
!!
dst
->
rel_addr
,
dst_name
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
dst
->
reg
.
type
,
dst
->
reg
.
idx
,
!!
dst
->
reg
.
rel_addr
,
dst_name
,
&
is_color
);
shader_arb_get_write_mask
(
ins
,
dst
,
dst_wmask
);
pshader_gen_input_modifier_line
(
ins
->
ctx
->
shader
,
buffer
,
&
ins
->
src
[
0
],
0
,
src_name
);
...
...
dlls/wined3d/baseshader.c
View file @
5e473cb1
...
...
@@ -366,30 +366,30 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
fe
->
shader_read_semantic
(
&
pToken
,
&
semantic
);
switch
(
semantic
.
reg
.
reg
ister_
type
)
switch
(
semantic
.
reg
.
reg
.
type
)
{
/* Vshader: mark attributes used
* Pshader: mark 3.0 input registers used, save token */
case
WINED3DSPR_INPUT
:
if
(
!
pshader
)
reg_maps
->
attributes
[
semantic
.
reg
.
reg
ister_
idx
]
=
1
;
else
reg_maps
->
packed_input
[
semantic
.
reg
.
reg
ister_
idx
]
=
1
;
semantics_in
[
semantic
.
reg
.
reg
ister_
idx
]
=
semantic
;
if
(
!
pshader
)
reg_maps
->
attributes
[
semantic
.
reg
.
reg
.
idx
]
=
1
;
else
reg_maps
->
packed_input
[
semantic
.
reg
.
reg
.
idx
]
=
1
;
semantics_in
[
semantic
.
reg
.
reg
.
idx
]
=
semantic
;
break
;
/* Vshader: mark 3.0 output registers used, save token */
case
WINED3DSPR_OUTPUT
:
reg_maps
->
packed_output
[
semantic
.
reg
.
reg
ister_
idx
]
=
1
;
semantics_out
[
semantic
.
reg
.
reg
ister_
idx
]
=
semantic
;
reg_maps
->
packed_output
[
semantic
.
reg
.
reg
.
idx
]
=
1
;
semantics_out
[
semantic
.
reg
.
reg
.
idx
]
=
semantic
;
if
(
semantic
.
usage
==
WINED3DDECLUSAGE_FOG
)
reg_maps
->
fog
=
1
;
break
;
/* Save sampler usage token */
case
WINED3DSPR_SAMPLER
:
reg_maps
->
sampler_type
[
semantic
.
reg
.
reg
ister_
idx
]
=
semantic
.
sampler_type
;
reg_maps
->
sampler_type
[
semantic
.
reg
.
reg
.
idx
]
=
semantic
.
sampler_type
;
break
;
default:
TRACE
(
"Not recording DCL register type %#x.
\n
"
,
semantic
.
reg
.
reg
ister_
type
);
TRACE
(
"Not recording DCL register type %#x.
\n
"
,
semantic
.
reg
.
reg
.
type
);
break
;
}
}
...
...
@@ -402,7 +402,7 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
if
(
!
lconst
)
return
E_OUTOFMEMORY
;
fe
->
shader_read_dst_param
(
fe_data
,
&
pToken
,
&
dst
,
&
rel_addr
);
lconst
->
idx
=
dst
.
reg
ister_
idx
;
lconst
->
idx
=
dst
.
reg
.
idx
;
memcpy
(
lconst
->
value
,
pToken
,
4
*
sizeof
(
DWORD
));
pToken
+=
4
;
...
...
@@ -432,7 +432,7 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
if
(
!
lconst
)
return
E_OUTOFMEMORY
;
fe
->
shader_read_dst_param
(
fe_data
,
&
pToken
,
&
dst
,
&
rel_addr
);
lconst
->
idx
=
dst
.
reg
ister_
idx
;
lconst
->
idx
=
dst
.
reg
.
idx
;
memcpy
(
lconst
->
value
,
pToken
,
4
*
sizeof
(
DWORD
));
pToken
+=
4
;
...
...
@@ -448,7 +448,7 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
if
(
!
lconst
)
return
E_OUTOFMEMORY
;
fe
->
shader_read_dst_param
(
fe_data
,
&
pToken
,
&
dst
,
&
rel_addr
);
lconst
->
idx
=
dst
.
reg
ister_
idx
;
lconst
->
idx
=
dst
.
reg
.
idx
;
memcpy
(
lconst
->
value
,
pToken
,
sizeof
(
DWORD
));
++
pToken
;
...
...
@@ -466,12 +466,12 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
/* Rep and Loop always use an integer constant for the control parameters */
if
(
ins
.
handler_idx
==
WINED3DSIH_REP
)
{
reg_maps
->
integer_constants
|=
1
<<
src
.
reg
ister_
idx
;
reg_maps
->
integer_constants
|=
1
<<
src
.
reg
.
idx
;
}
else
{
fe
->
shader_read_src_param
(
fe_data
,
&
pToken
,
&
src
,
&
rel_addr
);
reg_maps
->
integer_constants
|=
1
<<
src
.
reg
ister_
idx
;
reg_maps
->
integer_constants
|=
1
<<
src
.
reg
.
idx
;
}
cur_loop_depth
++
;
...
...
@@ -489,7 +489,7 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
struct
wined3d_shader_src_param
src
,
rel_addr
;
fe
->
shader_read_src_param
(
fe_data
,
&
pToken
,
&
src
,
&
rel_addr
);
reg_maps
->
labels
[
src
.
reg
ister_
idx
]
=
1
;
reg_maps
->
labels
[
src
.
reg
.
idx
]
=
1
;
}
/* Set texture, address, temporary registers */
else
...
...
@@ -513,14 +513,14 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
/* WINED3DSPR_TEXCRDOUT is the same as WINED3DSPR_OUTPUT. _OUTPUT can be > MAX_REG_TEXCRD and
* is used in >= 3.0 shaders. Filter 3.0 shaders to prevent overflows, and also filter pixel
* shaders because TECRDOUT isn't used in them, but future register types might cause issues */
if
(
!
pshader
&&
shader_version
.
major
<
3
&&
dst_param
.
reg
ister_
type
==
WINED3DSPR_TEXCRDOUT
)
if
(
!
pshader
&&
shader_version
.
major
<
3
&&
dst_param
.
reg
.
type
==
WINED3DSPR_TEXCRDOUT
)
{
reg_maps
->
texcoord_mask
[
dst_param
.
reg
ister_
type
]
|=
dst_param
.
write_mask
;
reg_maps
->
texcoord_mask
[
dst_param
.
reg
.
type
]
|=
dst_param
.
write_mask
;
}
else
{
shader_record_register_usage
(
This
,
reg_maps
,
dst_param
.
reg
ister_
type
,
dst_param
.
reg
ister_idx
,
!!
dst_param
.
rel_addr
,
pshader
);
shader_record_register_usage
(
This
,
reg_maps
,
dst_param
.
reg
.
type
,
dst_param
.
reg
.
idx
,
!!
dst_param
.
reg
.
rel_addr
,
pshader
);
}
/* Declare 1.X samplers implicitly, based on the destination reg. number */
...
...
@@ -539,7 +539,7 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
||
ins
.
handler_idx
==
WINED3DSIH_TEXREG2RGB
))
{
/* Fake sampler usage, only set reserved bit and ttype */
DWORD
sampler_code
=
dst_param
.
reg
ister_
idx
;
DWORD
sampler_code
=
dst_param
.
reg
.
idx
;
TRACE
(
"Setting fake 2D sampler for 1.x pixelshader
\n
"
);
reg_maps
->
sampler_type
[
sampler_code
]
=
WINED3DSTT_2D
;
...
...
@@ -557,7 +557,7 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
}
else
if
(
pshader
&&
ins
.
handler_idx
==
WINED3DSIH_BEM
)
{
reg_maps
->
bumpmat
[
dst_param
.
reg
ister_
idx
]
=
TRUE
;
reg_maps
->
bumpmat
[
dst_param
.
reg
.
idx
]
=
TRUE
;
}
}
...
...
@@ -580,8 +580,8 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
struct
wined3d_shader_src_param
src_param
,
src_rel_addr
;
fe
->
shader_read_src_param
(
fe_data
,
&
pToken
,
&
src_param
,
&
src_rel_addr
);
shader_record_register_usage
(
This
,
reg_maps
,
src_param
.
reg
ister_
type
,
src_param
.
reg
ister_idx
,
!!
src_param
.
rel_addr
,
pshader
);
shader_record_register_usage
(
This
,
reg_maps
,
src_param
.
reg
.
type
,
src_param
.
reg
.
idx
,
!!
src_param
.
reg
.
rel_addr
,
pshader
);
}
}
}
...
...
@@ -597,7 +597,7 @@ static void shader_dump_decl_usage(const struct wined3d_shader_semantic *semanti
{
TRACE
(
"dcl"
);
if
(
semantic
->
reg
.
reg
ister_
type
==
WINED3DSPR_SAMPLER
)
if
(
semantic
->
reg
.
reg
.
type
==
WINED3DSPR_SAMPLER
)
{
switch
(
semantic
->
sampler_type
)
{
...
...
@@ -796,7 +796,7 @@ void shader_dump_dst_param(const struct wined3d_shader_dst_param *param,
{
DWORD
write_mask
=
param
->
write_mask
;
shader_dump_register
(
param
->
reg
ister_type
,
param
->
register_idx
,
0
,
NULL
,
param
->
rel_addr
,
shader_version
);
shader_dump_register
(
param
->
reg
.
type
,
param
->
reg
.
idx
,
0
,
NULL
,
param
->
reg
.
rel_addr
,
shader_version
);
if
(
write_mask
!=
WINED3DSP_WRITEMASK_ALL
)
{
...
...
@@ -830,8 +830,8 @@ void shader_dump_src_param(const struct wined3d_shader_src_param *param,
if
(
src_modifier
==
WINED3DSPSM_ABS
||
src_modifier
==
WINED3DSPSM_ABSNEG
)
TRACE
(
"abs("
);
shader_dump_register
(
param
->
reg
ister_type
,
param
->
register_idx
,
param
->
immconst_type
,
param
->
immconst_data
,
param
->
rel_addr
,
shader_version
);
shader_dump_register
(
param
->
reg
.
type
,
param
->
reg
.
idx
,
param
->
reg
.
immconst_type
,
param
->
reg
.
immconst_data
,
param
->
reg
.
rel_addr
,
shader_version
);
if
(
src_modifier
)
{
...
...
@@ -1055,7 +1055,7 @@ void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe_data,
fe
->
shader_read_dst_param
(
fe_data
,
&
pToken
,
&
dst
,
&
rel_addr
);
TRACE
(
"def c%u = %f, %f, %f, %f"
,
shader_get_float_offset
(
dst
.
reg
ister_type
,
dst
.
register_
idx
),
TRACE
(
"def c%u = %f, %f, %f, %f"
,
shader_get_float_offset
(
dst
.
reg
.
type
,
dst
.
reg
.
idx
),
*
(
const
float
*
)(
pToken
),
*
(
const
float
*
)(
pToken
+
1
),
*
(
const
float
*
)(
pToken
+
2
),
...
...
@@ -1069,7 +1069,7 @@ void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe_data,
fe
->
shader_read_dst_param
(
fe_data
,
&
pToken
,
&
dst
,
&
rel_addr
);
TRACE
(
"defi i%u = %d, %d, %d, %d"
,
dst
.
reg
ister_
idx
,
TRACE
(
"defi i%u = %d, %d, %d, %d"
,
dst
.
reg
.
idx
,
*
(
pToken
),
*
(
pToken
+
1
),
*
(
pToken
+
2
),
...
...
@@ -1083,7 +1083,7 @@ void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe_data,
fe
->
shader_read_dst_param
(
fe_data
,
&
pToken
,
&
dst
,
&
rel_addr
);
TRACE
(
"defb b%u = %s"
,
dst
.
reg
ister_
idx
,
*
pToken
?
"true"
:
"false"
);
TRACE
(
"defb b%u = %s"
,
dst
.
reg
.
idx
,
*
pToken
?
"true"
:
"false"
);
++
pToken
;
}
else
...
...
dlls/wined3d/glsl_shader.c
View file @
5e473cb1
...
...
@@ -1238,7 +1238,7 @@ static DWORD shader_glsl_get_write_mask(const struct wined3d_shader_dst_param *p
{
DWORD
mask
=
param
->
write_mask
;
if
(
shader_is_scalar
(
param
->
reg
ister_type
,
param
->
register_
idx
))
if
(
shader_is_scalar
(
param
->
reg
.
type
,
param
->
reg
.
idx
))
{
mask
=
WINED3DSP_WRITEMASK_0
;
*
write_mask
=
'\0'
;
...
...
@@ -1281,7 +1281,7 @@ static void shader_glsl_swizzle_to_str(const DWORD swizzle, BOOL fixup, DWORD ma
static
void
shader_glsl_get_swizzle
(
const
struct
wined3d_shader_src_param
*
param
,
BOOL
fixup
,
DWORD
mask
,
char
*
swizzle_str
)
{
if
(
shader_is_scalar
(
param
->
reg
ister_type
,
param
->
register_
idx
))
if
(
shader_is_scalar
(
param
->
reg
.
type
,
param
->
reg
.
idx
))
*
swizzle_str
=
'\0'
;
else
shader_glsl_swizzle_to_str
(
param
->
swizzle
,
fixup
,
mask
,
swizzle_str
);
...
...
@@ -1300,8 +1300,8 @@ static void shader_glsl_add_src_param(const struct wined3d_shader_instruction *i
glsl_src
->
param_str
[
0
]
=
'\0'
;
swizzle_str
[
0
]
=
'\0'
;
shader_glsl_get_register_name
(
wined3d_src
->
reg
ister_type
,
wined3d_src
->
register_
idx
,
wined3d_src
->
rel_addr
,
glsl_src
->
reg_name
,
&
is_color
,
ins
);
shader_glsl_get_register_name
(
wined3d_src
->
reg
.
type
,
wined3d_src
->
reg
.
idx
,
wined3d_src
->
re
g
.
re
l_addr
,
glsl_src
->
reg_name
,
&
is_color
,
ins
);
shader_glsl_get_swizzle
(
wined3d_src
,
is_color
,
mask
,
swizzle_str
);
shader_glsl_gen_modifier
(
wined3d_src
->
modifiers
,
glsl_src
->
reg_name
,
swizzle_str
,
glsl_src
->
param_str
);
...
...
@@ -1318,8 +1318,8 @@ static DWORD shader_glsl_add_dst_param(const struct wined3d_shader_instruction *
glsl_dst
->
mask_str
[
0
]
=
'\0'
;
glsl_dst
->
reg_name
[
0
]
=
'\0'
;
shader_glsl_get_register_name
(
wined3d_dst
->
reg
ister_type
,
wined3d_dst
->
register_
idx
,
wined3d_dst
->
rel_addr
,
glsl_dst
->
reg_name
,
&
is_color
,
ins
);
shader_glsl_get_register_name
(
wined3d_dst
->
reg
.
type
,
wined3d_dst
->
reg
.
idx
,
wined3d_dst
->
re
g
.
re
l_addr
,
glsl_dst
->
reg_name
,
&
is_color
,
ins
);
return
shader_glsl_get_write_mask
(
wined3d_dst
,
glsl_dst
->
mask_str
);
}
...
...
@@ -1667,7 +1667,7 @@ static void shader_glsl_mov(const struct wined3d_shader_instruction *ins)
* shader versions WINED3DSIO_MOVA is used for this. */
if
(
ins
->
ctx
->
reg_maps
->
shader_version
.
major
==
1
&&
!
shader_is_pshader_version
(
ins
->
ctx
->
reg_maps
->
shader_version
.
type
)
&&
ins
->
dst
[
0
].
reg
ister_
type
==
WINED3DSPR_ADDR
)
&&
ins
->
dst
[
0
].
reg
.
type
==
WINED3DSPR_ADDR
)
{
/* This is a simple floor() */
unsigned
int
mask_size
=
shader_glsl_get_write_mask_size
(
write_mask
);
...
...
@@ -1969,7 +1969,7 @@ static void shader_glsl_cmp(const struct wined3d_shader_instruction *ins)
char
mask_char
[
6
];
BOOL
temp_destination
=
FALSE
;
if
(
shader_is_scalar
(
ins
->
src
[
0
].
reg
ister_type
,
ins
->
src
[
0
].
register_
idx
))
if
(
shader_is_scalar
(
ins
->
src
[
0
].
reg
.
type
,
ins
->
src
[
0
].
reg
.
idx
))
{
write_mask
=
shader_glsl_append_dst
(
ins
->
ctx
->
buffer
,
ins
);
...
...
@@ -2000,12 +2000,12 @@ static void shader_glsl_cmp(const struct wined3d_shader_instruction *ins)
* The first lines may overwrite source parameters of the following lines.
* Deal with that by using a temporary destination register if needed
*/
if
((
ins
->
src
[
0
].
reg
ister_idx
==
ins
->
dst
[
0
].
register_
idx
&&
ins
->
src
[
0
].
reg
ister_type
==
ins
->
dst
[
0
].
register_
type
)
||
(
ins
->
src
[
1
].
reg
ister_idx
==
ins
->
dst
[
0
].
register_
idx
&&
ins
->
src
[
1
].
reg
ister_type
==
ins
->
dst
[
0
].
register_
type
)
||
(
ins
->
src
[
2
].
reg
ister_idx
==
ins
->
dst
[
0
].
register_
idx
&&
ins
->
src
[
2
].
reg
ister_type
==
ins
->
dst
[
0
].
register_
type
))
if
((
ins
->
src
[
0
].
reg
.
idx
==
ins
->
dst
[
0
].
reg
.
idx
&&
ins
->
src
[
0
].
reg
.
type
==
ins
->
dst
[
0
].
reg
.
type
)
||
(
ins
->
src
[
1
].
reg
.
idx
==
ins
->
dst
[
0
].
reg
.
idx
&&
ins
->
src
[
1
].
reg
.
type
==
ins
->
dst
[
0
].
reg
.
type
)
||
(
ins
->
src
[
2
].
reg
.
idx
==
ins
->
dst
[
0
].
reg
.
idx
&&
ins
->
src
[
2
].
reg
.
type
==
ins
->
dst
[
0
].
reg
.
type
))
{
write_mask
=
shader_glsl_get_write_mask
(
&
dst
,
mask_char
);
if
(
!
write_mask
)
continue
;
...
...
@@ -2114,8 +2114,8 @@ static void shader_glsl_mnxn(const struct wined3d_shader_instruction *ins)
{
int
i
;
int
nComponents
=
0
;
struct
wined3d_shader_dst_param
tmp_dst
=
{
0
};
struct
wined3d_shader_src_param
tmp_src
[
2
]
=
{{
0
}};
struct
wined3d_shader_dst_param
tmp_dst
=
{
{
0
}
};
struct
wined3d_shader_src_param
tmp_src
[
2
]
=
{{
{
0
}
}};
struct
wined3d_shader_instruction
tmp_ins
;
memset
(
&
tmp_ins
,
0
,
sizeof
(
tmp_ins
));
...
...
@@ -2160,7 +2160,7 @@ static void shader_glsl_mnxn(const struct wined3d_shader_instruction *ins)
{
tmp_dst
.
write_mask
=
WINED3DSP_WRITEMASK_0
<<
i
;
shader_glsl_dot
(
&
tmp_ins
);
++
tmp_src
[
1
].
reg
ister_
idx
;
++
tmp_src
[
1
].
reg
.
idx
;
}
}
...
...
@@ -2315,10 +2315,10 @@ static void shader_glsl_loop(const struct wined3d_shader_instruction *ins)
* known at compile time, the GLSL compiler can unroll the loop, and replace indirect addressing with direct
* addressing.
*/
if
(
ins
->
src
[
1
].
reg
ister_
type
==
WINED3DSPR_CONSTINT
)
if
(
ins
->
src
[
1
].
reg
.
type
==
WINED3DSPR_CONSTINT
)
{
LIST_FOR_EACH_ENTRY
(
constant
,
&
shader
->
baseShader
.
constantsI
,
local_constant
,
entry
)
{
if
(
constant
->
idx
==
ins
->
src
[
1
].
reg
ister_
idx
)
if
(
constant
->
idx
==
ins
->
src
[
1
].
reg
.
idx
)
{
control_values
=
constant
->
value
;
break
;
...
...
@@ -2381,9 +2381,12 @@ static void shader_glsl_rep(const struct wined3d_shader_instruction *ins)
const
local_constant
*
constant
;
/* Try to hardcode local values to help the GLSL compiler to unroll and optimize the loop */
if
(
ins
->
src
[
0
].
register_type
==
WINED3DSPR_CONSTINT
)
{
LIST_FOR_EACH_ENTRY
(
constant
,
&
shader
->
baseShader
.
constantsI
,
local_constant
,
entry
)
{
if
(
constant
->
idx
==
ins
->
src
[
0
].
register_idx
)
{
if
(
ins
->
src
[
0
].
reg
.
type
==
WINED3DSPR_CONSTINT
)
{
LIST_FOR_EACH_ENTRY
(
constant
,
&
shader
->
baseShader
.
constantsI
,
local_constant
,
entry
)
{
if
(
constant
->
idx
==
ins
->
src
[
0
].
reg
.
idx
)
{
control_values
=
constant
->
value
;
break
;
}
...
...
@@ -2449,12 +2452,12 @@ static void shader_glsl_breakc(const struct wined3d_shader_instruction *ins)
static
void
shader_glsl_label
(
const
struct
wined3d_shader_instruction
*
ins
)
{
shader_addline
(
ins
->
ctx
->
buffer
,
"}
\n
"
);
shader_addline
(
ins
->
ctx
->
buffer
,
"void subroutine%u () {
\n
"
,
ins
->
src
[
0
].
reg
ister_
idx
);
shader_addline
(
ins
->
ctx
->
buffer
,
"void subroutine%u () {
\n
"
,
ins
->
src
[
0
].
reg
.
idx
);
}
static
void
shader_glsl_call
(
const
struct
wined3d_shader_instruction
*
ins
)
{
shader_addline
(
ins
->
ctx
->
buffer
,
"subroutine%u();
\n
"
,
ins
->
src
[
0
].
reg
ister_
idx
);
shader_addline
(
ins
->
ctx
->
buffer
,
"subroutine%u();
\n
"
,
ins
->
src
[
0
].
reg
.
idx
);
}
static
void
shader_glsl_callnz
(
const
struct
wined3d_shader_instruction
*
ins
)
...
...
@@ -2462,7 +2465,7 @@ static void shader_glsl_callnz(const struct wined3d_shader_instruction *ins)
glsl_src_param_t
src1_param
;
shader_glsl_add_src_param
(
ins
,
&
ins
->
src
[
1
],
WINED3DSP_WRITEMASK_0
,
&
src1_param
);
shader_addline
(
ins
->
ctx
->
buffer
,
"if (%s) subroutine%u();
\n
"
,
src1_param
.
param_str
,
ins
->
src
[
0
].
reg
ister_
idx
);
shader_addline
(
ins
->
ctx
->
buffer
,
"if (%s) subroutine%u();
\n
"
,
src1_param
.
param_str
,
ins
->
src
[
0
].
reg
.
idx
);
}
/*********************************************
...
...
@@ -2482,8 +2485,8 @@ static void pshader_glsl_tex(const struct wined3d_shader_instruction *ins)
/* 1.0-1.4: Use destination register as sampler source.
* 2.0+: Use provided sampler source. */
if
(
shader_version
<
WINED3D_SHADER_VERSION
(
2
,
0
))
sampler_idx
=
ins
->
dst
[
0
].
reg
ister_
idx
;
else
sampler_idx
=
ins
->
src
[
1
].
reg
ister_
idx
;
if
(
shader_version
<
WINED3D_SHADER_VERSION
(
2
,
0
))
sampler_idx
=
ins
->
dst
[
0
].
reg
.
idx
;
else
sampler_idx
=
ins
->
src
[
1
].
reg
.
idx
;
sampler_type
=
ins
->
ctx
->
reg_maps
->
sampler_type
[
sampler_idx
];
if
(
shader_version
<
WINED3D_SHADER_VERSION
(
1
,
4
))
...
...
@@ -2574,7 +2577,7 @@ static void shader_glsl_texldd(const struct wined3d_shader_instruction *ins)
return
pshader_glsl_tex
(
ins
);
}
sampler_idx
=
ins
->
src
[
1
].
reg
ister_
idx
;
sampler_idx
=
ins
->
src
[
1
].
reg
.
idx
;
sampler_type
=
ins
->
ctx
->
reg_maps
->
sampler_type
[
sampler_idx
];
if
(
deviceImpl
->
stateBlock
->
textures
[
sampler_idx
]
&&
IWineD3DBaseTexture_GetTextureDimensions
(
deviceImpl
->
stateBlock
->
textures
[
sampler_idx
])
==
GL_TEXTURE_RECTANGLE_ARB
)
{
...
...
@@ -2601,7 +2604,7 @@ static void shader_glsl_texldl(const struct wined3d_shader_instruction *ins)
DWORD
sampler_idx
;
DWORD
swizzle
=
ins
->
src
[
1
].
swizzle
;
sampler_idx
=
ins
->
src
[
1
].
reg
ister_
idx
;
sampler_idx
=
ins
->
src
[
1
].
reg
.
idx
;
sampler_type
=
ins
->
ctx
->
reg_maps
->
sampler_type
[
sampler_idx
];
if
(
deviceImpl
->
stateBlock
->
textures
[
sampler_idx
]
&&
IWineD3DBaseTexture_GetTextureDimensions
(
deviceImpl
->
stateBlock
->
textures
[
sampler_idx
])
==
GL_TEXTURE_RECTANGLE_ARB
)
{
...
...
@@ -2634,9 +2637,9 @@ static void pshader_glsl_texcoord(const struct wined3d_shader_instruction *ins)
shader_glsl_get_write_mask
(
&
ins
->
dst
[
0
],
dst_mask
);
shader_addline
(
buffer
,
"clamp(gl_TexCoord[%u], 0.0, 1.0)%s);
\n
"
,
ins
->
dst
[
0
].
reg
ister_
idx
,
dst_mask
);
ins
->
dst
[
0
].
reg
.
idx
,
dst_mask
);
}
else
{
DWORD
reg
=
ins
->
src
[
0
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
src
[
0
].
reg
.
idx
;
DWORD
src_mod
=
ins
->
src
[
0
].
modifiers
;
char
dst_swizzle
[
6
];
...
...
@@ -2675,7 +2678,7 @@ static void pshader_glsl_texdp3tex(const struct wined3d_shader_instruction *ins)
{
glsl_src_param_t
src0_param
;
glsl_sample_function_t
sample_function
;
DWORD
sampler_idx
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
sampler_idx
=
ins
->
dst
[
0
].
reg
.
idx
;
DWORD
src_mask
=
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
|
WINED3DSP_WRITEMASK_2
;
WINED3DSAMPLER_TEXTURE_TYPE
sampler_type
=
ins
->
ctx
->
reg_maps
->
sampler_type
[
sampler_idx
];
UINT
mask_size
;
...
...
@@ -2718,7 +2721,7 @@ static void pshader_glsl_texdp3tex(const struct wined3d_shader_instruction *ins)
static
void
pshader_glsl_texdp3
(
const
struct
wined3d_shader_instruction
*
ins
)
{
glsl_src_param_t
src0_param
;
DWORD
dstreg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
dstreg
=
ins
->
dst
[
0
].
reg
.
idx
;
DWORD
src_mask
=
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
|
WINED3DSP_WRITEMASK_2
;
DWORD
dst_mask
;
unsigned
int
mask_size
;
...
...
@@ -2760,7 +2763,7 @@ static void pshader_glsl_texdepth(const struct wined3d_shader_instruction *ins)
static
void
pshader_glsl_texm3x2depth
(
const
struct
wined3d_shader_instruction
*
ins
)
{
DWORD
src_mask
=
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
|
WINED3DSP_WRITEMASK_2
;
DWORD
dstreg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
dstreg
=
ins
->
dst
[
0
].
reg
.
idx
;
glsl_src_param_t
src0_param
;
shader_glsl_add_src_param
(
ins
,
&
ins
->
src
[
0
],
src_mask
,
&
src0_param
);
...
...
@@ -2774,7 +2777,7 @@ static void pshader_glsl_texm3x2depth(const struct wined3d_shader_instruction *i
static
void
pshader_glsl_texm3x2pad
(
const
struct
wined3d_shader_instruction
*
ins
)
{
DWORD
src_mask
=
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
|
WINED3DSP_WRITEMASK_2
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
.
idx
;
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
glsl_src_param_t
src0_param
;
...
...
@@ -2788,7 +2791,7 @@ static void pshader_glsl_texm3x3pad(const struct wined3d_shader_instruction *ins
{
IWineD3DPixelShaderImpl
*
shader
=
(
IWineD3DPixelShaderImpl
*
)
ins
->
ctx
->
shader
;
DWORD
src_mask
=
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
|
WINED3DSP_WRITEMASK_2
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
.
idx
;
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
SHADER_PARSE_STATE
*
current_state
=
&
shader
->
baseShader
.
parse_state
;
glsl_src_param_t
src0_param
;
...
...
@@ -2801,7 +2804,7 @@ static void pshader_glsl_texm3x3pad(const struct wined3d_shader_instruction *ins
static
void
pshader_glsl_texm3x2tex
(
const
struct
wined3d_shader_instruction
*
ins
)
{
DWORD
src_mask
=
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
|
WINED3DSP_WRITEMASK_2
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
.
idx
;
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
glsl_src_param_t
src0_param
;
WINED3DSAMPLER_TEXTURE_TYPE
sampler_type
=
ins
->
ctx
->
reg_maps
->
sampler_type
[
reg
];
...
...
@@ -2822,7 +2825,7 @@ static void pshader_glsl_texm3x3tex(const struct wined3d_shader_instruction *ins
{
DWORD
src_mask
=
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
|
WINED3DSP_WRITEMASK_2
;
glsl_src_param_t
src0_param
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
.
idx
;
IWineD3DPixelShaderImpl
*
This
=
(
IWineD3DPixelShaderImpl
*
)
ins
->
ctx
->
shader
;
SHADER_PARSE_STATE
*
current_state
=
&
This
->
baseShader
.
parse_state
;
WINED3DSAMPLER_TEXTURE_TYPE
sampler_type
=
ins
->
ctx
->
reg_maps
->
sampler_type
[
reg
];
...
...
@@ -2847,7 +2850,7 @@ static void pshader_glsl_texm3x3(const struct wined3d_shader_instruction *ins)
DWORD
src_mask
=
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
|
WINED3DSP_WRITEMASK_2
;
glsl_src_param_t
src0_param
;
char
dst_mask
[
6
];
DWORD
reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
.
idx
;
IWineD3DPixelShaderImpl
*
This
=
(
IWineD3DPixelShaderImpl
*
)
ins
->
ctx
->
shader
;
SHADER_PARSE_STATE
*
current_state
=
&
This
->
baseShader
.
parse_state
;
...
...
@@ -2865,7 +2868,7 @@ static void pshader_glsl_texm3x3(const struct wined3d_shader_instruction *ins)
static
void
pshader_glsl_texm3x3spec
(
const
struct
wined3d_shader_instruction
*
ins
)
{
IWineD3DPixelShaderImpl
*
shader
=
(
IWineD3DPixelShaderImpl
*
)
ins
->
ctx
->
shader
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
.
idx
;
glsl_src_param_t
src0_param
;
glsl_src_param_t
src1_param
;
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
...
...
@@ -2896,7 +2899,7 @@ static void pshader_glsl_texm3x3spec(const struct wined3d_shader_instruction *in
static
void
pshader_glsl_texm3x3vspec
(
const
struct
wined3d_shader_instruction
*
ins
)
{
IWineD3DPixelShaderImpl
*
shader
=
(
IWineD3DPixelShaderImpl
*
)
ins
->
ctx
->
shader
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
reg
=
ins
->
dst
[
0
].
reg
.
idx
;
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
SHADER_PARSE_STATE
*
current_state
=
&
shader
->
baseShader
.
parse_state
;
glsl_src_param_t
src0_param
;
...
...
@@ -2939,7 +2942,7 @@ static void pshader_glsl_texbem(const struct wined3d_shader_instruction *ins)
DWORD
flags
;
char
coord_mask
[
6
];
sampler_idx
=
ins
->
dst
[
0
].
reg
ister_
idx
;
sampler_idx
=
ins
->
dst
[
0
].
reg
.
idx
;
flags
=
deviceImpl
->
stateBlock
->
textureState
[
sampler_idx
][
WINED3DTSS_TEXTURETRANSFORMFLAGS
];
sampler_type
=
ins
->
ctx
->
reg_maps
->
sampler_type
[
sampler_idx
];
...
...
@@ -2989,7 +2992,7 @@ static void pshader_glsl_texbem(const struct wined3d_shader_instruction *ins)
static
void
pshader_glsl_bem
(
const
struct
wined3d_shader_instruction
*
ins
)
{
glsl_src_param_t
src0_param
,
src1_param
;
DWORD
sampler_idx
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
sampler_idx
=
ins
->
dst
[
0
].
reg
.
idx
;
shader_glsl_add_src_param
(
ins
,
&
ins
->
src
[
0
],
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
,
&
src0_param
);
shader_glsl_add_src_param
(
ins
,
&
ins
->
src
[
1
],
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
,
&
src1_param
);
...
...
@@ -3004,7 +3007,7 @@ static void pshader_glsl_bem(const struct wined3d_shader_instruction *ins)
static
void
pshader_glsl_texreg2ar
(
const
struct
wined3d_shader_instruction
*
ins
)
{
glsl_src_param_t
src0_param
;
DWORD
sampler_idx
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
sampler_idx
=
ins
->
dst
[
0
].
reg
.
idx
;
WINED3DSAMPLER_TEXTURE_TYPE
sampler_type
=
ins
->
ctx
->
reg_maps
->
sampler_type
[
sampler_idx
];
glsl_sample_function_t
sample_function
;
...
...
@@ -3020,7 +3023,7 @@ static void pshader_glsl_texreg2ar(const struct wined3d_shader_instruction *ins)
static
void
pshader_glsl_texreg2gb
(
const
struct
wined3d_shader_instruction
*
ins
)
{
glsl_src_param_t
src0_param
;
DWORD
sampler_idx
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
sampler_idx
=
ins
->
dst
[
0
].
reg
.
idx
;
WINED3DSAMPLER_TEXTURE_TYPE
sampler_type
=
ins
->
ctx
->
reg_maps
->
sampler_type
[
sampler_idx
];
glsl_sample_function_t
sample_function
;
...
...
@@ -3036,7 +3039,7 @@ static void pshader_glsl_texreg2gb(const struct wined3d_shader_instruction *ins)
static
void
pshader_glsl_texreg2rgb
(
const
struct
wined3d_shader_instruction
*
ins
)
{
glsl_src_param_t
src0_param
;
DWORD
sampler_idx
=
ins
->
dst
[
0
].
reg
ister_
idx
;
DWORD
sampler_idx
=
ins
->
dst
[
0
].
reg
.
idx
;
WINED3DSAMPLER_TEXTURE_TYPE
sampler_type
=
ins
->
ctx
->
reg_maps
->
sampler_type
[
sampler_idx
];
glsl_sample_function_t
sample_function
;
...
...
dlls/wined3d/shader_sm1.c
View file @
5e473cb1
...
...
@@ -346,24 +346,24 @@ static int shader_skip_opcode(const struct wined3d_sm1_data *priv,
static
void
shader_parse_src_param
(
DWORD
param
,
const
struct
wined3d_shader_src_param
*
rel_addr
,
struct
wined3d_shader_src_param
*
src
)
{
src
->
reg
ister_
type
=
((
param
&
WINED3DSP_REGTYPE_MASK
)
>>
WINED3DSP_REGTYPE_SHIFT
)
src
->
reg
.
type
=
((
param
&
WINED3DSP_REGTYPE_MASK
)
>>
WINED3DSP_REGTYPE_SHIFT
)
|
((
param
&
WINED3DSP_REGTYPE_MASK2
)
>>
WINED3DSP_REGTYPE_SHIFT2
);
src
->
reg
ister_
idx
=
param
&
WINED3DSP_REGNUM_MASK
;
src
->
reg
.
idx
=
param
&
WINED3DSP_REGNUM_MASK
;
src
->
swizzle
=
(
param
&
WINED3DSP_SWIZZLE_MASK
)
>>
WINED3DSP_SWIZZLE_SHIFT
;
src
->
modifiers
=
(
param
&
WINED3DSP_SRCMOD_MASK
)
>>
WINED3DSP_SRCMOD_SHIFT
;
src
->
rel_addr
=
rel_addr
;
src
->
re
g
.
re
l_addr
=
rel_addr
;
}
static
void
shader_parse_dst_param
(
DWORD
param
,
const
struct
wined3d_shader_src_param
*
rel_addr
,
struct
wined3d_shader_dst_param
*
dst
)
{
dst
->
reg
ister_
type
=
((
param
&
WINED3DSP_REGTYPE_MASK
)
>>
WINED3DSP_REGTYPE_SHIFT
)
dst
->
reg
.
type
=
((
param
&
WINED3DSP_REGTYPE_MASK
)
>>
WINED3DSP_REGTYPE_SHIFT
)
|
((
param
&
WINED3DSP_REGTYPE_MASK2
)
>>
WINED3DSP_REGTYPE_SHIFT2
);
dst
->
reg
ister_
idx
=
param
&
WINED3DSP_REGNUM_MASK
;
dst
->
reg
.
idx
=
param
&
WINED3DSP_REGNUM_MASK
;
dst
->
write_mask
=
(
param
&
WINED3D_SM1_WRITEMASK_MASK
)
>>
WINED3D_SM1_WRITEMASK_SHIFT
;
dst
->
modifiers
=
(
param
&
WINED3DSP_DSTMOD_MASK
)
>>
WINED3DSP_DSTMOD_SHIFT
;
dst
->
shift
=
(
param
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
dst
->
rel_addr
=
rel_addr
;
dst
->
re
g
.
re
l_addr
=
rel_addr
;
}
/* Read the parameters of an unrecognized opcode from the input stream
...
...
dlls/wined3d/shader_sm4.c
View file @
5e473cb1
...
...
@@ -200,11 +200,11 @@ static void shader_sm4_read_src_param(void *data, const DWORD **ptr, struct wine
if
(
register_type
>=
sizeof
(
register_type_table
)
/
sizeof
(
*
register_type_table
))
{
FIXME
(
"Unhandled register type %#x
\n
"
,
register_type
);
src_param
->
reg
ister_
type
=
WINED3DSPR_TEMP
;
src_param
->
reg
.
type
=
WINED3DSPR_TEMP
;
}
else
{
src_param
->
reg
ister_
type
=
register_type_table
[
register_type
];
src_param
->
reg
.
type
=
register_type_table
[
register_type
];
}
if
(
register_type
==
WINED3D_SM4_RT_IMMCONST
)
...
...
@@ -216,14 +216,14 @@ static void shader_sm4_read_src_param(void *data, const DWORD **ptr, struct wine
switch
(
immconst_type
)
{
case
WINED3D_SM4_IMMCONST_FLOAT
:
src_param
->
immconst_type
=
WINED3D_IMMCONST_FLOAT
;
memcpy
(
src_param
->
immconst_data
,
*
ptr
,
1
*
sizeof
(
DWORD
));
src_param
->
reg
.
immconst_type
=
WINED3D_IMMCONST_FLOAT
;
memcpy
(
src_param
->
reg
.
immconst_data
,
*
ptr
,
1
*
sizeof
(
DWORD
));
*
ptr
+=
1
;
break
;
case
WINED3D_SM4_IMMCONST_FLOAT4
:
src_param
->
immconst_type
=
WINED3D_IMMCONST_FLOAT4
;
memcpy
(
src_param
->
immconst_data
,
*
ptr
,
4
*
sizeof
(
DWORD
));
src_param
->
reg
.
immconst_type
=
WINED3D_IMMCONST_FLOAT4
;
memcpy
(
src_param
->
reg
.
immconst_data
,
*
ptr
,
4
*
sizeof
(
DWORD
));
*
ptr
+=
4
;
break
;
...
...
@@ -234,12 +234,12 @@ static void shader_sm4_read_src_param(void *data, const DWORD **ptr, struct wine
}
else
{
src_param
->
reg
ister_
idx
=
*
(
*
ptr
)
++
;
src_param
->
reg
.
idx
=
*
(
*
ptr
)
++
;
src_param
->
swizzle
=
(
token
&
WINED3D_SM4_SWIZZLE_MASK
)
>>
WINED3D_SM4_SWIZZLE_SHIFT
;
}
src_param
->
modifiers
=
0
;
src_param
->
rel_addr
=
NULL
;
src_param
->
re
g
.
re
l_addr
=
NULL
;
}
static
void
shader_sm4_read_dst_param
(
void
*
data
,
const
DWORD
**
ptr
,
struct
wined3d_shader_dst_param
*
dst_param
,
...
...
@@ -253,18 +253,18 @@ static void shader_sm4_read_dst_param(void *data, const DWORD **ptr, struct wine
if
(
register_type
>=
sizeof
(
register_type_table
)
/
sizeof
(
*
register_type_table
))
{
FIXME
(
"Unhandled register type %#x
\n
"
,
register_type
);
dst_param
->
reg
ister_
type
=
WINED3DSPR_TEMP
;
dst_param
->
reg
.
type
=
WINED3DSPR_TEMP
;
}
else
{
dst_param
->
reg
ister_
type
=
register_type_table
[
register_type
];
dst_param
->
reg
.
type
=
register_type_table
[
register_type
];
}
dst_param
->
reg
ister_
idx
=
register_idx
;
dst_param
->
reg
.
idx
=
register_idx
;
dst_param
->
write_mask
=
(
token
&
WINED3D_SM4_WRITEMASK_MASK
)
>>
WINED3D_SM4_WRITEMASK_SHIFT
;
dst_param
->
modifiers
=
0
;
dst_param
->
shift
=
0
;
dst_param
->
rel_addr
=
NULL
;
dst_param
->
re
g
.
re
l_addr
=
NULL
;
}
static
void
shader_sm4_read_semantic
(
const
DWORD
**
ptr
,
struct
wined3d_shader_semantic
*
semantic
)
...
...
dlls/wined3d/vertexshader.c
View file @
5e473cb1
...
...
@@ -113,12 +113,12 @@ static void vshader_set_input(
This
->
semantics_in
[
regnum
].
usage
=
usage
;
This
->
semantics_in
[
regnum
].
usage_idx
=
usage_idx
;
This
->
semantics_in
[
regnum
].
reg
.
reg
ister_
type
=
WINED3DSPR_INPUT
;
This
->
semantics_in
[
regnum
].
reg
.
reg
ister_
idx
=
regnum
;
This
->
semantics_in
[
regnum
].
reg
.
reg
.
type
=
WINED3DSPR_INPUT
;
This
->
semantics_in
[
regnum
].
reg
.
reg
.
idx
=
regnum
;
This
->
semantics_in
[
regnum
].
reg
.
write_mask
=
WINED3DSP_WRITEMASK_ALL
;
This
->
semantics_in
[
regnum
].
reg
.
modifiers
=
0
;
This
->
semantics_in
[
regnum
].
reg
.
shift
=
0
;
This
->
semantics_in
[
regnum
].
reg
.
rel_addr
=
NULL
;
This
->
semantics_in
[
regnum
].
reg
.
re
g
.
re
l_addr
=
NULL
;
}
static
BOOL
match_usage
(
BYTE
usage1
,
BYTE
usage_idx1
,
BYTE
usage2
,
BYTE
usage_idx2
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
5e473cb1
...
...
@@ -649,25 +649,28 @@ struct wined3d_shader_context
SHADER_BUFFER
*
buffer
;
};
struct
wined3d_shader_register
{
WINED3DSHADER_PARAM_REGISTER_TYPE
type
;
UINT
idx
;
const
struct
wined3d_shader_src_param
*
rel_addr
;
enum
wined3d_immconst_type
immconst_type
;
DWORD
immconst_data
[
4
];
};
struct
wined3d_shader_dst_param
{
WINED3DSHADER_PARAM_REGISTER_TYPE
register_type
;
UINT
register_idx
;
struct
wined3d_shader_register
reg
;
DWORD
write_mask
;
DWORD
modifiers
;
DWORD
shift
;
const
struct
wined3d_shader_src_param
*
rel_addr
;
};
struct
wined3d_shader_src_param
{
WINED3DSHADER_PARAM_REGISTER_TYPE
register_type
;
UINT
register_idx
;
struct
wined3d_shader_register
reg
;
DWORD
swizzle
;
DWORD
modifiers
;
const
struct
wined3d_shader_src_param
*
rel_addr
;
enum
wined3d_immconst_type
immconst_type
;
DWORD
immconst_data
[
4
];
};
struct
wined3d_shader_instruction
...
...
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