Make D3D headers more suitable for C89_BUILD

This commit is contained in:
twinaphex 2017-12-27 22:03:13 +01:00
parent b10616ffb7
commit 4c0c842451

View File

@ -168,7 +168,7 @@ typedef enum _D3DLIGHTTYPE {
D3DLIGHT_POINT = 1,
D3DLIGHT_SPOT = 2,
D3DLIGHT_DIRECTIONAL = 3,
D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DLIGHT_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DLIGHTTYPE;
typedef struct _D3DLIGHT9 {
@ -202,14 +202,14 @@ typedef enum _D3DSHADEMODE {
D3DSHADE_FLAT = 1,
D3DSHADE_GOURAUD = 2,
D3DSHADE_PHONG = 3,
D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DSHADE_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DSHADEMODE;
typedef enum _D3DFILLMODE {
D3DFILL_POINT = 1,
D3DFILL_WIREFRAME = 2,
D3DFILL_SOLID = 3,
D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DFILL_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DFILLMODE;
typedef enum _D3DBLEND {
@ -236,7 +236,7 @@ typedef enum _D3DBLEND {
#endif /* !D3D_DISABLE_9EX */
/* -- D3D9Ex only */
D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DBLEND_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DBLEND;
typedef enum _D3DBLENDOP {
@ -245,7 +245,7 @@ typedef enum _D3DBLENDOP {
D3DBLENDOP_REVSUBTRACT = 3,
D3DBLENDOP_MIN = 4,
D3DBLENDOP_MAX = 5,
D3DBLENDOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DBLENDOP_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DBLENDOP;
typedef enum _D3DTEXTUREADDRESS {
@ -254,14 +254,14 @@ typedef enum _D3DTEXTUREADDRESS {
D3DTADDRESS_CLAMP = 3,
D3DTADDRESS_BORDER = 4,
D3DTADDRESS_MIRRORONCE = 5,
D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DTADDRESS_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DTEXTUREADDRESS;
typedef enum _D3DCULL {
D3DCULL_NONE = 1,
D3DCULL_CW = 2,
D3DCULL_CCW = 3,
D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DCULL_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DCULL;
typedef enum _D3DCMPFUNC {
@ -273,7 +273,7 @@ typedef enum _D3DCMPFUNC {
D3DCMP_NOTEQUAL = 6,
D3DCMP_GREATEREQUAL = 7,
D3DCMP_ALWAYS = 8,
D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DCMP_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DCMPFUNC;
typedef enum _D3DSTENCILOP {
@ -285,7 +285,7 @@ typedef enum _D3DSTENCILOP {
D3DSTENCILOP_INVERT = 6,
D3DSTENCILOP_INCR = 7,
D3DSTENCILOP_DECR = 8,
D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DSTENCILOP_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DSTENCILOP;
typedef enum _D3DFOGMODE {
@ -293,7 +293,7 @@ typedef enum _D3DFOGMODE {
D3DFOG_EXP = 1,
D3DFOG_EXP2 = 2,
D3DFOG_LINEAR = 3,
D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DFOG_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DFOGMODE;
typedef enum _D3DZBUFFERTYPE {
@ -440,7 +440,7 @@ typedef enum _D3DRENDERSTATETYPE {
D3DRS_BLENDOPALPHA = 209, /* Blending operation for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */
D3DRS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DRS_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DRENDERSTATETYPE;
/* Maximum number of simultaneous render targets D3D supports */
@ -501,7 +501,7 @@ typedef enum _D3DTEXTURESTAGESTATETYPE
D3DTSS_CONSTANT = 32, /* Per-stage constant D3DTA_CONSTANT */
D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DTSS_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DTEXTURESTAGESTATETYPE;
/*
@ -526,7 +526,7 @@ typedef enum _D3DSAMPLERSTATETYPE
indicates which element index to use. Default = 0. */
D3DSAMP_DMAPOFFSET = 13, /* Offset in vertices in the pre-sampled displacement map.
Only valid for D3DDMAPSAMPLER sampler */
D3DSAMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DSAMP_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DSAMPLERSTATETYPE;
/* Special sampler which is used in the tesselator */
@ -584,31 +584,32 @@ typedef enum _D3DTEXTUREOP
/* Specular mapping */
D3DTOP_PREMODULATE = 17, /* modulate with next texture before use */
D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB
// COLOROP only
D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A
// COLOROP only
D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB
// COLOROP only
D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A
// COLOROP only
D3DTOP_MODULATEALPHA_ADDCOLOR = 18, /* Arg1.RGB + Arg1.A*Arg2.RGB
* COLOROP only */
D3DTOP_MODULATECOLOR_ADDALPHA = 19, /* Arg1.RGB*Arg2.RGB + Arg1.A
* COLOROP only */
D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, /* (1-Arg1.A)*Arg2.RGB + Arg1.RGB
* COLOROP only */
D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, /* (1-Arg1.RGB)*Arg2.RGB + Arg1.A
* COLOROP only */
// Bump mapping
D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation
D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel
/* Bump mapping */
D3DTOP_BUMPENVMAP = 22, /* per pixel env map perturbation */
D3DTOP_BUMPENVMAPLUMINANCE = 23, /* with luminance channel */
// This can do either diffuse or specular bump mapping with correct input.
// Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B)
// where each component has been scaled and offset to make it signed.
// The result is replicated into all four (including alpha) channels.
// This is a valid COLOROP only.
/* This can do either diffuse or specular bump mapping with correct input.
* Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B)
* where each component has been scaled and offset to make it signed.
* The result is replicated into all four (including alpha) channels.
* This is a valid COLOROP only.
*/
D3DTOP_DOTPRODUCT3 = 24,
/* Triadic ops */
D3DTOP_MULTIPLYADD = 25, /* Arg0 + Arg1*Arg2 */
D3DTOP_LERP = 26, /* (Arg0)*Arg1 + (1-Arg0)*Arg2 */
D3DTOP_FORCE_DWORD = 0x7fffffff,
D3DTOP_FORCE_DWORD = 0x7fffffff
} D3DTEXTUREOP;
/*
@ -650,7 +651,7 @@ typedef enum _D3DTEXTUREFILTERTYPE
#define D3DPV_DONOTCOPYDATA (1 << 0)
//-------------------------------------------------------------------
/*------------------------------------------------------------------- */
/* Flexible vertex format bits */
#define D3DFVF_RESERVED0 0x001
@ -696,19 +697,19 @@ typedef enum _D3DTEXTUREFILTERTYPE
typedef enum _D3DDECLUSAGE
{
D3DDECLUSAGE_POSITION = 0,
D3DDECLUSAGE_BLENDWEIGHT, // 1
D3DDECLUSAGE_BLENDINDICES, // 2
D3DDECLUSAGE_NORMAL, // 3
D3DDECLUSAGE_PSIZE, // 4
D3DDECLUSAGE_TEXCOORD, // 5
D3DDECLUSAGE_TANGENT, // 6
D3DDECLUSAGE_BINORMAL, // 7
D3DDECLUSAGE_TESSFACTOR, // 8
D3DDECLUSAGE_POSITIONT, // 9
D3DDECLUSAGE_COLOR, // 10
D3DDECLUSAGE_FOG, // 11
D3DDECLUSAGE_DEPTH, // 12
D3DDECLUSAGE_SAMPLE // 13
D3DDECLUSAGE_BLENDWEIGHT, /* 1 */
D3DDECLUSAGE_BLENDINDICES, /* 2 */
D3DDECLUSAGE_NORMAL, /* 3 */
D3DDECLUSAGE_PSIZE, /* 4 */
D3DDECLUSAGE_TEXCOORD, /* 5 */
D3DDECLUSAGE_TANGENT, /* 6 */
D3DDECLUSAGE_BINORMAL, /* 7 */
D3DDECLUSAGE_TESSFACTOR, /* 8 */
D3DDECLUSAGE_POSITIONT, /* 9 */
D3DDECLUSAGE_COLOR, /* 10 */
D3DDECLUSAGE_FOG, /* 11 */
D3DDECLUSAGE_DEPTH, /* 12 */
D3DDECLUSAGE_SAMPLE /* 13 */
} D3DDECLUSAGE;
#define MAXD3DDECLUSAGE D3DDECLUSAGE_SAMPLE
@ -731,28 +732,28 @@ typedef enum _D3DDECLMETHOD
/* Declarations for _Type fields */
typedef enum _D3DDECLTYPE
{
D3DDECLTYPE_FLOAT1 = 0, // 1D float expanded to (value, 0., 0., 1.)
D3DDECLTYPE_FLOAT2 = 1, // 2D float expanded to (value, value, 0., 1.)
D3DDECLTYPE_FLOAT3 = 2, // 3D float expanded to (value, value, value, 1.)
D3DDECLTYPE_FLOAT4 = 3, // 4D float
D3DDECLTYPE_D3DCOLOR = 4, // 4D packed unsigned bytes mapped to 0. to 1. range
// Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A)
D3DDECLTYPE_UBYTE4 = 5, // 4D unsigned byte
D3DDECLTYPE_SHORT2 = 6, // 2D signed short expanded to (value, value, 0., 1.)
D3DDECLTYPE_SHORT4 = 7, // 4D signed short
D3DDECLTYPE_FLOAT1 = 0, /* 1D float expanded to (value, 0., 0., 1.) */
D3DDECLTYPE_FLOAT2 = 1, /* 2D float expanded to (value, value, 0., 1.) */
D3DDECLTYPE_FLOAT3 = 2, /* 3D float expanded to (value, value, value, 1.) */
D3DDECLTYPE_FLOAT4 = 3, /* 4D float */
D3DDECLTYPE_D3DCOLOR = 4, /* 4D packed unsigned bytes mapped to 0. to 1. range */
/* Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A) */
D3DDECLTYPE_UBYTE4 = 5, /* 4D unsigned byte */
D3DDECLTYPE_SHORT2 = 6, /* 2D signed short expanded to (value, value, 0., 1.) */
D3DDECLTYPE_SHORT4 = 7, /* 4D signed short */
/* The following types are valid only with vertex shaders >= 2.0 */
D3DDECLTYPE_UBYTE4N = 8, // Each of 4 bytes is normalized by dividing to 255.0
D3DDECLTYPE_SHORT2N = 9, // 2D signed short normalized (v[0]/32767.0,v[1]/32767.0,0,1)
D3DDECLTYPE_SHORT4N = 10, // 4D signed short normalized (v[0]/32767.0,v[1]/32767.0,v[2]/32767.0,v[3]/32767.0)
D3DDECLTYPE_USHORT2N = 11, // 2D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,0,1)
D3DDECLTYPE_USHORT4N = 12, // 4D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,v[2]/65535.0,v[3]/65535.0)
D3DDECLTYPE_UDEC3 = 13, // 3D unsigned 10 10 10 format expanded to (value, value, value, 1)
D3DDECLTYPE_DEC3N = 14, // 3D signed 10 10 10 format normalized and expanded to (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1)
D3DDECLTYPE_FLOAT16_2 = 15, // Two 16-bit floating point values, expanded to (value, value, 0, 1)
D3DDECLTYPE_FLOAT16_4 = 16, // Four 16-bit floating point values
D3DDECLTYPE_UNUSED = 17 // When the type field in a decl is unused.
D3DDECLTYPE_UBYTE4N = 8, /* Each of 4 bytes is normalized by dividing to 255.0 */
D3DDECLTYPE_SHORT2N = 9, /* 2D signed short normalized (v[0]/32767.0,v[1]/32767.0,0,1) */
D3DDECLTYPE_SHORT4N = 10, /* 4D signed short normalized (v[0]/32767.0,v[1]/32767.0,v[2]/32767.0,v[3]/32767.0) */
D3DDECLTYPE_USHORT2N = 11, /* 2D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,0,1) */
D3DDECLTYPE_USHORT4N = 12, /* 4D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,v[2]/65535.0,v[3]/65535.0) */
D3DDECLTYPE_UDEC3 = 13, /* 3D unsigned 10 10 10 format expanded to (value, value, value, 1) */
D3DDECLTYPE_DEC3N = 14, /* 3D signed 10 10 10 format normalized and expanded to (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1) */
D3DDECLTYPE_FLOAT16_2 = 15, /* Two 16-bit floating point values, expanded to (value, value, 0, 1) */
D3DDECLTYPE_FLOAT16_4 = 16, /* Four 16-bit floating point values */
D3DDECLTYPE_UNUSED = 17 /* When the type field in a decl is unused. */
} D3DDECLTYPE;
#define MAXD3DDECLTYPE D3DDECLTYPE_UNUSED
@ -774,20 +775,22 @@ typedef struct _D3DVERTEXELEMENT9
/* Maximum supported number of texture coordinate sets */
#define D3DDP_MAXTEXCOORD 8
//---------------------------------------------------------------------
// Values for IDirect3DDevice9::SetStreamSourceFreq's Setting parameter
//---------------------------------------------------------------------
/*---------------------------------------------------------------------
* Values for IDirect3DDevice9::SetStreamSourceFreq's Setting parameter
*---------------------------------------------------------------------
*/
#define D3DSTREAMSOURCE_INDEXEDDATA (1<<30)
#define D3DSTREAMSOURCE_INSTANCEDATA (2<<30)
//---------------------------------------------------------------------
//
// The internal format of Pixel Shader (PS) & Vertex Shader (VS)
// Instruction Tokens is defined in the Direct3D Device Driver Kit
//
//---------------------------------------------------------------------
/*---------------------------------------------------------------------
*
* The internal format of Pixel Shader (PS) & Vertex Shader (VS)
* Instruction Tokens is defined in the Direct3D Device Driver Kit
*
*---------------------------------------------------------------------
*/
/* Instruction Token Bit Definitions */
#define D3DSI_OPCODE_MASK 0x0000FFFF
@ -888,100 +891,101 @@ typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE
D3DSIO_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DSHADER_INSTRUCTION_OPCODE_TYPE;
//---------------------------------------------------------------------
// Use these constants with D3DSIO_SINCOS macro as SRC2, SRC3
//
/*---------------------------------------------------------------------
* Use these constants with D3DSIO_SINCOS macro as SRC2, SRC3
*/
#define D3DSINCOSCONST1 -1.5500992e-006f, -2.1701389e-005f, 0.0026041667f, 0.00026041668f
#define D3DSINCOSCONST2 -0.020833334f, -0.12500000f, 1.0f, 0.50000000f
//---------------------------------------------------------------------
// Co-Issue Instruction Modifier - if set then this instruction is to be
// issued in parallel with the previous instruction(s) for which this bit
// is not set.
//
/*---------------------------------------------------------------------
* Co-Issue Instruction Modifier - if set then this instruction is to be
* issued in parallel with the previous instruction(s) for which this bit
* is not set.
*/
#define D3DSI_COISSUE 0x40000000
//---------------------------------------------------------------------
// Opcode specific controls
/*---------------------------------------------------------------------
* Opcode specific controls
*/
#define D3DSP_OPCODESPECIFICCONTROL_MASK 0x00ff0000
#define D3DSP_OPCODESPECIFICCONTROL_SHIFT 16
// ps_2_0 texld controls
/* ps_2_0 texld controls */
#define D3DSI_TEXLD_PROJECT (0x01 << D3DSP_OPCODESPECIFICCONTROL_SHIFT)
#define D3DSI_TEXLD_BIAS (0x02 << D3DSP_OPCODESPECIFICCONTROL_SHIFT)
// Comparison for dynamic conditional instruction opcodes (i.e. if, breakc)
/* Comparison for dynamic conditional instruction opcodes (i.e. if, breakc) */
typedef enum _D3DSHADER_COMPARISON
{
// < = >
D3DSPC_RESERVED0= 0, // 0 0 0
D3DSPC_GT = 1, // 0 0 1
D3DSPC_EQ = 2, // 0 1 0
D3DSPC_GE = 3, // 0 1 1
D3DSPC_LT = 4, // 1 0 0
D3DSPC_NE = 5, // 1 0 1
D3DSPC_LE = 6, // 1 1 0
D3DSPC_RESERVED1= 7 // 1 1 1
/* < = > */
D3DSPC_RESERVED0= 0, /* 0 0 0 */
D3DSPC_GT = 1, /* 0 0 1 */
D3DSPC_EQ = 2, /* 0 1 0 */
D3DSPC_GE = 3, /* 0 1 1 */
D3DSPC_LT = 4, /* 1 0 0 */
D3DSPC_NE = 5, /* 1 0 1 */
D3DSPC_LE = 6, /* 1 1 0 */
D3DSPC_RESERVED1= 7 /* 1 1 1 */
} D3DSHADER_COMPARISON;
// Comparison is part of instruction opcode token:
/* Comparison is part of instruction opcode token: */
#define D3DSHADER_COMPARISON_SHIFT D3DSP_OPCODESPECIFICCONTROL_SHIFT
#define D3DSHADER_COMPARISON_MASK (0x7<<D3DSHADER_COMPARISON_SHIFT)
//---------------------------------------------------------------------
// Predication flags on instruction token
/*---------------------------------------------------------------------
* Predication flags on instruction token */
#define D3DSHADER_INSTRUCTION_PREDICATED (0x1 << 28)
//---------------------------------------------------------------------
// DCL Info Token Controls
/*---------------------------------------------------------------------
* DCL Info Token Controls */
// For dcl info tokens requiring a semantic (usage + index)
/* For dcl info tokens requiring a semantic (usage + index) */
#define D3DSP_DCL_USAGE_SHIFT 0
#define D3DSP_DCL_USAGE_MASK 0x0000000f
#define D3DSP_DCL_USAGEINDEX_SHIFT 16
#define D3DSP_DCL_USAGEINDEX_MASK 0x000f0000
// DCL pixel shader sampler info token.
/* DCL pixel shader sampler info token. */
#define D3DSP_TEXTURETYPE_SHIFT 27
#define D3DSP_TEXTURETYPE_MASK 0x78000000
typedef enum _D3DSAMPLER_TEXTURE_TYPE
{
D3DSTT_UNKNOWN = 0<<D3DSP_TEXTURETYPE_SHIFT, // uninitialized value
D3DSTT_2D = 2<<D3DSP_TEXTURETYPE_SHIFT, // dcl_2d s# (for declaring a 2-D texture)
D3DSTT_CUBE = 3<<D3DSP_TEXTURETYPE_SHIFT, // dcl_cube s# (for declaring a cube texture)
D3DSTT_VOLUME = 4<<D3DSP_TEXTURETYPE_SHIFT, // dcl_volume s# (for declaring a volume texture)
D3DSTT_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
D3DSTT_UNKNOWN = 0<<D3DSP_TEXTURETYPE_SHIFT, /* uninitialized value */
D3DSTT_2D = 2<<D3DSP_TEXTURETYPE_SHIFT, /* dcl_2d s# (for declaring a 2-D texture) */
D3DSTT_CUBE = 3<<D3DSP_TEXTURETYPE_SHIFT, /* dcl_cube s# (for declaring a cube texture) */
D3DSTT_VOLUME = 4<<D3DSP_TEXTURETYPE_SHIFT, /* dcl_volume s# (for declaring a volume texture) */
D3DSTT_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DSAMPLER_TEXTURE_TYPE;
//---------------------------------------------------------------------
// Parameter Token Bit Definitions
//
/*---------------------------------------------------------------------
* Parameter Token Bit Definitions
*/
#define D3DSP_REGNUM_MASK 0x000007FF
/* destination parameter write mask */
#define D3DSP_WRITEMASK_0 0x00010000 // Component 0 (X;Red)
#define D3DSP_WRITEMASK_1 0x00020000 // Component 1 (Y;Green)
#define D3DSP_WRITEMASK_2 0x00040000 // Component 2 (Z;Blue)
#define D3DSP_WRITEMASK_3 0x00080000 // Component 3 (W;Alpha)
#define D3DSP_WRITEMASK_ALL 0x000F0000 // All Components
#define D3DSP_WRITEMASK_0 0x00010000 /* Component 0 (X;Red) */
#define D3DSP_WRITEMASK_1 0x00020000 /* Component 1 (Y;Green) */
#define D3DSP_WRITEMASK_2 0x00040000 /* Component 2 (Z;Blue) */
#define D3DSP_WRITEMASK_3 0x00080000 /* Component 3 (W;Alpha) */
#define D3DSP_WRITEMASK_ALL 0x000F0000 /* All Components */
/* destination parameter modifiers */
#define D3DSP_DSTMOD_SHIFT 20
#define D3DSP_DSTMOD_MASK 0x00F00000
/* Bit masks for destination parameter modifiers */
#define D3DSPDM_NONE (0<<D3DSP_DSTMOD_SHIFT) // nop
#define D3DSPDM_SATURATE (1<<D3DSP_DSTMOD_SHIFT) // clamp to 0. to 1. range
#define D3DSPDM_PARTIALPRECISION (2<<D3DSP_DSTMOD_SHIFT) // Partial precision hint
#define D3DSPDM_MSAMPCENTROID (4<<D3DSP_DSTMOD_SHIFT) // Relevant to multisampling only:
// When the pixel center is not covered, sample
// attribute or compute gradients/LOD
// using multisample "centroid" location.
// "Centroid" is some location within the covered
// region of the pixel.
#define D3DSPDM_NONE (0<<D3DSP_DSTMOD_SHIFT) /* nop */
#define D3DSPDM_SATURATE (1<<D3DSP_DSTMOD_SHIFT) /* clamp to 0. to 1. range */
#define D3DSPDM_PARTIALPRECISION (2<<D3DSP_DSTMOD_SHIFT) /* Partial precision hint */
#define D3DSPDM_MSAMPCENTROID (4<<D3DSP_DSTMOD_SHIFT) /* Relevant to multisampling only: */
/* When the pixel center is not covered, sample */
/* attribute or compute gradients/LOD */
/* using multisample "centroid" location. */
/* "Centroid" is some location within the covered */
/* region of the pixel. */
/* destination parameter */
#define D3DSP_DSTSHIFT_SHIFT 24
@ -995,37 +999,38 @@ typedef enum _D3DSAMPLER_TEXTURE_TYPE
typedef enum _D3DSHADER_PARAM_REGISTER_TYPE
{
D3DSPR_TEMP = 0, // Temporary Register File
D3DSPR_INPUT = 1, // Input Register File
D3DSPR_CONST = 2, // Constant Register File
D3DSPR_ADDR = 3, // Address Register (VS)
D3DSPR_TEXTURE = 3, // Texture Register File (PS)
D3DSPR_RASTOUT = 4, // Rasterizer Register File
D3DSPR_ATTROUT = 5, // Attribute Output Register File
D3DSPR_TEXCRDOUT = 6, // Texture Coordinate Output Register File
D3DSPR_OUTPUT = 6, // Output register file for VS3.0+
D3DSPR_CONSTINT = 7, // Constant Integer Vector Register File
D3DSPR_COLOROUT = 8, // Color Output Register File
D3DSPR_DEPTHOUT = 9, // Depth Output Register File
D3DSPR_SAMPLER = 10, // Sampler State Register File
D3DSPR_CONST2 = 11, // Constant Register File 2048 - 4095
D3DSPR_CONST3 = 12, // Constant Register File 4096 - 6143
D3DSPR_CONST4 = 13, // Constant Register File 6144 - 8191
D3DSPR_CONSTBOOL = 14, // Constant Boolean register file
D3DSPR_LOOP = 15, // Loop counter register file
D3DSPR_TEMPFLOAT16 = 16, // 16-bit float temp register file
D3DSPR_MISCTYPE = 17, // Miscellaneous (single) registers.
D3DSPR_LABEL = 18, // Label
D3DSPR_PREDICATE = 19, // Predicate register
D3DSPR_FORCE_DWORD = 0x7fffffff // force 32-bit size enum
D3DSPR_TEMP = 0, /* Temporary Register File */
D3DSPR_INPUT = 1, /* Input Register File */
D3DSPR_CONST = 2, /* Constant Register File */
D3DSPR_ADDR = 3, /* Address Register (VS) */
D3DSPR_TEXTURE = 3, /* Texture Register File (PS) */
D3DSPR_RASTOUT = 4, /* Rasterizer Register File */
D3DSPR_ATTROUT = 5, /* Attribute Output Register File */
D3DSPR_TEXCRDOUT = 6, /* Texture Coordinate Output Register File */
D3DSPR_OUTPUT = 6, /* Output register file for VS3.0+ */
D3DSPR_CONSTINT = 7, /* Constant Integer Vector Register File */
D3DSPR_COLOROUT = 8, /* Color Output Register File */
D3DSPR_DEPTHOUT = 9, /* Depth Output Register File */
D3DSPR_SAMPLER = 10, /* Sampler State Register File */
D3DSPR_CONST2 = 11, /* Constant Register File 2048 - 4095 */
D3DSPR_CONST3 = 12, /* Constant Register File 4096 - 6143 */
D3DSPR_CONST4 = 13, /* Constant Register File 6144 - 8191 */
D3DSPR_CONSTBOOL = 14, /* Constant Boolean register file */
D3DSPR_LOOP = 15, /* Loop counter register file */
D3DSPR_TEMPFLOAT16 = 16, /* 16-bit float temp register file */
D3DSPR_MISCTYPE = 17, /* Miscellaneous (single) registers. */
D3DSPR_LABEL = 18, /* Label */
D3DSPR_PREDICATE = 19, /* Predicate register */
D3DSPR_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DSHADER_PARAM_REGISTER_TYPE;
// The miscellaneous register file (D3DSPR_MISCTYPES)
// contains register types for which there is only ever one
// register (i.e. the register # is not needed).
// Rather than use up additional register types for such
// registers, they are defined
// as particular offsets into the misc. register file:
/* The miscellaneous register file (D3DSPR_MISCTYPES)
* contains register types for which there is only ever one
* register (i.e. the register # is not needed).
* Rather than use up additional register types for such
* registers, they are defined
* as particular offsets into the misc. register file:
*/
typedef enum _D3DSHADER_MISCTYPE_OFFSETS
{
@ -1064,33 +1069,32 @@ typedef enum _D3DSHADER_ADDRESSMODE_TYPE
D3DSHADER_ADDRMODE_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DSHADER_ADDRESSMODE_TYPE;
// Source operand swizzle definitions
//
/* Source operand swizzle definitions */
#define D3DVS_SWIZZLE_SHIFT 16
#define D3DVS_SWIZZLE_MASK 0x00FF0000
// The following bits define where to take component X from:
/* The following bits define where to take component X from: */
#define D3DVS_X_X (0 << D3DVS_SWIZZLE_SHIFT)
#define D3DVS_X_Y (1 << D3DVS_SWIZZLE_SHIFT)
#define D3DVS_X_Z (2 << D3DVS_SWIZZLE_SHIFT)
#define D3DVS_X_W (3 << D3DVS_SWIZZLE_SHIFT)
// The following bits define where to take component Y from:
/* The following bits define where to take component Y from: */
#define D3DVS_Y_X (0 << (D3DVS_SWIZZLE_SHIFT + 2))
#define D3DVS_Y_Y (1 << (D3DVS_SWIZZLE_SHIFT + 2))
#define D3DVS_Y_Z (2 << (D3DVS_SWIZZLE_SHIFT + 2))
#define D3DVS_Y_W (3 << (D3DVS_SWIZZLE_SHIFT + 2))
// The following bits define where to take component Z from:
/* The following bits define where to take component Z from: */
#define D3DVS_Z_X (0 << (D3DVS_SWIZZLE_SHIFT + 4))
#define D3DVS_Z_Y (1 << (D3DVS_SWIZZLE_SHIFT + 4))
#define D3DVS_Z_Z (2 << (D3DVS_SWIZZLE_SHIFT + 4))
#define D3DVS_Z_W (3 << (D3DVS_SWIZZLE_SHIFT + 4))
// The following bits define where to take component W from:
/* The following bits define where to take component W from: */
#define D3DVS_W_X (0 << (D3DVS_SWIZZLE_SHIFT + 6))
#define D3DVS_W_Y (1 << (D3DVS_SWIZZLE_SHIFT + 6))
@ -1137,31 +1141,32 @@ typedef enum _D3DSHADER_ADDRESSMODE_TYPE
(3 << (D3DSP_SWIZZLE_SHIFT + 4)) | \
(3 << (D3DSP_SWIZZLE_SHIFT + 6)) )
// source parameter modifiers
/* source parameter modifiers */
#define D3DSP_SRCMOD_SHIFT 24
#define D3DSP_SRCMOD_MASK 0x0F000000
typedef enum _D3DSHADER_PARAM_SRCMOD_TYPE
{
D3DSPSM_NONE = 0<<D3DSP_SRCMOD_SHIFT, // NOP
D3DSPSM_NEG = 1<<D3DSP_SRCMOD_SHIFT, // negate
D3DSPSM_BIAS = 2<<D3DSP_SRCMOD_SHIFT, // bias
D3DSPSM_BIASNEG = 3<<D3DSP_SRCMOD_SHIFT, // bias and negate
D3DSPSM_SIGN = 4<<D3DSP_SRCMOD_SHIFT, // sign
D3DSPSM_SIGNNEG = 5<<D3DSP_SRCMOD_SHIFT, // sign and negate
D3DSPSM_COMP = 6<<D3DSP_SRCMOD_SHIFT, // complement
D3DSPSM_X2 = 7<<D3DSP_SRCMOD_SHIFT, // *2
D3DSPSM_X2NEG = 8<<D3DSP_SRCMOD_SHIFT, // *2 and negate
D3DSPSM_DZ = 9<<D3DSP_SRCMOD_SHIFT, // divide through by z component
D3DSPSM_DW = 10<<D3DSP_SRCMOD_SHIFT, // divide through by w component
D3DSPSM_ABS = 11<<D3DSP_SRCMOD_SHIFT, // abs()
D3DSPSM_ABSNEG = 12<<D3DSP_SRCMOD_SHIFT, // -abs()
D3DSPSM_NOT = 13<<D3DSP_SRCMOD_SHIFT, // for predicate register: "!p0"
D3DSPSM_FORCE_DWORD = 0x7fffffff // force 32-bit size enum
D3DSPSM_NONE = 0<<D3DSP_SRCMOD_SHIFT, /* NOP */
D3DSPSM_NEG = 1<<D3DSP_SRCMOD_SHIFT, /* negate */
D3DSPSM_BIAS = 2<<D3DSP_SRCMOD_SHIFT, /* bias */
D3DSPSM_BIASNEG = 3<<D3DSP_SRCMOD_SHIFT, /* bias and negate */
D3DSPSM_SIGN = 4<<D3DSP_SRCMOD_SHIFT, /* sign */
D3DSPSM_SIGNNEG = 5<<D3DSP_SRCMOD_SHIFT, /* sign and negate */
D3DSPSM_COMP = 6<<D3DSP_SRCMOD_SHIFT, /* complement */
D3DSPSM_X2 = 7<<D3DSP_SRCMOD_SHIFT, /* *2 */
D3DSPSM_X2NEG = 8<<D3DSP_SRCMOD_SHIFT, /* *2 and negate */
D3DSPSM_DZ = 9<<D3DSP_SRCMOD_SHIFT, /* divide through by z component */
D3DSPSM_DW = 10<<D3DSP_SRCMOD_SHIFT, /* divide through by w component */
D3DSPSM_ABS = 11<<D3DSP_SRCMOD_SHIFT, /* abs() */
D3DSPSM_ABSNEG = 12<<D3DSP_SRCMOD_SHIFT, /* -abs() */
D3DSPSM_NOT = 13<<D3DSP_SRCMOD_SHIFT, /* for predicate register: "!p0" */
D3DSPSM_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DSHADER_PARAM_SRCMOD_TYPE;
// Source or dest token bits [15:14]:
// destination parameter modifiers
/* Source or dest token bits [15:14]:
* destination parameter modifiers
*/
#define D3DSP_MIN_PRECISION_SHIFT 14
#define D3DSP_MIN_PRECISION_MASK 0x0000C000
@ -1171,35 +1176,35 @@ typedef enum _D3DSHADER_MIN_PRECISION
D3DMP_16 = 1, /* 16 bit per component */
D3DMP_2_8 = 2 /* 10 bits (2.8) per component */
} D3DSHADER_MIN_PRECISION;
// If the older D3DSPDM_PARTIALPRECISION is set,
// that is equivalent to the whole operation specifying
// D3DMP_16 (on all operands). The two encodings are not
// used together however.
/* If the older D3DSPDM_PARTIALPRECISION is set,
* that is equivalent to the whole operation specifying
* D3DMP_16 (on all operands). The two encodings are not
* used together however.
*/
// pixel shader version token
/* pixel shader version token */
#define D3DPS_VERSION(_Major,_Minor) (0xFFFF0000|((_Major)<<8)|(_Minor))
// vertex shader version token
/* vertex shader version token */
#define D3DVS_VERSION(_Major,_Minor) (0xFFFE0000|((_Major)<<8)|(_Minor))
// extract major/minor from version cap
/* extract major/minor from version cap */
#define D3DSHADER_VERSION_MAJOR(_Version) (((_Version)>>8)&0xFF)
#define D3DSHADER_VERSION_MINOR(_Version) (((_Version)>>0)&0xFF)
// destination/source parameter register type
/* destination/source parameter register type */
#define D3DSI_COMMENTSIZE_SHIFT 16
#define D3DSI_COMMENTSIZE_MASK 0x7FFF0000
#define D3DSHADER_COMMENT(_DWordSize) \
((((_DWordSize)<<D3DSI_COMMENTSIZE_SHIFT)&D3DSI_COMMENTSIZE_MASK)|D3DSIO_COMMENT)
// pixel/vertex shader end token
/* pixel/vertex shader end token */
#define D3DPS_END() 0x0000FFFF
#define D3DVS_END() 0x0000FFFF
//---------------------------------------------------------------------
/*--------------------------------------------------------------------- */
/* High order surfaces */
typedef enum _D3DBASISTYPE
@ -1452,7 +1457,7 @@ typedef enum _D3DFORMAT
/* Binary format indicating that the data has no inherent type */
D3DFMT_BINARYBUFFER = 199,
#endif // !D3D_DISABLE_9EX
#endif /* !D3D_DISABLE_9EX */
/* -- D3D9Ex only */
@ -1489,7 +1494,7 @@ typedef enum _D3DSWAPEFFECT
#if !defined(D3D_DISABLE_9EX)
D3DSWAPEFFECT_OVERLAY = 4,
D3DSWAPEFFECT_FLIPEX = 5,
#endif // !D3D_DISABLE_9EX
#endif /* !D3D_DISABLE_9EX */
/* -- D3D9Ex only */
D3DSWAPEFFECT_FORCE_DWORD = 0x7fffffff
@ -1844,7 +1849,7 @@ typedef enum _D3DQUERYTYPE {
D3DQUERYTYPE_CACHEUTILIZATION = 18, /* D3DISSUE_BEGIN, D3DISSUE_END */
/* D3D9Ex only -- */
#if !defined(D3D_DISABLE_9EX)
D3DQUERYTYPE_MEMORYPRESSURE = 19, /* D3DISSUE_BEGIN, D3DISSUE_END */
D3DQUERYTYPE_MEMORYPRESSURE = 19 /* D3DISSUE_BEGIN, D3DISSUE_END */
#endif /* !D3D_DISABLE_9EX */
} D3DQUERYTYPE;
@ -1951,7 +1956,7 @@ typedef enum _D3DCOMPOSERECTSOP{
D3DCOMPOSERECTS_OR = 2,
D3DCOMPOSERECTS_AND = 3,
D3DCOMPOSERECTS_NEG = 4,
D3DCOMPOSERECTS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DCOMPOSERECTS_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DCOMPOSERECTSOP;
typedef struct _D3DCOMPOSERECTDESC
@ -1986,7 +1991,7 @@ typedef enum D3DSCANLINEORDERING
{
D3DSCANLINEORDERING_UNKNOWN = 0,
D3DSCANLINEORDERING_PROGRESSIVE = 1,
D3DSCANLINEORDERING_INTERLACED = 2,
D3DSCANLINEORDERING_INTERLACED = 2
} D3DSCANLINEORDERING;
@ -2034,7 +2039,7 @@ typedef enum _D3DAUTHENTICATEDCHANNELTYPE
{
D3DAUTHENTICATEDCHANNEL_D3D9 = 1,
D3DAUTHENTICATEDCHANNEL_DRIVER_SOFTWARE = 2,
D3DAUTHENTICATEDCHANNEL_DRIVER_HARDWARE = 3,
D3DAUTHENTICATEDCHANNEL_DRIVER_HARDWARE = 3
} D3DAUTHENTICATEDCHANNELTYPE;
typedef struct _D3DAUTHENTICATEDCHANNEL_QUERY_INPUT
@ -2242,7 +2247,7 @@ typedef enum _D3DBUSTYPE
D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET = 0x00030000,
D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR = 0x00040000,
D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE = 0x00050000,
D3DBUSIMPL_MODIFIER_NON_STANDARD = 0x80000000,
D3DBUSIMPL_MODIFIER_NON_STANDARD = 0x80000000
} D3DBUSTYPE;
typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYINFOBUSTYPE_OUTPUT