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
bee9adbd
Commit
bee9adbd
authored
Jan 18, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the WINED3DDECLUSAGE typedef.
parent
c35c30fa
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
176 additions
and
160 deletions
+176
-160
vertexdeclaration.c
dlls/d3d8/vertexdeclaration.c
+19
-18
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+19
-16
device.c
dlls/wined3d/device.c
+10
-10
glsl_shader.c
dlls/wined3d/glsl_shader.c
+9
-9
shader.c
dlls/wined3d/shader.c
+48
-43
utils.c
dlls/wined3d/utils.c
+18
-16
vertexdeclaration.c
dlls/wined3d/vertexdeclaration.c
+32
-27
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-4
wined3d.h
include/wine/wined3d.h
+17
-17
No files found.
dlls/d3d8/vertexdeclaration.c
View file @
bee9adbd
...
...
@@ -281,24 +281,25 @@ typedef struct {
BYTE
usage_idx
;
}
wined3d_usage_t
;
static
const
wined3d_usage_t
wined3d_usage_lookup
[]
=
{
/*D3DVSDE_POSITION*/
{
WINED3DDECLUSAGE_POSITION
,
0
},
/*D3DVSDE_BLENDWEIGHT*/
{
WINED3DDECLUSAGE_BLENDWEIGHT
,
0
},
/*D3DVSDE_BLENDINDICES*/
{
WINED3DDECLUSAGE_BLENDINDICES
,
0
},
/*D3DVSDE_NORMAL*/
{
WINED3DDECLUSAGE_NORMAL
,
0
},
/*D3DVSDE_PSIZE*/
{
WINED3DDECLUSAGE_PSIZE
,
0
},
/*D3DVSDE_DIFFUSE*/
{
WINED3DDECLUSAGE_COLOR
,
0
},
/*D3DVSDE_SPECULAR*/
{
WINED3DDECLUSAGE_COLOR
,
1
},
/*D3DVSDE_TEXCOORD0*/
{
WINED3DDECLUSAGE_TEXCOORD
,
0
},
/*D3DVSDE_TEXCOORD1*/
{
WINED3DDECLUSAGE_TEXCOORD
,
1
},
/*D3DVSDE_TEXCOORD2*/
{
WINED3DDECLUSAGE_TEXCOORD
,
2
},
/*D3DVSDE_TEXCOORD3*/
{
WINED3DDECLUSAGE_TEXCOORD
,
3
},
/*D3DVSDE_TEXCOORD4*/
{
WINED3DDECLUSAGE_TEXCOORD
,
4
},
/*D3DVSDE_TEXCOORD5*/
{
WINED3DDECLUSAGE_TEXCOORD
,
5
},
/*D3DVSDE_TEXCOORD6*/
{
WINED3DDECLUSAGE_TEXCOORD
,
6
},
/*D3DVSDE_TEXCOORD7*/
{
WINED3DDECLUSAGE_TEXCOORD
,
7
},
/*D3DVSDE_POSITION2*/
{
WINED3DDECLUSAGE_POSITION
,
1
},
/*D3DVSDE_NORMAL2*/
{
WINED3DDECLUSAGE_NORMAL
,
1
},
static
const
wined3d_usage_t
wined3d_usage_lookup
[]
=
{
/* D3DVSDE_POSITION */
{
WINED3D_DECL_USAGE_POSITION
,
0
},
/* D3DVSDE_BLENDWEIGHT */
{
WINED3D_DECL_USAGE_BLEND_WEIGHT
,
0
},
/* D3DVSDE_BLENDINDICES */
{
WINED3D_DECL_USAGE_BLEND_INDICES
,
0
},
/* D3DVSDE_NORMAL */
{
WINED3D_DECL_USAGE_NORMAL
,
0
},
/* D3DVSDE_PSIZE */
{
WINED3D_DECL_USAGE_PSIZE
,
0
},
/* D3DVSDE_DIFFUSE */
{
WINED3D_DECL_USAGE_COLOR
,
0
},
/* D3DVSDE_SPECULAR */
{
WINED3D_DECL_USAGE_COLOR
,
1
},
/* D3DVSDE_TEXCOORD0 */
{
WINED3D_DECL_USAGE_TEXCOORD
,
0
},
/* D3DVSDE_TEXCOORD1 */
{
WINED3D_DECL_USAGE_TEXCOORD
,
1
},
/* D3DVSDE_TEXCOORD2 */
{
WINED3D_DECL_USAGE_TEXCOORD
,
2
},
/* D3DVSDE_TEXCOORD3 */
{
WINED3D_DECL_USAGE_TEXCOORD
,
3
},
/* D3DVSDE_TEXCOORD4 */
{
WINED3D_DECL_USAGE_TEXCOORD
,
4
},
/* D3DVSDE_TEXCOORD5 */
{
WINED3D_DECL_USAGE_TEXCOORD
,
5
},
/* D3DVSDE_TEXCOORD6 */
{
WINED3D_DECL_USAGE_TEXCOORD
,
6
},
/* D3DVSDE_TEXCOORD7 */
{
WINED3D_DECL_USAGE_TEXCOORD
,
7
},
/* D3DVSDE_POSITION2 */
{
WINED3D_DECL_USAGE_POSITION
,
1
},
/* D3DVSDE_NORMAL2 */
{
WINED3D_DECL_USAGE_NORMAL
,
1
},
};
/* TODO: find out where rhw (or positionT) is for declaration8 */
...
...
dlls/wined3d/arb_program_shader.c
View file @
bee9adbd
...
...
@@ -3474,7 +3474,7 @@ static void init_ps_input(const struct wined3d_shader *shader,
semantic_idx
=
sig
[
i
].
semantic_idx
;
if
(
!
semantic_name
)
continue
;
if
(
shader_match_semantic
(
semantic_name
,
WINED3DDECL
USAGE_COLOR
))
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_
USAGE_COLOR
))
{
if
(
!
semantic_idx
)
priv
->
ps_input
[
i
]
=
"fragment.color.primary"
;
else
if
(
semantic_idx
==
1
)
priv
->
ps_input
[
i
]
=
"fragment.color.secondary"
;
...
...
@@ -3484,12 +3484,12 @@ static void init_ps_input(const struct wined3d_shader *shader,
{
priv
->
ps_input
[
i
]
=
"0.0"
;
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_TEXCOORD
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_TEXCOORD
))
{
if
(
semantic_idx
<
8
)
priv
->
ps_input
[
i
]
=
texcoords
[
semantic_idx
];
else
priv
->
ps_input
[
i
]
=
"0.0"
;
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_FOG
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_FOG
))
{
if
(
!
semantic_idx
)
priv
->
ps_input
[
i
]
=
"fragment.fogcoord"
;
else
priv
->
ps_input
[
i
]
=
"0.0"
;
...
...
@@ -3970,19 +3970,19 @@ static void init_output_registers(const struct wined3d_shader *shader, DWORD sig
semantic_name
=
shader
->
output_signature
[
i
].
semantic_name
;
if
(
!
semantic_name
)
continue
;
if
(
shader_match_semantic
(
semantic_name
,
WINED3DDECL
USAGE_POSITION
))
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_
USAGE_POSITION
))
{
TRACE
(
"o%u is TMP_OUT
\n
"
,
i
);
if
(
!
shader
->
output_signature
[
i
].
semantic_idx
)
priv_ctx
->
vs_output
[
i
]
=
"TMP_OUT"
;
else
priv_ctx
->
vs_output
[
i
]
=
"TA"
;
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3DDECL
USAGE_PSIZE
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_
USAGE_PSIZE
))
{
TRACE
(
"o%u is result.pointsize
\n
"
,
i
);
if
(
!
shader
->
output_signature
[
i
].
semantic_idx
)
priv_ctx
->
vs_output
[
i
]
=
"result.pointsize"
;
else
priv_ctx
->
vs_output
[
i
]
=
"TA"
;
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3DDECL
USAGE_COLOR
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_
USAGE_COLOR
))
{
TRACE
(
"o%u is result.color.?, idx %u
\n
"
,
i
,
shader
->
output_signature
[
i
].
semantic_idx
);
if
(
!
shader
->
output_signature
[
i
].
semantic_idx
)
...
...
@@ -3991,13 +3991,13 @@ static void init_output_registers(const struct wined3d_shader *shader, DWORD sig
priv_ctx
->
vs_output
[
i
]
=
"result.color.secondary"
;
else
priv_ctx
->
vs_output
[
i
]
=
"TA"
;
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3DDECL
USAGE_TEXCOORD
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_
USAGE_TEXCOORD
))
{
TRACE
(
"o%u is %s
\n
"
,
i
,
texcoords
[
shader
->
output_signature
[
i
].
semantic_idx
]);
if
(
shader
->
output_signature
[
i
].
semantic_idx
>=
8
)
priv_ctx
->
vs_output
[
i
]
=
"TA"
;
else
priv_ctx
->
vs_output
[
i
]
=
texcoords
[
shader
->
output_signature
[
i
].
semantic_idx
];
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3DDECL
USAGE_FOG
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_
USAGE_FOG
))
{
TRACE
(
"o%u is result.fogcoord
\n
"
,
i
);
if
(
shader
->
output_signature
[
i
].
semantic_idx
>
0
)
priv_ctx
->
vs_output
[
i
]
=
"TA"
;
...
...
@@ -4039,17 +4039,20 @@ static void init_output_registers(const struct wined3d_shader *shader, DWORD sig
* Don't care about POSITION and PSIZE here - this is a builtin vertex shader, position goes
* to TMP_OUT in any case
*/
if
(
shader_match_semantic
(
semantic_name
,
WINED3DDECL
USAGE_TEXCOORD
))
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_
USAGE_TEXCOORD
))
{
if
(
semantic_idx
<
8
)
priv_ctx
->
texcrd_output
[
semantic_idx
]
=
decl_idx_to_string
[
reg_idx
];
if
(
semantic_idx
<
8
)
priv_ctx
->
texcrd_output
[
semantic_idx
]
=
decl_idx_to_string
[
reg_idx
];
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3DDECL
USAGE_COLOR
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_
USAGE_COLOR
))
{
if
(
semantic_idx
<
2
)
priv_ctx
->
color_output
[
semantic_idx
]
=
decl_idx_to_string
[
reg_idx
];
if
(
semantic_idx
<
2
)
priv_ctx
->
color_output
[
semantic_idx
]
=
decl_idx_to_string
[
reg_idx
];
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_FOG
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_FOG
))
{
if
(
!
semantic_idx
)
priv_ctx
->
fog_output
=
decl_idx_to_string
[
reg_idx
];
if
(
!
semantic_idx
)
priv_ctx
->
fog_output
=
decl_idx_to_string
[
reg_idx
];
}
else
{
...
...
@@ -4071,13 +4074,13 @@ static void init_output_registers(const struct wined3d_shader *shader, DWORD sig
semantic_name
=
shader
->
output_signature
[
i
].
semantic_name
;
if
(
!
semantic_name
)
continue
;
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_POSITION
)
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_POSITION
)
&&
!
shader
->
output_signature
[
i
].
semantic_idx
)
{
priv_ctx
->
vs_output
[
i
]
=
"TMP_OUT"
;
continue
;
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_PSIZE
)
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_PSIZE
)
&&
!
shader
->
output_signature
[
i
].
semantic_idx
)
{
priv_ctx
->
vs_output
[
i
]
=
"result.pointsize"
;
...
...
dlls/wined3d/device.c
View file @
bee9adbd
...
...
@@ -144,21 +144,21 @@ static enum wined3d_primitive_type d3d_primitive_type_from_gl(GLenum primitive_t
static
BOOL
fixed_get_input
(
BYTE
usage
,
BYTE
usage_idx
,
unsigned
int
*
regnum
)
{
if
((
usage
==
WINED3D
DECLUSAGE_POSITION
||
usage
==
WINED3DDECL
USAGE_POSITIONT
)
&&
!
usage_idx
)
if
((
usage
==
WINED3D
_DECL_USAGE_POSITION
||
usage
==
WINED3D_DECL_
USAGE_POSITIONT
)
&&
!
usage_idx
)
*
regnum
=
WINED3D_FFP_POSITION
;
else
if
(
usage
==
WINED3D
DECLUSAGE_BLEND
WEIGHT
&&
!
usage_idx
)
else
if
(
usage
==
WINED3D
_DECL_USAGE_BLEND_
WEIGHT
&&
!
usage_idx
)
*
regnum
=
WINED3D_FFP_BLENDWEIGHT
;
else
if
(
usage
==
WINED3D
DECLUSAGE_BLEND
INDICES
&&
!
usage_idx
)
else
if
(
usage
==
WINED3D
_DECL_USAGE_BLEND_
INDICES
&&
!
usage_idx
)
*
regnum
=
WINED3D_FFP_BLENDINDICES
;
else
if
(
usage
==
WINED3D
DECL
USAGE_NORMAL
&&
!
usage_idx
)
else
if
(
usage
==
WINED3D
_DECL_
USAGE_NORMAL
&&
!
usage_idx
)
*
regnum
=
WINED3D_FFP_NORMAL
;
else
if
(
usage
==
WINED3D
DECL
USAGE_PSIZE
&&
!
usage_idx
)
else
if
(
usage
==
WINED3D
_DECL_
USAGE_PSIZE
&&
!
usage_idx
)
*
regnum
=
WINED3D_FFP_PSIZE
;
else
if
(
usage
==
WINED3D
DECL
USAGE_COLOR
&&
!
usage_idx
)
else
if
(
usage
==
WINED3D
_DECL_
USAGE_COLOR
&&
!
usage_idx
)
*
regnum
=
WINED3D_FFP_DIFFUSE
;
else
if
(
usage
==
WINED3D
DECL
USAGE_COLOR
&&
usage_idx
==
1
)
else
if
(
usage
==
WINED3D
_DECL_
USAGE_COLOR
&&
usage_idx
==
1
)
*
regnum
=
WINED3D_FFP_SPECULAR
;
else
if
(
usage
==
WINED3D
DECL
USAGE_TEXCOORD
&&
usage_idx
<
WINED3DDP_MAXTEXCOORD
)
else
if
(
usage
==
WINED3D
_DECL_
USAGE_TEXCOORD
&&
usage_idx
<
WINED3DDP_MAXTEXCOORD
)
*
regnum
=
WINED3D_FFP_TEXCOORD0
+
usage_idx
;
else
{
...
...
@@ -240,8 +240,8 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
if
(
data
.
buffer_object
)
*
fixup
=
TRUE
;
else
if
(
*
fixup
&&
!
use_vshader
&&
(
element
->
usage
==
WINED3D
DECL
USAGE_COLOR
||
element
->
usage
==
WINED3D
DECL
USAGE_POSITIONT
))
&&
(
element
->
usage
==
WINED3D
_DECL_
USAGE_COLOR
||
element
->
usage
==
WINED3D
_DECL_
USAGE_POSITIONT
))
{
static
BOOL
warned
=
FALSE
;
if
(
!
warned
)
...
...
dlls/wined3d/glsl_shader.c
View file @
bee9adbd
...
...
@@ -3685,7 +3685,7 @@ static void shader_glsl_input_pack(const struct wined3d_shader *shader, struct w
semantic_idx
=
input_signature
[
i
].
semantic_idx
;
shader_glsl_write_mask_to_str
(
input_signature
[
i
].
mask
,
reg_mask
);
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_TEXCOORD
))
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_TEXCOORD
))
{
if
(
semantic_idx
<
8
&&
vertexprocessing
==
pretransformed
)
shader_addline
(
buffer
,
"IN[%u]%s = gl_TexCoord[%u]%s;
\n
"
,
...
...
@@ -3694,7 +3694,7 @@ static void shader_glsl_input_pack(const struct wined3d_shader *shader, struct w
shader_addline
(
buffer
,
"IN[%u]%s = vec4(0.0, 0.0, 0.0, 0.0)%s;
\n
"
,
shader
->
u
.
ps
.
input_reg_map
[
i
],
reg_mask
,
reg_mask
);
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_COLOR
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_COLOR
))
{
if
(
!
semantic_idx
)
shader_addline
(
buffer
,
"IN[%u]%s = vec4(gl_Color)%s;
\n
"
,
...
...
@@ -3893,7 +3893,7 @@ static GLhandleARB generate_param_reorder_function(struct wined3d_shader_buffer
write_mask
=
output_signature
[
i
].
mask
;
shader_glsl_write_mask_to_str
(
write_mask
,
reg_mask
);
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_COLOR
))
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_COLOR
))
{
if
(
!
semantic_idx
)
shader_addline
(
buffer
,
"gl_FrontColor%s = OUT[%u]%s;
\n
"
,
...
...
@@ -3902,12 +3902,12 @@ static GLhandleARB generate_param_reorder_function(struct wined3d_shader_buffer
shader_addline
(
buffer
,
"gl_FrontSecondaryColor%s = OUT[%u]%s;
\n
"
,
reg_mask
,
i
,
reg_mask
);
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_POSITION
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_POSITION
))
{
shader_addline
(
buffer
,
"gl_Position%s = OUT[%u]%s;
\n
"
,
reg_mask
,
i
,
reg_mask
);
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_TEXCOORD
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_TEXCOORD
))
{
if
(
semantic_idx
<
8
)
{
...
...
@@ -3920,11 +3920,11 @@ static GLhandleARB generate_param_reorder_function(struct wined3d_shader_buffer
shader_addline
(
buffer
,
"gl_TexCoord[%u].w = 1.0;
\n
"
,
semantic_idx
);
}
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_PSIZE
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_PSIZE
))
{
shader_addline
(
buffer
,
"gl_PointSize = OUT[%u].%c;
\n
"
,
i
,
reg_mask
[
1
]);
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_FOG
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_FOG
))
{
shader_addline
(
buffer
,
"gl_FogFragCoord = OUT[%u].%c;
\n
"
,
i
,
reg_mask
[
1
]);
}
...
...
@@ -3947,12 +3947,12 @@ static GLhandleARB generate_param_reorder_function(struct wined3d_shader_buffer
semantic_name
=
output_signature
[
i
].
semantic_name
;
shader_glsl_write_mask_to_str
(
output_signature
[
i
].
mask
,
reg_mask
);
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_POSITION
))
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_POSITION
))
{
shader_addline
(
buffer
,
"gl_Position%s = OUT[%u]%s;
\n
"
,
reg_mask
,
i
,
reg_mask
);
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
DECL
USAGE_PSIZE
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D
_DECL_
USAGE_PSIZE
))
{
shader_addline
(
buffer
,
"gl_PointSize = OUT[%u].%c;
\n
"
,
i
,
reg_mask
[
1
]);
}
...
...
dlls/wined3d/shader.c
View file @
bee9adbd
...
...
@@ -146,23 +146,23 @@ static const char * const shader_opcode_names[] =
static
const
char
*
const
semantic_names
[]
=
{
/* WINED3D
DECLUSAGE_POSITION
*/
"SV_POSITION"
,
/* WINED3D
DECLUSAGE_BLENDWEIGHT
*/
"BLENDWEIGHT"
,
/* WINED3D
DECLUSAGE_BLENDINDICES
*/
"BLENDINDICES"
,
/* WINED3D
DECLUSAGE_NORMAL
*/
"NORMAL"
,
/* WINED3D
DECLUSAGE_PSIZE
*/
"PSIZE"
,
/* WINED3D
DECLUSAGE_TEXCOORD
*/
"TEXCOORD"
,
/* WINED3D
DECLUSAGE_TANGENT
*/
"TANGENT"
,
/* WINED3D
DECLUSAGE_BINORMAL
*/
"BINORMAL"
,
/* WINED3D
DECLUSAGE_TESSFACTOR
*/
"TESSFACTOR"
,
/* WINED3D
DECLUSAGE_POSITIONT
*/
"POSITIONT"
,
/* WINED3D
DECLUSAGE_COLOR
*/
"COLOR"
,
/* WINED3D
DECLUSAGE_FOG
*/
"FOG"
,
/* WINED3D
DECLUSAGE_DEPTH
*/
"DEPTH"
,
/* WINED3D
DECLUSAGE_SAMPLE
*/
"SAMPLE"
,
/* WINED3D
_DECL_USAGE_POSITION
*/
"SV_POSITION"
,
/* WINED3D
_DECL_USAGE_BLEND_WEIGHT
*/
"BLENDWEIGHT"
,
/* WINED3D
_DECL_USAGE_BLEND_INDICES
*/
"BLENDINDICES"
,
/* WINED3D
_DECL_USAGE_NORMAL
*/
"NORMAL"
,
/* WINED3D
_DECL_USAGE_PSIZE
*/
"PSIZE"
,
/* WINED3D
_DECL_USAGE_TEXCOORD
*/
"TEXCOORD"
,
/* WINED3D
_DECL_USAGE_TANGENT
*/
"TANGENT"
,
/* WINED3D
_DECL_USAGE_BINORMAL
*/
"BINORMAL"
,
/* WINED3D
_DECL_USAGE_TESS_FACTOR
*/
"TESSFACTOR"
,
/* WINED3D
_DECL_USAGE_POSITIONT
*/
"POSITIONT"
,
/* WINED3D
_DECL_USAGE_COLOR
*/
"COLOR"
,
/* WINED3D
_DECL_USAGE_FOG
*/
"FOG"
,
/* WINED3D
_DECL_USAGE_DEPTH
*/
"DEPTH"
,
/* WINED3D
_DECL_USAGE_SAMPLE
*/
"SAMPLE"
,
};
static
const
char
*
shader_semantic_name_from_usage
(
WINED3DDECLUSAGE
usage
)
static
const
char
*
shader_semantic_name_from_usage
(
enum
wined3d_decl_usage
usage
)
{
if
(
usage
>=
sizeof
(
semantic_names
)
/
sizeof
(
*
semantic_names
))
{
...
...
@@ -173,7 +173,7 @@ static const char *shader_semantic_name_from_usage(WINED3DDECLUSAGE usage)
return
semantic_names
[
usage
];
}
static
WINED3DDECLUSAGE
shader_usage_from_semantic_name
(
const
char
*
name
)
static
enum
wined3d_decl_usage
shader_usage_from_semantic_name
(
const
char
*
name
)
{
unsigned
int
i
;
...
...
@@ -185,7 +185,7 @@ static WINED3DDECLUSAGE shader_usage_from_semantic_name(const char *name)
return
~
0U
;
}
BOOL
shader_match_semantic
(
const
char
*
semantic_name
,
WINED3DDECLUSAGE
usage
)
BOOL
shader_match_semantic
(
const
char
*
semantic_name
,
enum
wined3d_decl_usage
usage
)
{
return
!
strcmp
(
semantic_name
,
shader_semantic_name_from_usage
(
usage
));
}
...
...
@@ -202,7 +202,7 @@ static void shader_signature_from_semantic(struct wined3d_shader_signature_eleme
}
static
void
shader_signature_from_usage
(
struct
wined3d_shader_signature_element
*
e
,
WINED3DDECLUSAGE
usage
,
UINT
usage_idx
,
UINT
reg_idx
,
DWORD
write_mask
)
enum
wined3d_decl_usage
usage
,
UINT
usage_idx
,
UINT
reg_idx
,
DWORD
write_mask
)
{
e
->
semantic_name
=
shader_semantic_name_from_usage
(
usage
);
e
->
semantic_idx
=
usage_idx
;
...
...
@@ -518,7 +518,8 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
case
WINED3DSPR_OUTPUT
:
reg_maps
->
output_registers
|=
1
<<
semantic
.
reg
.
reg
.
idx
;
shader_signature_from_semantic
(
&
output_signature
[
semantic
.
reg
.
reg
.
idx
],
&
semantic
);
if
(
semantic
.
usage
==
WINED3DDECLUSAGE_FOG
)
reg_maps
->
fog
=
1
;
if
(
semantic
.
usage
==
WINED3D_DECL_USAGE_FOG
)
reg_maps
->
fog
=
1
;
break
;
/* Save sampler usage token. */
...
...
@@ -639,19 +640,19 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
case
0
:
/* oPos */
reg_maps
->
output_registers
|=
1
<<
10
;
shader_signature_from_usage
(
&
output_signature
[
10
],
WINED3D
DECL
USAGE_POSITION
,
0
,
10
,
WINED3DSP_WRITEMASK_ALL
);
WINED3D
_DECL_
USAGE_POSITION
,
0
,
10
,
WINED3DSP_WRITEMASK_ALL
);
break
;
case
1
:
/* oFog */
reg_maps
->
output_registers
|=
1
<<
11
;
shader_signature_from_usage
(
&
output_signature
[
11
],
WINED3D
DECL
USAGE_FOG
,
0
,
11
,
WINED3DSP_WRITEMASK_0
);
WINED3D
_DECL_
USAGE_FOG
,
0
,
11
,
WINED3DSP_WRITEMASK_0
);
break
;
case
2
:
/* oPts */
reg_maps
->
output_registers
|=
1
<<
11
;
shader_signature_from_usage
(
&
output_signature
[
11
],
WINED3D
DECL
USAGE_PSIZE
,
0
,
11
,
WINED3DSP_WRITEMASK_1
);
WINED3D
_DECL_
USAGE_PSIZE
,
0
,
11
,
WINED3DSP_WRITEMASK_1
);
break
;
}
break
;
...
...
@@ -668,7 +669,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
{
reg_maps
->
output_registers
|=
1
<<
idx
;
shader_signature_from_usage
(
&
output_signature
[
idx
],
WINED3D
DECL
USAGE_COLOR
,
idx
-
8
,
idx
,
dst_param
.
write_mask
);
WINED3D
_DECL_
USAGE_COLOR
,
idx
-
8
,
idx
,
dst_param
.
write_mask
);
}
}
break
;
...
...
@@ -684,7 +685,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
{
reg_maps
->
output_registers
|=
1
<<
idx
;
shader_signature_from_usage
(
&
output_signature
[
idx
],
WINED3D
DECL
USAGE_TEXCOORD
,
idx
,
idx
,
dst_param
.
write_mask
);
WINED3D
_DECL_
USAGE_TEXCOORD
,
idx
,
idx
,
dst_param
.
write_mask
);
}
break
;
...
...
@@ -852,60 +853,60 @@ static void shader_dump_decl_usage(const struct wined3d_shader_semantic *semanti
switch
(
semantic
->
usage
)
{
case
WINED3D
DECL
USAGE_POSITION
:
case
WINED3D
_DECL_
USAGE_POSITION
:
TRACE
(
"position%u"
,
semantic
->
usage_idx
);
break
;
case
WINED3D
DECLUSAGE_BLEND
INDICES
:
case
WINED3D
_DECL_USAGE_BLEND_
INDICES
:
TRACE
(
"blend"
);
break
;
case
WINED3D
DECLUSAGE_BLEND
WEIGHT
:
case
WINED3D
_DECL_USAGE_BLEND_
WEIGHT
:
TRACE
(
"weight"
);
break
;
case
WINED3D
DECL
USAGE_NORMAL
:
case
WINED3D
_DECL_
USAGE_NORMAL
:
TRACE
(
"normal%u"
,
semantic
->
usage_idx
);
break
;
case
WINED3D
DECL
USAGE_PSIZE
:
case
WINED3D
_DECL_
USAGE_PSIZE
:
TRACE
(
"psize"
);
break
;
case
WINED3D
DECL
USAGE_COLOR
:
case
WINED3D
_DECL_
USAGE_COLOR
:
if
(
!
semantic
->
usage_idx
)
TRACE
(
"color"
);
else
TRACE
(
"specular%u"
,
(
semantic
->
usage_idx
-
1
));
break
;
case
WINED3D
DECL
USAGE_TEXCOORD
:
case
WINED3D
_DECL_
USAGE_TEXCOORD
:
TRACE
(
"texture%u"
,
semantic
->
usage_idx
);
break
;
case
WINED3D
DECL
USAGE_TANGENT
:
case
WINED3D
_DECL_
USAGE_TANGENT
:
TRACE
(
"tangent"
);
break
;
case
WINED3D
DECL
USAGE_BINORMAL
:
case
WINED3D
_DECL_
USAGE_BINORMAL
:
TRACE
(
"binormal"
);
break
;
case
WINED3D
DECLUSAGE_TESS
FACTOR
:
case
WINED3D
_DECL_USAGE_TESS_
FACTOR
:
TRACE
(
"tessfactor"
);
break
;
case
WINED3D
DECL
USAGE_POSITIONT
:
case
WINED3D
_DECL_
USAGE_POSITIONT
:
TRACE
(
"positionT%u"
,
semantic
->
usage_idx
);
break
;
case
WINED3D
DECL
USAGE_FOG
:
case
WINED3D
_DECL_
USAGE_FOG
:
TRACE
(
"fog"
);
break
;
case
WINED3D
DECL
USAGE_DEPTH
:
case
WINED3D
_DECL_
USAGE_DEPTH
:
TRACE
(
"depth"
);
break
;
case
WINED3D
DECL
USAGE_SAMPLE
:
case
WINED3D
_DECL_
USAGE_SAMPLE
:
TRACE
(
"sample"
);
break
;
...
...
@@ -1718,10 +1719,14 @@ void find_vs_compile_args(const struct wined3d_state *state,
static
BOOL
match_usage
(
BYTE
usage1
,
BYTE
usage_idx1
,
BYTE
usage2
,
BYTE
usage_idx2
)
{
if
(
usage_idx1
!=
usage_idx2
)
return
FALSE
;
if
(
usage1
==
usage2
)
return
TRUE
;
if
(
usage1
==
WINED3DDECLUSAGE_POSITION
&&
usage2
==
WINED3DDECLUSAGE_POSITIONT
)
return
TRUE
;
if
(
usage2
==
WINED3DDECLUSAGE_POSITION
&&
usage1
==
WINED3DDECLUSAGE_POSITIONT
)
return
TRUE
;
if
(
usage_idx1
!=
usage_idx2
)
return
FALSE
;
if
(
usage1
==
usage2
)
return
TRUE
;
if
(
usage1
==
WINED3D_DECL_USAGE_POSITION
&&
usage2
==
WINED3D_DECL_USAGE_POSITIONT
)
return
TRUE
;
if
(
usage2
==
WINED3D_DECL_USAGE_POSITION
&&
usage1
==
WINED3D_DECL_USAGE_POSITIONT
)
return
TRUE
;
return
FALSE
;
}
...
...
@@ -1927,7 +1932,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
struct
wined3d_vertex_declaration_element
*
element
=
&
state
->
vertex_declaration
->
elements
[
j
];
if
(
element
->
usage
==
WINED3D
DECL
USAGE_TEXCOORD
if
(
element
->
usage
==
WINED3D
_DECL_
USAGE_TEXCOORD
&&
element
->
usage_idx
==
index
)
{
max_valid
=
element
->
format
->
component_count
;
...
...
dlls/wined3d/utils.c
View file @
bee9adbd
...
...
@@ -1953,23 +1953,25 @@ const char *debug_d3ddeclmethod(enum wined3d_decl_method method)
}
}
const
char
*
debug_d3ddeclusage
(
BYTE
usage
)
{
switch
(
usage
)
{
const
char
*
debug_d3ddeclusage
(
enum
wined3d_decl_usage
usage
)
{
switch
(
usage
)
{
#define WINED3DDECLUSAGE_TO_STR(u) case u: return #u
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECL
USAGE_POSITION
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECLUSAGE_BLEND
WEIGHT
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECLUSAGE_BLEND
INDICES
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECL
USAGE_NORMAL
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECL
USAGE_PSIZE
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECL
USAGE_TEXCOORD
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECL
USAGE_TANGENT
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECL
USAGE_BINORMAL
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECLUSAGE_TESS
FACTOR
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECL
USAGE_POSITIONT
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECL
USAGE_COLOR
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECL
USAGE_FOG
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECL
USAGE_DEPTH
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
DECL
USAGE_SAMPLE
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_
USAGE_POSITION
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_USAGE_BLEND_
WEIGHT
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_USAGE_BLEND_
INDICES
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_
USAGE_NORMAL
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_
USAGE_PSIZE
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_
USAGE_TEXCOORD
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_
USAGE_TANGENT
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_
USAGE_BINORMAL
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_USAGE_TESS_
FACTOR
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_
USAGE_POSITIONT
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_
USAGE_COLOR
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_
USAGE_FOG
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_
USAGE_DEPTH
);
WINED3DDECLUSAGE_TO_STR
(
WINED3D
_DECL_
USAGE_SAMPLE
);
#undef WINED3DDECLUSAGE_TO_STR
default:
FIXME
(
"Unrecognized %u declaration usage!
\n
"
,
usage
);
...
...
dlls/wined3d/vertexdeclaration.c
View file @
bee9adbd
...
...
@@ -74,8 +74,8 @@ static BOOL declaration_element_valid_ffp(const struct wined3d_vertex_element *e
{
switch
(
element
->
usage
)
{
case
WINED3D
DECL
USAGE_POSITION
:
case
WINED3D
DECL
USAGE_POSITIONT
:
case
WINED3D
_DECL_
USAGE_POSITION
:
case
WINED3D
_DECL_
USAGE_POSITIONT
:
switch
(
element
->
format
)
{
case
WINED3DFMT_R32G32_FLOAT
:
...
...
@@ -90,7 +90,7 @@ static BOOL declaration_element_valid_ffp(const struct wined3d_vertex_element *e
return
FALSE
;
}
case
WINED3D
DECLUSAGE_BLEND
WEIGHT
:
case
WINED3D
_DECL_USAGE_BLEND_
WEIGHT
:
switch
(
element
->
format
)
{
case
WINED3DFMT_R32_FLOAT
:
...
...
@@ -108,7 +108,7 @@ static BOOL declaration_element_valid_ffp(const struct wined3d_vertex_element *e
return
FALSE
;
}
case
WINED3D
DECL
USAGE_NORMAL
:
case
WINED3D
_DECL_
USAGE_NORMAL
:
switch
(
element
->
format
)
{
case
WINED3DFMT_R32G32B32_FLOAT
:
...
...
@@ -120,7 +120,7 @@ static BOOL declaration_element_valid_ffp(const struct wined3d_vertex_element *e
return
FALSE
;
}
case
WINED3D
DECL
USAGE_TEXCOORD
:
case
WINED3D
_DECL_
USAGE_TEXCOORD
:
switch
(
element
->
format
)
{
case
WINED3DFMT_R32_FLOAT
:
...
...
@@ -136,7 +136,7 @@ static BOOL declaration_element_valid_ffp(const struct wined3d_vertex_element *e
return
FALSE
;
}
case
WINED3D
DECL
USAGE_COLOR
:
case
WINED3D
_DECL_
USAGE_COLOR
:
switch
(
element
->
format
)
{
case
WINED3DFMT_R32G32B32_FLOAT
:
...
...
@@ -201,7 +201,8 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara
e
->
usage
=
elements
[
i
].
usage
;
e
->
usage_idx
=
elements
[
i
].
usage_idx
;
if
(
e
->
usage
==
WINED3DDECLUSAGE_POSITIONT
)
declaration
->
position_transformed
=
TRUE
;
if
(
e
->
usage
==
WINED3D_DECL_USAGE_POSITIONT
)
declaration
->
position_transformed
=
TRUE
;
/* Find the streams used in the declaration. The vertex buffers have
* to be loaded when drawing, but filter tesselation pseudo streams. */
...
...
@@ -278,7 +279,7 @@ struct wined3d_fvf_convert_state
};
static
void
append_decl_element
(
struct
wined3d_fvf_convert_state
*
state
,
enum
wined3d_format_id
format_id
,
WINED3DDECLUSAGE
usage
,
UINT
usage_idx
)
enum
wined3d_format_id
format_id
,
enum
wined3d_decl_usage
usage
,
UINT
usage_idx
)
{
struct
wined3d_vertex_element
*
elements
=
state
->
elements
;
const
struct
wined3d_format
*
format
;
...
...
@@ -333,32 +334,32 @@ static unsigned int convert_fvf_to_declaration(const struct wined3d_gl_info *gl_
if
(
has_pos
)
{
if
(
!
has_blend
&&
(
fvf
&
WINED3DFVF_XYZRHW
))
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32A32_FLOAT
,
WINED3D
DECL
USAGE_POSITIONT
,
0
);
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32A32_FLOAT
,
WINED3D
_DECL_
USAGE_POSITIONT
,
0
);
else
if
((
fvf
&
WINED3DFVF_XYZW
)
==
WINED3DFVF_XYZW
)
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32A32_FLOAT
,
WINED3D
DECL
USAGE_POSITION
,
0
);
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32A32_FLOAT
,
WINED3D
_DECL_
USAGE_POSITION
,
0
);
else
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32_FLOAT
,
WINED3D
DECL
USAGE_POSITION
,
0
);
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32_FLOAT
,
WINED3D
_DECL_
USAGE_POSITION
,
0
);
}
if
(
has_blend
&&
(
num_blends
>
0
))
{
if
((
fvf
&
WINED3DFVF_XYZB5
)
==
WINED3DFVF_XYZB2
&&
(
fvf
&
WINED3DFVF_LASTBETA_D3DCOLOR
))
append_decl_element
(
&
state
,
WINED3DFMT_B8G8R8A8_UNORM
,
WINED3D
DECLUSAGE_BLEND
WEIGHT
,
0
);
append_decl_element
(
&
state
,
WINED3DFMT_B8G8R8A8_UNORM
,
WINED3D
_DECL_USAGE_BLEND_
WEIGHT
,
0
);
else
{
switch
(
num_blends
)
{
case
1
:
append_decl_element
(
&
state
,
WINED3DFMT_R32_FLOAT
,
WINED3D
DECLUSAGE_BLEND
WEIGHT
,
0
);
append_decl_element
(
&
state
,
WINED3DFMT_R32_FLOAT
,
WINED3D
_DECL_USAGE_BLEND_
WEIGHT
,
0
);
break
;
case
2
:
append_decl_element
(
&
state
,
WINED3DFMT_R32G32_FLOAT
,
WINED3D
DECLUSAGE_BLEND
WEIGHT
,
0
);
append_decl_element
(
&
state
,
WINED3DFMT_R32G32_FLOAT
,
WINED3D
_DECL_USAGE_BLEND_
WEIGHT
,
0
);
break
;
case
3
:
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32_FLOAT
,
WINED3D
DECLUSAGE_BLEND
WEIGHT
,
0
);
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32_FLOAT
,
WINED3D
_DECL_USAGE_BLEND_
WEIGHT
,
0
);
break
;
case
4
:
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32A32_FLOAT
,
WINED3D
DECLUSAGE_BLEND
WEIGHT
,
0
);
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32A32_FLOAT
,
WINED3D
_DECL_USAGE_BLEND_
WEIGHT
,
0
);
break
;
default:
ERR
(
"Unexpected amount of blend values: %u
\n
"
,
num_blends
);
...
...
@@ -370,33 +371,37 @@ static unsigned int convert_fvf_to_declaration(const struct wined3d_gl_info *gl_
{
if
((
fvf
&
WINED3DFVF_LASTBETA_UBYTE4
)
||
((
fvf
&
WINED3DFVF_XYZB5
)
==
WINED3DFVF_XYZB2
&&
(
fvf
&
WINED3DFVF_LASTBETA_D3DCOLOR
)))
append_decl_element
(
&
state
,
WINED3DFMT_R8G8B8A8_UINT
,
WINED3D
DECLUSAGE_BLEND
INDICES
,
0
);
append_decl_element
(
&
state
,
WINED3DFMT_R8G8B8A8_UINT
,
WINED3D
_DECL_USAGE_BLEND_
INDICES
,
0
);
else
if
(
fvf
&
WINED3DFVF_LASTBETA_D3DCOLOR
)
append_decl_element
(
&
state
,
WINED3DFMT_B8G8R8A8_UNORM
,
WINED3D
DECLUSAGE_BLEND
INDICES
,
0
);
append_decl_element
(
&
state
,
WINED3DFMT_B8G8R8A8_UNORM
,
WINED3D
_DECL_USAGE_BLEND_
INDICES
,
0
);
else
append_decl_element
(
&
state
,
WINED3DFMT_R32_FLOAT
,
WINED3D
DECLUSAGE_BLEND
INDICES
,
0
);
append_decl_element
(
&
state
,
WINED3DFMT_R32_FLOAT
,
WINED3D
_DECL_USAGE_BLEND_
INDICES
,
0
);
}
if
(
has_normal
)
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32_FLOAT
,
WINED3DDECLUSAGE_NORMAL
,
0
);
if
(
has_psize
)
append_decl_element
(
&
state
,
WINED3DFMT_R32_FLOAT
,
WINED3DDECLUSAGE_PSIZE
,
0
);
if
(
has_diffuse
)
append_decl_element
(
&
state
,
WINED3DFMT_B8G8R8A8_UNORM
,
WINED3DDECLUSAGE_COLOR
,
0
);
if
(
has_specular
)
append_decl_element
(
&
state
,
WINED3DFMT_B8G8R8A8_UNORM
,
WINED3DDECLUSAGE_COLOR
,
1
);
if
(
has_normal
)
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32_FLOAT
,
WINED3D_DECL_USAGE_NORMAL
,
0
);
if
(
has_psize
)
append_decl_element
(
&
state
,
WINED3DFMT_R32_FLOAT
,
WINED3D_DECL_USAGE_PSIZE
,
0
);
if
(
has_diffuse
)
append_decl_element
(
&
state
,
WINED3DFMT_B8G8R8A8_UNORM
,
WINED3D_DECL_USAGE_COLOR
,
0
);
if
(
has_specular
)
append_decl_element
(
&
state
,
WINED3DFMT_B8G8R8A8_UNORM
,
WINED3D_DECL_USAGE_COLOR
,
1
);
for
(
idx
=
0
;
idx
<
num_textures
;
++
idx
)
{
switch
((
texcoords
>>
(
idx
*
2
))
&
0x03
)
{
case
WINED3DFVF_TEXTUREFORMAT1
:
append_decl_element
(
&
state
,
WINED3DFMT_R32_FLOAT
,
WINED3D
DECL
USAGE_TEXCOORD
,
idx
);
append_decl_element
(
&
state
,
WINED3DFMT_R32_FLOAT
,
WINED3D
_DECL_
USAGE_TEXCOORD
,
idx
);
break
;
case
WINED3DFVF_TEXTUREFORMAT2
:
append_decl_element
(
&
state
,
WINED3DFMT_R32G32_FLOAT
,
WINED3D
DECL
USAGE_TEXCOORD
,
idx
);
append_decl_element
(
&
state
,
WINED3DFMT_R32G32_FLOAT
,
WINED3D
_DECL_
USAGE_TEXCOORD
,
idx
);
break
;
case
WINED3DFVF_TEXTUREFORMAT3
:
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32_FLOAT
,
WINED3D
DECL
USAGE_TEXCOORD
,
idx
);
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32_FLOAT
,
WINED3D
_DECL_
USAGE_TEXCOORD
,
idx
);
break
;
case
WINED3DFVF_TEXTUREFORMAT4
:
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32A32_FLOAT
,
WINED3D
DECL
USAGE_TEXCOORD
,
idx
);
append_decl_element
(
&
state
,
WINED3DFMT_R32G32B32A32_FLOAT
,
WINED3D
_DECL_
USAGE_TEXCOORD
,
idx
);
break
;
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
bee9adbd
...
...
@@ -641,7 +641,7 @@ struct wined3d_shader_instruction
struct
wined3d_shader_semantic
{
WINED3DDECLUSAGE
usage
;
enum
wined3d_decl_usage
usage
;
UINT
usage_idx
;
enum
wined3d_sampler_texture_type
sampler_type
;
struct
wined3d_shader_dst_param
reg
;
...
...
@@ -649,7 +649,7 @@ struct wined3d_shader_semantic
struct
wined3d_shader_attribute
{
WINED3DDECLUSAGE
usage
;
enum
wined3d_decl_usage
usage
;
UINT
usage_idx
;
};
...
...
@@ -2492,7 +2492,7 @@ const char *debug_d3dresourcetype(enum wined3d_resource_type resource_type) DECL
const
char
*
debug_d3dusage
(
DWORD
usage
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3dusagequery
(
DWORD
usagequery
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3ddeclmethod
(
enum
wined3d_decl_method
method
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3ddeclusage
(
BYTE
usage
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3ddeclusage
(
enum
wined3d_decl_usage
usage
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3dprimitivetype
(
enum
wined3d_primitive_type
primitive_type
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3drenderstate
(
enum
wined3d_render_state
state
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3dsamplerstate
(
enum
wined3d_sampler_state
state
)
DECLSPEC_HIDDEN
;
...
...
@@ -2655,7 +2655,7 @@ unsigned int shader_find_free_input_register(const struct wined3d_shader_reg_map
unsigned
int
max
)
DECLSPEC_HIDDEN
;
void
shader_generate_main
(
const
struct
wined3d_shader
*
shader
,
struct
wined3d_shader_buffer
*
buffer
,
const
struct
wined3d_shader_reg_maps
*
reg_maps
,
const
DWORD
*
byte_code
,
void
*
backend_ctx
)
DECLSPEC_HIDDEN
;
BOOL
shader_match_semantic
(
const
char
*
semantic_name
,
WINED3DDECLUSAGE
usage
)
DECLSPEC_HIDDEN
;
BOOL
shader_match_semantic
(
const
char
*
semantic_name
,
enum
wined3d_decl_usage
usage
)
DECLSPEC_HIDDEN
;
static
inline
BOOL
shader_is_pshader_version
(
enum
wined3d_shader_type
type
)
{
...
...
include/wine/wined3d.h
View file @
bee9adbd
...
...
@@ -730,23 +730,23 @@ enum wined3d_decl_method
WINED3D_DECL_METHOD_LOOKUP_PRESAMPLED
=
6
,
};
typedef
enum
_WINED3DDECLUSAGE
{
WINED3D
DECLUSAGE_POSITION
=
0
,
WINED3D
DECLUSAGE_BLENDWEIGHT
=
1
,
WINED3D
DECLUSAGE_BLENDINDICES
=
2
,
WINED3D
DECLUSAGE_NORMAL
=
3
,
WINED3D
DECLUSAGE_PSIZE
=
4
,
WINED3D
DECLUSAGE_TEXCOORD
=
5
,
WINED3D
DECLUSAGE_TANGENT
=
6
,
WINED3D
DECLUSAGE_BINORMAL
=
7
,
WINED3D
DECLUSAGE_TESSFACTOR
=
8
,
WINED3D
DECLUSAGE_POSITIONT
=
9
,
WINED3D
DECLUSAGE_COLOR
=
10
,
WINED3D
DECLUSAGE_FOG
=
11
,
WINED3D
DECLUSAGE_DEPTH
=
12
,
WINED3D
DECLUSAGE_SAMPLE
=
13
}
WINED3DDECLUSAGE
;
enum
wined3d_decl_usage
{
WINED3D
_DECL_USAGE_POSITION
=
0
,
WINED3D
_DECL_USAGE_BLEND_WEIGHT
=
1
,
WINED3D
_DECL_USAGE_BLEND_INDICES
=
2
,
WINED3D
_DECL_USAGE_NORMAL
=
3
,
WINED3D
_DECL_USAGE_PSIZE
=
4
,
WINED3D
_DECL_USAGE_TEXCOORD
=
5
,
WINED3D
_DECL_USAGE_TANGENT
=
6
,
WINED3D
_DECL_USAGE_BINORMAL
=
7
,
WINED3D
_DECL_USAGE_TESS_FACTOR
=
8
,
WINED3D
_DECL_USAGE_POSITIONT
=
9
,
WINED3D
_DECL_USAGE_COLOR
=
10
,
WINED3D
_DECL_USAGE_FOG
=
11
,
WINED3D
_DECL_USAGE_DEPTH
=
12
,
WINED3D
_DECL_USAGE_SAMPLE
=
13
};
typedef
enum
_WINED3DSURFTYPE
{
...
...
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