Commit e8137632 authored by Ivan Gyurdiev's avatar Ivan Gyurdiev Committed by Alexandre Julliard

wined3d: Move D3DSP DCL-related structures into WINED3D namespace.

parent 7259b9d8
......@@ -409,8 +409,8 @@ static void shader_dump_decl_usage(
} else {
DWORD usage = decl & D3DSP_DCL_USAGE_MASK;
DWORD idx = (decl & D3DSP_DCL_USAGEINDEX_MASK) >> D3DSP_DCL_USAGEINDEX_SHIFT;
DWORD usage = decl & WINED3DSP_DCL_USAGE_MASK;
DWORD idx = (decl & WINED3DSP_DCL_USAGEINDEX_MASK) >> WINED3DSP_DCL_USAGEINDEX_SHIFT;
/* Pixel shaders 3.0 don't have usage semantics */
char pshader = shader_is_pshader_version(This->baseShader.hex_version);
......
......@@ -1809,8 +1809,8 @@ void pshader_glsl_input_pack(
/* Uninitialized */
if (!usage_token) continue;
usage = (usage_token & D3DSP_DCL_USAGE_MASK) >> D3DSP_DCL_USAGE_SHIFT;
usage_idx = (usage_token & D3DSP_DCL_USAGEINDEX_MASK) >> D3DSP_DCL_USAGEINDEX_SHIFT;
usage = (usage_token & WINED3DSP_DCL_USAGE_MASK) >> WINED3DSP_DCL_USAGE_SHIFT;
usage_idx = (usage_token & WINED3DSP_DCL_USAGEINDEX_MASK) >> WINED3DSP_DCL_USAGEINDEX_SHIFT;
shader_glsl_get_output_register_swizzle(register_token, reg_mask);
switch(usage) {
......@@ -1864,8 +1864,8 @@ void vshader_glsl_output_unpack(
/* Uninitialized */
if (!usage_token) continue;
usage = (usage_token & D3DSP_DCL_USAGE_MASK) >> D3DSP_DCL_USAGE_SHIFT;
usage_idx = (usage_token & D3DSP_DCL_USAGEINDEX_MASK) >> D3DSP_DCL_USAGEINDEX_SHIFT;
usage = (usage_token & WINED3DSP_DCL_USAGE_MASK) >> WINED3DSP_DCL_USAGE_SHIFT;
usage_idx = (usage_token & WINED3DSP_DCL_USAGEINDEX_MASK) >> WINED3DSP_DCL_USAGEINDEX_SHIFT;
shader_glsl_get_output_register_swizzle(register_token, reg_mask);
switch(usage) {
......
......@@ -623,7 +623,7 @@ static void vshader_set_input(
/* Fake usage: set reserved bit, usage, usage_idx */
DWORD usage_token = (0x1 << 31) |
(usage << D3DSP_DCL_USAGE_SHIFT) | (usage_idx << D3DSP_DCL_USAGEINDEX_SHIFT);
(usage << WINED3DSP_DCL_USAGE_SHIFT) | (usage_idx << WINED3DSP_DCL_USAGEINDEX_SHIFT);
/* Fake register; set reserved bit, regnum, type: input, wmask: all */
DWORD reg_token = (0x1 << 31) |
......@@ -643,8 +643,8 @@ BOOL vshader_get_input(
for (i = 0; i < MAX_ATTRIBS; i++) {
DWORD usage_token = This->semantics_in[i].usage;
DWORD usage = (usage_token & D3DSP_DCL_USAGE_MASK) >> D3DSP_DCL_USAGE_SHIFT;
DWORD usage_idx = (usage_token & D3DSP_DCL_USAGEINDEX_MASK) >> D3DSP_DCL_USAGEINDEX_SHIFT;
DWORD usage = (usage_token & WINED3DSP_DCL_USAGE_MASK) >> WINED3DSP_DCL_USAGE_SHIFT;
DWORD usage_idx = (usage_token & WINED3DSP_DCL_USAGEINDEX_MASK) >> WINED3DSP_DCL_USAGEINDEX_SHIFT;
if (usage_token && (usage == usage_req && usage_idx == usage_idx_req)) {
*regnum = i;
......@@ -662,8 +662,8 @@ BOOL vshader_input_is_color(
IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device;
DWORD usage_token = This->semantics_in[regnum].usage;
DWORD usage = (usage_token & D3DSP_DCL_USAGE_MASK) >> D3DSP_DCL_USAGE_SHIFT;
DWORD usage_idx = (usage_token & D3DSP_DCL_USAGEINDEX_MASK) >> D3DSP_DCL_USAGEINDEX_SHIFT;
DWORD usage = (usage_token & WINED3DSP_DCL_USAGE_MASK) >> WINED3DSP_DCL_USAGE_SHIFT;
DWORD usage_idx = (usage_token & WINED3DSP_DCL_USAGEINDEX_MASK) >> WINED3DSP_DCL_USAGEINDEX_SHIFT;
IWineD3DVertexDeclarationImpl *vertexDeclaration = NULL;
if (This->vertexDeclaration) {
......
......@@ -23,6 +23,26 @@
#ifndef __WINE_WINED3D_TYPES_INTERNAL_H
#define __WINE_WINED3D_TYPES_INTERNAL_H
/** DCL usage masks **/
#define WINED3DSP_DCL_USAGE_SHIFT 0
#define WINED3DSP_DCL_USAGE_MASK 0x0000000f
#define WINED3DSP_DCL_USAGEINDEX_SHIFT 16
#define WINED3DSP_DCL_USAGEINDEX_MASK 0x000f0000
/** DCL sampler texture type **/
#define WINED3DSP_TEXTURETYPE_SHIFT 27
#define WINED3DSP_TEXTURETYPE_MASK 0x78000000
typedef enum _WINED3DSAMPLER_TEXTURE_TYPE {
WINED3DSTT_UNKNOWN = 0 << WINED3DSP_TEXTURETYPE_SHIFT,
WINED3DSTT_1D = 1 << WINED3DSP_TEXTURETYPE_SHIFT,
WINED3DSTT_2D = 2 << WINED3DSP_TEXTURETYPE_SHIFT,
WINED3DSTT_CUBE = 3 << WINED3DSP_TEXTURETYPE_SHIFT,
WINED3DSTT_VOLUME = 4 << WINED3DSP_TEXTURETYPE_SHIFT,
WINED3DSTT_FORCE_DWORD = 0x7FFFFFFF
} WINED3DSAMPLER_TEXTURE_TYPE;
/** register types for PS and VS */
typedef enum _WINED3DSHADER_PARAM_REGISTER_TYPE {
WINED3DSPR_TEMP = 0,
......
......@@ -1028,19 +1028,6 @@ typedef enum _WINED3DDECLUSAGE {
WINED3DSHADERDECLUSAGE_MAX_USAGE
} WINED3DSHADERDECLUSAGE;
#define WINED3DSP_TEXTURETYPE_SHIFT 27
#define WINED3DSP_TEXTURETYPE_MASK 0x78000000
typedef enum _WINED3DSAMPLER_TEXTURE_TYPE {
WINED3DSTT_UNKNOWN = 0 << WINED3DSP_TEXTURETYPE_SHIFT,
WINED3DSTT_1D = 1 << WINED3DSP_TEXTURETYPE_SHIFT,
WINED3DSTT_2D = 2 << WINED3DSP_TEXTURETYPE_SHIFT,
WINED3DSTT_CUBE = 3 << WINED3DSP_TEXTURETYPE_SHIFT,
WINED3DSTT_VOLUME = 4 << WINED3DSP_TEXTURETYPE_SHIFT,
WINED3DSTT_FORCE_DWORD = 0x7FFFFFFF
} WINED3DSAMPLER_TEXTURE_TYPE;
#define WINED3DUSAGE_RENDERTARGET 0x00000001L
#define WINED3DUSAGE_DEPTHSTENCIL 0x00000002L
#define WINED3DUSAGE_WRITEONLY 0x00000008L
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment