2 * Copyright (C) 2002-2003 Jason Edmeades
3 * Copyright (C) 2002-2003 Raphael Junqueira
4 * Copyright (C) 2005 Oliver Stieber
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_D3D9TYPES_H
22 #define __WINE_D3D9TYPES_H
28 /*****************************************************************************
29 * Direct 3D v9 #defines
31 #define D3DCLEAR_TARGET __MSABI_LONG(0x00000001)
32 #define D3DCLEAR_ZBUFFER __MSABI_LONG(0x00000002)
33 #define D3DCLEAR_STENCIL __MSABI_LONG(0x00000004)
35 #define D3DCLIPPLANE0 (1 << 0)
36 #define D3DCLIPPLANE1 (1 << 1)
37 #define D3DCLIPPLANE2 (1 << 2)
38 #define D3DCLIPPLANE3 (1 << 3)
39 #define D3DCLIPPLANE4 (1 << 4)
40 #define D3DCLIPPLANE5 (1 << 5)
42 #define D3DCOLOR_ARGB(a,r,g,b) ((D3DCOLOR)((((a)&0xffu)<<24)|(((r)&0xffu)<<16)|(((g)&0xffu)<<8)|((b)&0xffu)))
43 #define D3DCOLOR_COLORVALUE(r,g,b,a) D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f))
44 #define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b)
45 #define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b)
46 #define D3DCOLOR_XYUV(y,u,v) D3DCOLOR_ARGB(0xFF,y,u,v)
47 #define D3DCOLOR_AYUV(a,y,u,v) D3DCOLOR_ARGB(a,y,u,v)
49 #define D3DCS_LEFT __MSABI_LONG(0x001)
50 #define D3DCS_RIGHT __MSABI_LONG(0x002)
51 #define D3DCS_TOP __MSABI_LONG(0x004)
52 #define D3DCS_BOTTOM __MSABI_LONG(0x008)
53 #define D3DCS_FRONT __MSABI_LONG(0x010)
54 #define D3DCS_BACK __MSABI_LONG(0x020)
55 #define D3DCS_PLANE0 __MSABI_LONG(0x040)
56 #define D3DCS_PLANE1 __MSABI_LONG(0x080)
57 #define D3DCS_PLANE2 __MSABI_LONG(0x100)
58 #define D3DCS_PLANE3 __MSABI_LONG(0x200)
59 #define D3DCS_PLANE4 __MSABI_LONG(0x400)
60 #define D3DCS_PLANE5 __MSABI_LONG(0x800)
61 #define D3DCS_ALL __MSABI_LONG(0xFFF)
63 #define D3DFVF_TEXTUREFORMAT1 3u
64 #define D3DFVF_TEXTUREFORMAT2 0u
65 #define D3DFVF_TEXTUREFORMAT3 1u
66 #define D3DFVF_TEXTUREFORMAT4 2u
67 #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
68 #define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2)
69 #define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
70 #define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
72 #define D3DLOCK_READONLY 0x0010
73 #define D3DLOCK_NOSYSLOCK 0x0800
74 #define D3DLOCK_NOOVERWRITE 0x1000
75 #define D3DLOCK_DISCARD 0x2000
76 #define D3DLOCK_DONOTWAIT 0x4000
77 #define D3DLOCK_NO_DIRTY_UPDATE 0x8000
79 #define D3DMAXUSERCLIPPLANES 32
80 #define D3DCLIPPLANE0 (1 << 0)
81 #define D3DCLIPPLANE1 (1 << 1)
82 #define D3DCLIPPLANE2 (1 << 2)
83 #define D3DCLIPPLANE3 (1 << 3)
84 #define D3DCLIPPLANE4 (1 << 4)
85 #define D3DCLIPPLANE5 (1 << 5)
88 #define D3DRENDERSTATE_WRAPBIAS __MSABI_LONG(128U)
90 /* MSDN has this in d3d9caps.h, but it should be here */
91 #define D3DTSS_TCI_PASSTHRU 0x00000
92 #define D3DTSS_TCI_CAMERASPACENORMAL 0x10000
93 #define D3DTSS_TCI_CAMERASPACEPOSITION 0x20000
94 #define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x30000
95 #define D3DTSS_TCI_SPHEREMAP 0x40000
98 #define D3DTS_WORLD D3DTS_WORLDMATRIX(0)
99 #define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1)
100 #define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2)
101 #define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3)
102 #define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256)
104 #define D3DUSAGE_RENDERTARGET __MSABI_LONG(0x00000001)
105 #define D3DUSAGE_DEPTHSTENCIL __MSABI_LONG(0x00000002)
106 #define D3DUSAGE_WRITEONLY __MSABI_LONG(0x00000008)
107 #define D3DUSAGE_SOFTWAREPROCESSING __MSABI_LONG(0x00000010)
108 #define D3DUSAGE_DONOTCLIP __MSABI_LONG(0x00000020)
109 #define D3DUSAGE_POINTS __MSABI_LONG(0x00000040)
110 #define D3DUSAGE_RTPATCHES __MSABI_LONG(0x00000080)
111 #define D3DUSAGE_NPATCHES __MSABI_LONG(0x00000100)
112 #define D3DUSAGE_DYNAMIC __MSABI_LONG(0x00000200)
113 #define D3DUSAGE_AUTOGENMIPMAP __MSABI_LONG(0x00000400)
114 #define D3DUSAGE_DMAP __MSABI_LONG(0x00004000)
116 /* Parts added with d3d9ex */
117 #if !defined(D3D_DISABLE_9EX)
118 #define D3DUSAGE_RESTRICTED_CONTENT __MSABI_LONG(0x00000800)
119 #define D3DUSAGE_RESTRICT_SHARED_RESOURCE_DRIVER __MSABI_LONG(0x00001000)
120 #define D3DUSAGE_RESTRICT_SHARED_RESOURCE __MSABI_LONG(0x00002000)
121 #define D3DUSAGE_TEXTAPI __MSABI_LONG(0x10000000)
122 #endif /* D3D_DISABLE_9EX */
124 #define D3DUSAGE_QUERY_FILTER __MSABI_LONG(0x00020000)
125 #define D3DUSAGE_QUERY_LEGACYBUMPMAP __MSABI_LONG(0x00008000)
126 #define D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING __MSABI_LONG(0x00080000)
127 #define D3DUSAGE_QUERY_SRGBREAD __MSABI_LONG(0x00010000)
128 #define D3DUSAGE_QUERY_SRGBWRITE __MSABI_LONG(0x00040000)
129 #define D3DUSAGE_QUERY_VERTEXTEXTURE __MSABI_LONG(0x00100000)
130 #define D3DUSAGE_QUERY_WRAPANDMIP __MSABI_LONG(0x00200000)
135 #define D3DWRAPCOORD_0 1
136 #define D3DWRAPCOORD_1 2
137 #define D3DWRAPCOORD_2 4
138 #define D3DWRAPCOORD_3 8
140 #define MAX_DEVICE_IDENTIFIER_STRING 512
142 #define D3DFVF_RESERVED0 0x0001
143 #define D3DFVF_POSITION_MASK 0x400E
144 #define D3DFVF_XYZ 0x0002
145 #define D3DFVF_XYZRHW 0x0004
146 #define D3DFVF_XYZB1 0x0006
147 #define D3DFVF_XYZB2 0x0008
148 #define D3DFVF_XYZB3 0x000a
149 #define D3DFVF_XYZB4 0x000c
150 #define D3DFVF_XYZB5 0x000e
151 #define D3DFVF_XYZW 0x4002
152 #define D3DFVF_NORMAL 0x0010
153 #define D3DFVF_PSIZE 0x0020
154 #define D3DFVF_DIFFUSE 0x0040
155 #define D3DFVF_SPECULAR 0x0080
156 #define D3DFVF_TEXCOUNT_MASK 0x0f00
157 #define D3DFVF_TEXCOUNT_SHIFT 8
158 #define D3DFVF_TEX0 0x0000
159 #define D3DFVF_TEX1 0x0100
160 #define D3DFVF_TEX2 0x0200
161 #define D3DFVF_TEX3 0x0300
162 #define D3DFVF_TEX4 0x0400
163 #define D3DFVF_TEX5 0x0500
164 #define D3DFVF_TEX6 0x0600
165 #define D3DFVF_TEX7 0x0700
166 #define D3DFVF_TEX8 0x0800
167 #define D3DFVF_LASTBETA_UBYTE4 0x1000
168 #define D3DFVF_LASTBETA_D3DCOLOR 0x8000
169 #define D3DFVF_RESERVED2 0x6000
171 #define D3DTA_SELECTMASK 0x0000000f
172 #define D3DTA_DIFFUSE 0x00000000
173 #define D3DTA_CURRENT 0x00000001
174 #define D3DTA_TEXTURE 0x00000002
175 #define D3DTA_TFACTOR 0x00000003
176 #define D3DTA_SPECULAR 0x00000004
177 #define D3DTA_TEMP 0x00000005
178 #define D3DTA_CONSTANT 0x00000006
179 #define D3DTA_COMPLEMENT 0x00000010
180 #define D3DTA_ALPHAREPLICATE 0x00000020
182 #define D3DCOLORWRITEENABLE_RED (__MSABI_LONG(1)<<0)
183 #define D3DCOLORWRITEENABLE_GREEN (__MSABI_LONG(1)<<1)
184 #define D3DCOLORWRITEENABLE_BLUE (__MSABI_LONG(1)<<2)
185 #define D3DCOLORWRITEENABLE_ALPHA (__MSABI_LONG(1)<<3)
187 #define D3DPV_DONOTCOPYDATA (1 << 0)
189 #define D3DSTREAMSOURCE_INDEXEDDATA (1u << 30)
190 #define D3DSTREAMSOURCE_INSTANCEDATA (2u << 30)
192 #define D3D_MAX_SIMULTANEOUS_RENDERTARGETS 4
194 #define MAXD3DDECLLENGTH 64 /* +end marker */
195 #define MAXD3DDECLMETHOD D3DDECLMETHOD_LOOKUPPRESAMPLED
196 #define MAXD3DDECLTYPE D3DDECLTYPE_UNUSED
197 #define MAXD3DDECLUSAGE D3DDECLUSAGE_SAMPLE
198 #define MAXD3DDECLUSAGEINDEX 15
200 #define D3DDMAPSAMPLER 256
201 #define D3DVERTEXTEXTURESAMPLER0 (D3DDMAPSAMPLER+1)
202 #define D3DVERTEXTEXTURESAMPLER1 (D3DDMAPSAMPLER+2)
203 #define D3DVERTEXTEXTURESAMPLER2 (D3DDMAPSAMPLER+3)
204 #define D3DVERTEXTEXTURESAMPLER3 (D3DDMAPSAMPLER+4)
207 #define MAKEFOURCC(ch0, ch1, ch2, ch3) \
208 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
209 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
212 /* Constants used by D3DPRESENT_PARAMETERS. when creating a device or swapchain */
214 #define D3DPRESENTFLAG_LOCKABLE_BACKBUFFER 0x00000001 /* Create a lockable backbuffer */
215 #define D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL 0x00000002 /* Discard Z buffer */
216 #define D3DPRESENTFLAG_DEVICECLIP 0x00000004 /* Clip the window blited into the client area 2k + xp only */
217 #define D3DPRESENTFLAG_VIDEO 0x00000010 /* backbuffer 'may' contain video data */
218 #define D3DPRESENTFLAG_NOAUTOROTATE 0x00000020 /* d3d9ex, ignore display rotation */
219 #define D3DPRESENTFLAG_UNPRUNEDMODE 0x00000040 /* d3d9ex, specify invalid display modes */
221 #define D3DPRESENT_RATE_DEFAULT 0x00000000
223 /****************************
224 * Vertex Shaders Declaration
227 typedef enum _D3DDECLUSAGE
{
228 D3DDECLUSAGE_POSITION
= 0,
229 D3DDECLUSAGE_BLENDWEIGHT
= 1,
230 D3DDECLUSAGE_BLENDINDICES
= 2,
231 D3DDECLUSAGE_NORMAL
= 3,
232 D3DDECLUSAGE_PSIZE
= 4,
233 D3DDECLUSAGE_TEXCOORD
= 5,
234 D3DDECLUSAGE_TANGENT
= 6,
235 D3DDECLUSAGE_BINORMAL
= 7,
236 D3DDECLUSAGE_TESSFACTOR
= 8,
237 D3DDECLUSAGE_POSITIONT
= 9,
238 D3DDECLUSAGE_COLOR
= 10,
239 D3DDECLUSAGE_FOG
= 11,
240 D3DDECLUSAGE_DEPTH
= 12,
241 D3DDECLUSAGE_SAMPLE
= 13
244 #define D3DMAXDECLUSAGE D3DDECLUSAGE_SAMPLE
245 #define D3DMAXDECLUSAGEINDEX 15
246 #define D3DMAXDECLLENGTH 18
247 #define D3DMAXDECLUSAGE_DX8 D3DDECLUSAGE_TEXCOORD
249 typedef enum _D3DDECLMETHOD
{
250 D3DDECLMETHOD_DEFAULT
= 0,
251 D3DDECLMETHOD_PARTIALU
= 1,
252 D3DDECLMETHOD_PARTIALV
= 2,
253 D3DDECLMETHOD_CROSSUV
= 3,
254 D3DDECLMETHOD_UV
= 4,
255 D3DDECLMETHOD_LOOKUP
= 5,
256 D3DDECLMETHOD_LOOKUPPRESAMPLED
= 6
260 #define D3DMAXDECLMETHOD D3DDECLMETHOD_LOOKUPPRESAMPLED
262 typedef enum _D3DDECLTYPE
{
263 D3DDECLTYPE_FLOAT1
= 0,
264 D3DDECLTYPE_FLOAT2
= 1,
265 D3DDECLTYPE_FLOAT3
= 2,
266 D3DDECLTYPE_FLOAT4
= 3,
267 D3DDECLTYPE_D3DCOLOR
= 4,
268 D3DDECLTYPE_UBYTE4
= 5,
269 D3DDECLTYPE_SHORT2
= 6,
270 D3DDECLTYPE_SHORT4
= 7,
272 D3DDECLTYPE_UBYTE4N
= 8,
273 D3DDECLTYPE_SHORT2N
= 9,
274 D3DDECLTYPE_SHORT4N
= 10,
275 D3DDECLTYPE_USHORT2N
= 11,
276 D3DDECLTYPE_USHORT4N
= 12,
277 D3DDECLTYPE_UDEC3
= 13,
278 D3DDECLTYPE_DEC3N
= 14,
279 D3DDECLTYPE_FLOAT16_2
= 15,
280 D3DDECLTYPE_FLOAT16_4
= 16,
281 D3DDECLTYPE_UNUSED
= 17,
284 #define D3DMAXDECLTYPE D3DDECLTYPE_UNUSED
286 typedef struct _D3DVERTEXELEMENT9
{
293 } D3DVERTEXELEMENT9
, *LPD3DVERTEXELEMENT9
;
296 typedef enum _D3DQUERYTYPE
{
297 D3DQUERYTYPE_VCACHE
= 4,
298 D3DQUERYTYPE_RESOURCEMANAGER
= 5,
299 D3DQUERYTYPE_VERTEXSTATS
= 6,
300 D3DQUERYTYPE_EVENT
= 8,
301 D3DQUERYTYPE_OCCLUSION
= 9,
302 D3DQUERYTYPE_TIMESTAMP
= 10,
303 D3DQUERYTYPE_TIMESTAMPDISJOINT
= 11,
304 D3DQUERYTYPE_TIMESTAMPFREQ
= 12,
305 D3DQUERYTYPE_PIPELINETIMINGS
= 13,
306 D3DQUERYTYPE_INTERFACETIMINGS
= 14,
307 D3DQUERYTYPE_VERTEXTIMINGS
= 15,
308 D3DQUERYTYPE_PIXELTIMINGS
= 16,
309 D3DQUERYTYPE_BANDWIDTHTIMINGS
= 17,
310 D3DQUERYTYPE_CACHEUTILIZATION
= 18
313 #define D3DISSUE_BEGIN (1 << 1)
314 #define D3DISSUE_END (1 << 0)
315 #define D3DGETDATA_FLUSH (1 << 0)
318 #define D3DDECL_END() {0xFF,0,D3DDECLTYPE_UNUSED,0,0,0}
319 #define D3DDP_MAXTEXCOORD 8
322 #define D3DVSD_MAKETOKENTYPE(TokenType) \
323 ((TokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK)
325 #define D3DVSD_CONST(ConstantAddress, Count) \
326 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | ((Count) << D3DVSD_CONSTCOUNTSHIFT) | (ConstantAddress))
328 #define D3DVSD_END() 0xFFFFFFFF
330 #define D3DVSD_NOP() 0x00000000
332 #define D3DVSD_REG(VertexRegister, Type) \
333 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | ((Type) << D3DVSD_DATATYPESHIFT) | (VertexRegister))
335 #define D3DVSD_SKIP(Count) \
336 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | ((Count) << D3DVSD_SKIPCOUNTSHIFT))
338 #define D3DVSD_STREAM(StreamNumber) \
339 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (StreamNumber))
341 #define D3DVSD_STREAM_TESS() \
342 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK))
344 #define D3DVSD_TESSNORMAL(RegisterIn, RegisterOut) \
345 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | ((RegisterIn) << D3DVSD_VERTEXREGINSHIFT) | ((0x02) << D3DVSD_DATATYPESHIFT) | (RegisterOut))
347 #define D3DVSD_TESSUV(Register) \
348 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | ((0x01) << D3DVSD_DATATYPESHIFT) | (Register))
351 /********************************
352 * Pixel/Vertex Shaders Functions
355 /** Maximum number of supported texture coordinates sets operation */
356 #define D3DDP_MAXTEXCOORD 8
358 /** opcode token mask */
359 #define D3DSI_OPCODE_MASK 0x0000FFFF
360 #define D3DSI_INSTLENGTH_MASK 0x0F000000
361 #define D3DSI_INSTLENGTH_SHIFT 24
363 /** opcodes types for PS and VS */
364 typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE
{
415 D3DSIO_TEXCOORD
= 64,
420 D3DSIO_TEXREG2AR
= 69,
421 D3DSIO_TEXREG2GB
= 70,
422 D3DSIO_TEXM3x2PAD
= 71,
423 D3DSIO_TEXM3x2TEX
= 72,
424 D3DSIO_TEXM3x3PAD
= 73,
425 D3DSIO_TEXM3x3TEX
= 74,
426 D3DSIO_TEXM3x3DIFF
= 75,
427 D3DSIO_TEXM3x3SPEC
= 76,
428 D3DSIO_TEXM3x3VSPEC
= 77,
433 D3DSIO_TEXREG2RGB
= 82,
434 D3DSIO_TEXDP3TEX
= 83,
435 D3DSIO_TEXM3x2DEPTH
= 84,
438 D3DSIO_TEXDEPTH
= 87,
449 D3DSIO_PHASE
= 0xFFFD,
450 D3DSIO_COMMENT
= 0xFFFE,
453 D3DSIO_FORCE_DWORD
= 0X7FFFFFFF /** for 32-bit alignment */
454 } D3DSHADER_INSTRUCTION_OPCODE_TYPE
;
456 #define D3DSINCOSCONST1 -1.5500992e-006f, -2.1701389e-005f, 0.0026041667f, 0.00026041668f
457 #define D3DSINCOSCONST2 -0.020833334f, -0.12500000f, 1.0f, 0.50000000f
459 #define D3DSHADER_INSTRUCTION_PREDICATED (1 << 28)
461 #define D3DSI_TEXLD_PROJECT 0x00010000
462 #define D3DSI_TEXLD_BIAS 0x00020000
464 /** for parallelism */
465 #define D3DSI_COISSUE 0x40000000
467 #define D3DSP_DCL_USAGE_SHIFT 0
468 #define D3DSP_DCL_USAGE_MASK 0x0000000f
470 #define D3DSP_DCL_USAGEINDEX_SHIFT 16
471 #define D3DSP_DCL_USAGEINDEX_MASK 0x000f0000
473 #define D3DSP_TEXTURETYPE_SHIFT 27
474 #define D3DSP_TEXTURETYPE_MASK 0x78000000
476 typedef enum _D3DSAMPLER_TEXTURE_TYPE
{
477 D3DSTT_UNKNOWN
= 0 << D3DSP_TEXTURETYPE_SHIFT
,
478 D3DSTT_1D
= 1 << D3DSP_TEXTURETYPE_SHIFT
,
479 D3DSTT_2D
= 2 << D3DSP_TEXTURETYPE_SHIFT
,
480 D3DSTT_CUBE
= 3 << D3DSP_TEXTURETYPE_SHIFT
,
481 D3DSTT_VOLUME
= 4 << D3DSP_TEXTURETYPE_SHIFT
,
483 D3DSTT_FORCE_DWORD
= 0x7FFFFFFF
484 } D3DSAMPLER_TEXTURE_TYPE
;
486 #define D3DSP_REGNUM_MASK 0x000007FF
488 /** destination parameter modifiers (.xyzw) */
489 #define D3DSP_WRITEMASK_0 0x00010000 /* .x r */
490 #define D3DSP_WRITEMASK_1 0x00020000 /* .y g */
491 #define D3DSP_WRITEMASK_2 0x00040000 /* .z b */
492 #define D3DSP_WRITEMASK_3 0x00080000 /* .w a */
493 #define D3DSP_WRITEMASK_ALL 0x000F0000 /* all */
495 #define D3DSP_DSTMOD_SHIFT 20
496 #define D3DSP_DSTMOD_MASK (0xF << D3DSP_DSTMOD_SHIFT)
498 typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE
{
499 D3DSPDM_NONE
= 0 << D3DSP_DSTMOD_SHIFT
,
500 D3DSPDM_SATURATE
= 1 << D3DSP_DSTMOD_SHIFT
,
501 D3DSPDM_PARTIALPRECISION
= 2 << D3DSP_DSTMOD_SHIFT
,
502 D3DSPDM_MSAMPCENTROID
= 4 << D3DSP_DSTMOD_SHIFT
,
504 D3DSPDM_FORCE_DWORD
= 0x7FFFFFFF
505 } D3DSHADER_PARAM_DSTMOD_TYPE
;
507 /** destination param */
508 #define D3DSP_DSTSHIFT_SHIFT 24
509 #define D3DSP_DSTSHIFT_MASK (0xF << D3DSP_DSTSHIFT_SHIFT)
511 /** destination/source reg type */
512 #define D3DSP_REGTYPE_SHIFT 28
513 #define D3DSP_REGTYPE_SHIFT2 8
514 #define D3DSP_REGTYPE_MASK (0x7 << D3DSP_REGTYPE_SHIFT)
515 #define D3DSP_REGTYPE_MASK2 0x00001800
517 typedef enum _D3DSHADER_PARAM_REGISTER_TYPE
{
525 D3DSPR_TEXCRDOUT
= 6,
534 D3DSPR_CONSTBOOL
= 14,
536 D3DSPR_TEMPFLOAT16
= 16,
537 D3DSPR_MISCTYPE
= 17,
539 D3DSPR_PREDICATE
= 19,
541 D3DSPR_FORCE_DWORD
= 0x7FFFFFFF
542 } D3DSHADER_PARAM_REGISTER_TYPE
;
544 typedef enum _D3DSHADER_MISCTYPE_OFFSETS
{
547 } D3DSHADER_MISCTYPE_OFFSETS
;
549 typedef enum _D3DVS_RASTOUT_OFFSETS
{
552 D3DSRO_POINT_SIZE
= 2,
554 D3DSRO_FORCE_DWORD
= 0x7FFFFFFF
555 } D3DVS_RASTOUT_OFFSETS
;
557 #define D3DVS_ADDRESSMODE_SHIFT 13
558 #define D3DVS_ADDRESSMODE_MASK (0x1 << D3DVS_ADDRESSMODE_SHIFT)
560 typedef enum _D3DVS_ADDRESSMODE_TYPE
{
561 D3DVS_ADDRMODE_ABSOLUTE
= 0 << D3DVS_ADDRESSMODE_SHIFT
,
562 D3DVS_ADDRMODE_RELATIVE
= 1 << D3DVS_ADDRESSMODE_SHIFT
,
564 D3DVS_ADDRMODE_FORCE_DWORD
= 0x7FFFFFFF
565 } D3DVS_ADDRESSMODE_TYPE
;
567 #define D3DSHADER_ADDRESSMODE_SHIFT 13
568 #define D3DSHADER_ADDRESSMODE_MASK (1 << D3DSHADER_ADDRESSMODE_SHIFT)
570 typedef enum _D3DSHADER_ADDRESSMODE_TYPE
{
571 D3DSHADER_ADDRMODE_ABSOLUTE
= 0 << D3DSHADER_ADDRESSMODE_SHIFT
,
572 D3DSHADER_ADDRMODE_RELATIVE
= 1 << D3DSHADER_ADDRESSMODE_SHIFT
,
574 D3DSHADER_ADDRMODE_FORCE_DWORD
= 0x7FFFFFFF
575 } D3DSHADER_ADDRESSMODE_TYPE
;
578 #define D3DVS_SWIZZLE_SHIFT 16
579 #define D3DVS_SWIZZLE_MASK (0xFF << D3DVS_SWIZZLE_SHIFT)
581 #define D3DSP_SWIZZLE_SHIFT 16
582 #define D3DSP_SWIZZLE_MASK (0xFF << D3DSP_SWIZZLE_SHIFT)
584 #define D3DVS_X_X (0 << D3DVS_SWIZZLE_SHIFT)
585 #define D3DVS_X_Y (1 << D3DVS_SWIZZLE_SHIFT)
586 #define D3DVS_X_Z (2 << D3DVS_SWIZZLE_SHIFT)
587 #define D3DVS_X_W (3 << D3DVS_SWIZZLE_SHIFT)
589 #define D3DVS_Y_X (0 << (D3DVS_SWIZZLE_SHIFT + 2))
590 #define D3DVS_Y_Y (1 << (D3DVS_SWIZZLE_SHIFT + 2))
591 #define D3DVS_Y_Z (2 << (D3DVS_SWIZZLE_SHIFT + 2))
592 #define D3DVS_Y_W (3 << (D3DVS_SWIZZLE_SHIFT + 2))
594 #define D3DVS_Z_X (0 << (D3DVS_SWIZZLE_SHIFT + 4))
595 #define D3DVS_Z_Y (1 << (D3DVS_SWIZZLE_SHIFT + 4))
596 #define D3DVS_Z_Z (2 << (D3DVS_SWIZZLE_SHIFT + 4))
597 #define D3DVS_Z_W (3 << (D3DVS_SWIZZLE_SHIFT + 4))
599 #define D3DVS_W_X (0 << (D3DVS_SWIZZLE_SHIFT + 6))
600 #define D3DVS_W_Y (1 << (D3DVS_SWIZZLE_SHIFT + 6))
601 #define D3DVS_W_Z (2 << (D3DVS_SWIZZLE_SHIFT + 6))
602 #define D3DVS_W_W (3 << (D3DVS_SWIZZLE_SHIFT + 6))
604 #define D3DVS_NOSWIZZLE (D3DVS_X_X | D3DVS_Y_Y | D3DVS_Z_Z | D3DVS_W_W)
606 #define D3DSP_NOSWIZZLE \
607 ((0 << (D3DSP_SWIZZLE_SHIFT + 0)) | (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | (2 << (D3DSP_SWIZZLE_SHIFT + 4)) | (3 << (D3DSP_SWIZZLE_SHIFT + 6)))
609 #define D3DSP_SRCMOD_SHIFT 24
610 #define D3DSP_SRCMOD_MASK (0xF << D3DSP_SRCMOD_SHIFT)
612 typedef enum _D3DSHADER_PARAM_SRCMOD_TYPE
{
613 D3DSPSM_NONE
= 0 << D3DSP_SRCMOD_SHIFT
,
614 D3DSPSM_NEG
= 1 << D3DSP_SRCMOD_SHIFT
,
615 D3DSPSM_BIAS
= 2 << D3DSP_SRCMOD_SHIFT
,
616 D3DSPSM_BIASNEG
= 3 << D3DSP_SRCMOD_SHIFT
,
617 D3DSPSM_SIGN
= 4 << D3DSP_SRCMOD_SHIFT
,
618 D3DSPSM_SIGNNEG
= 5 << D3DSP_SRCMOD_SHIFT
,
619 D3DSPSM_COMP
= 6 << D3DSP_SRCMOD_SHIFT
,
620 D3DSPSM_X2
= 7 << D3DSP_SRCMOD_SHIFT
,
621 D3DSPSM_X2NEG
= 8 << D3DSP_SRCMOD_SHIFT
,
622 D3DSPSM_DZ
= 9 << D3DSP_SRCMOD_SHIFT
,
623 D3DSPSM_DW
= 10 << D3DSP_SRCMOD_SHIFT
,
624 D3DSPSM_ABS
= 11 << D3DSP_SRCMOD_SHIFT
,
625 D3DSPSM_ABSNEG
= 12 << D3DSP_SRCMOD_SHIFT
,
626 D3DSPSM_NOT
= 13 << D3DSP_SRCMOD_SHIFT
,
628 D3DSPSM_FORCE_DWORD
= 0x7FFFFFFF
629 } D3DSHADER_PARAM_SRCMOD_TYPE
;
631 #define D3DPS_VERSION(major, minor) (0xFFFF0000 | ((major) << 8) | (minor))
632 #define D3DVS_VERSION(major, minor) (0xFFFE0000 | ((major) << 8) | (minor))
633 #define D3DSHADER_VERSION_MAJOR(version) (((version) >> 8) & 0xFF)
634 #define D3DSHADER_VERSION_MINOR(version) (((version) >> 0) & 0xFF)
636 #define D3DSI_COMMENTSIZE_SHIFT 16
637 #define D3DSI_COMMENTSIZE_MASK (0x7FFF << D3DSI_COMMENTSIZE_SHIFT)
639 #define D3DSHADER_COMMENT(commentSize) \
640 ((((commentSize) << D3DSI_COMMENTSIZE_SHIFT) & D3DSI_COMMENTSIZE_MASK) | D3DSIO_COMMENT)
642 #define D3DPS_END() 0x0000FFFF
643 #define D3DVS_END() 0x0000FFFF
646 /*****************************************************************************
647 * Direct 3D v8 enumerated types
649 typedef enum _D3DBACKBUFFER_TYPE
{
650 D3DBACKBUFFER_TYPE_MONO
= 0,
651 D3DBACKBUFFER_TYPE_LEFT
= 1,
652 D3DBACKBUFFER_TYPE_RIGHT
= 2,
654 D3DBACKBUFFER_TYPE_FORCE_DWORD
= 0x7fffffff
655 } D3DBACKBUFFER_TYPE
;
657 typedef enum _D3DBASISTYPE
{
659 D3DBASIS_BSPLINE
= 1,
660 D3DBASIS_INTERPOLATE
= 2,
662 D3DBASIS_FORCE_DWORD
= 0x7fffffff
665 typedef enum _D3DBLEND
{
668 D3DBLEND_SRCCOLOR
= 3,
669 D3DBLEND_INVSRCCOLOR
= 4,
670 D3DBLEND_SRCALPHA
= 5,
671 D3DBLEND_INVSRCALPHA
= 6,
672 D3DBLEND_DESTALPHA
= 7,
673 D3DBLEND_INVDESTALPHA
= 8,
674 D3DBLEND_DESTCOLOR
= 9,
675 D3DBLEND_INVDESTCOLOR
= 10,
676 D3DBLEND_SRCALPHASAT
= 11,
677 D3DBLEND_BOTHSRCALPHA
= 12,
678 D3DBLEND_BOTHINVSRCALPHA
= 13,
679 D3DBLEND_BLENDFACTOR
= 14,
680 D3DBLEND_INVBLENDFACTOR
= 15,
681 D3DBLEND_FORCE_DWORD
= 0x7fffffff
684 typedef enum _D3DBLENDOP
{
686 D3DBLENDOP_SUBTRACT
= 2,
687 D3DBLENDOP_REVSUBTRACT
= 3,
691 D3DBLENDOP_FORCE_DWORD
= 0x7fffffff
694 typedef enum _D3DCMPFUNC
{
698 D3DCMP_LESSEQUAL
= 4,
701 D3DCMP_GREATEREQUAL
= 7,
704 D3DCMP_FORCE_DWORD
= 0x7fffffff
707 typedef enum _D3DCUBEMAP_FACES
{
708 D3DCUBEMAP_FACE_POSITIVE_X
= 0,
709 D3DCUBEMAP_FACE_NEGATIVE_X
= 1,
710 D3DCUBEMAP_FACE_POSITIVE_Y
= 2,
711 D3DCUBEMAP_FACE_NEGATIVE_Y
= 3,
712 D3DCUBEMAP_FACE_POSITIVE_Z
= 4,
713 D3DCUBEMAP_FACE_NEGATIVE_Z
= 5,
715 D3DCUBEMAP_FACE_FORCE_DWORD
= 0xffffffff
718 typedef enum _D3DCULL
{
723 D3DCULL_FORCE_DWORD
= 0x7fffffff
726 typedef enum _D3DDEBUGMONITORTOKENS
{
730 D3DDMT_FORCE_DWORD
= 0x7fffffff
731 } D3DDEBUGMONITORTOKENS
;
733 typedef enum _D3DDEGREETYPE
{
734 D3DDEGREE_LINEAR
= 1,
735 D3DDEGREE_QUADRATIC
= 2,
737 D3DDEGREE_QUINTIC
= 5,
739 D3DDEGREE_FORCE_DWORD
= 0x7fffffff
742 typedef enum _D3DDEVTYPE
{
746 D3DDEVTYPE_NULLREF
= 4,
748 D3DDEVTYPE_FORCE_DWORD
= 0xffffffff
751 typedef enum _D3DFILLMODE
{
753 D3DFILL_WIREFRAME
= 2,
756 D3DFILL_FORCE_DWORD
= 0x7fffffff
759 typedef enum _D3DFOGMODE
{
765 D3DFOG_FORCE_DWORD
= 0x7fffffff
768 typedef enum _D3DFORMAT
{
772 D3DFMT_A8R8G8B8
= 21,
773 D3DFMT_X8R8G8B8
= 22,
775 D3DFMT_X1R5G5B5
= 24,
776 D3DFMT_A1R5G5B5
= 25,
777 D3DFMT_A4R4G4B4
= 26,
780 D3DFMT_A8R3G3B2
= 29,
781 D3DFMT_X4R4G4B4
= 30,
782 D3DFMT_A2B10G10R10
= 31,
783 D3DFMT_A8B8G8R8
= 32,
784 D3DFMT_X8B8G8R8
= 33,
786 D3DFMT_A2R10G10B10
= 35,
787 D3DFMT_A16B16G16R16
= 36,
799 D3DFMT_X8L8V8U8
= 62,
800 D3DFMT_Q8W8V8U8
= 63,
802 D3DFMT_A2W10V10U10
= 67,
804 D3DFMT_UYVY
= MAKEFOURCC('U', 'Y', 'V', 'Y'),
805 D3DFMT_YUY2
= MAKEFOURCC('Y', 'U', 'Y', '2'),
806 D3DFMT_DXT1
= MAKEFOURCC('D', 'X', 'T', '1'),
807 D3DFMT_DXT2
= MAKEFOURCC('D', 'X', 'T', '2'),
808 D3DFMT_DXT3
= MAKEFOURCC('D', 'X', 'T', '3'),
809 D3DFMT_DXT4
= MAKEFOURCC('D', 'X', 'T', '4'),
810 D3DFMT_DXT5
= MAKEFOURCC('D', 'X', 'T', '5'),
811 D3DFMT_MULTI2_ARGB8
= MAKEFOURCC('M', 'E', 'T', '1'),
812 D3DFMT_G8R8_G8B8
= MAKEFOURCC('G', 'R', 'G', 'B'),
813 D3DFMT_R8G8_B8G8
= MAKEFOURCC('R', 'G', 'B', 'G'),
815 D3DFMT_D16_LOCKABLE
= 70,
823 D3DFMT_D32F_LOCKABLE
= 82,
826 D3DFMT_VERTEXDATA
= 100,
827 D3DFMT_INDEX16
= 101,
828 D3DFMT_INDEX32
= 102,
829 D3DFMT_Q16W16V16U16
= 110,
830 /* Floating point formats */
832 D3DFMT_G16R16F
= 112,
833 D3DFMT_A16B16G16R16F
= 113,
837 D3DFMT_G32R32F
= 115,
838 D3DFMT_A32B32G32R32F
= 116,
843 D3DFMT_FORCE_DWORD
= 0xFFFFFFFF
846 typedef enum _D3DLIGHTTYPE
{
849 D3DLIGHT_DIRECTIONAL
= 3,
851 D3DLIGHT_FORCE_DWORD
= 0x7fffffff
854 typedef enum _D3DMATERIALCOLORSOURCE
{
859 D3DMCS_FORCE_DWORD
= 0x7fffffff
860 } D3DMATERIALCOLORSOURCE
;
862 typedef enum _D3DMULTISAMPLE_TYPE
{
863 D3DMULTISAMPLE_NONE
= 0,
864 D3DMULTISAMPLE_NONMASKABLE
= 1,
865 D3DMULTISAMPLE_2_SAMPLES
= 2,
866 D3DMULTISAMPLE_3_SAMPLES
= 3,
867 D3DMULTISAMPLE_4_SAMPLES
= 4,
868 D3DMULTISAMPLE_5_SAMPLES
= 5,
869 D3DMULTISAMPLE_6_SAMPLES
= 6,
870 D3DMULTISAMPLE_7_SAMPLES
= 7,
871 D3DMULTISAMPLE_8_SAMPLES
= 8,
872 D3DMULTISAMPLE_9_SAMPLES
= 9,
873 D3DMULTISAMPLE_10_SAMPLES
= 10,
874 D3DMULTISAMPLE_11_SAMPLES
= 11,
875 D3DMULTISAMPLE_12_SAMPLES
= 12,
876 D3DMULTISAMPLE_13_SAMPLES
= 13,
877 D3DMULTISAMPLE_14_SAMPLES
= 14,
878 D3DMULTISAMPLE_15_SAMPLES
= 15,
879 D3DMULTISAMPLE_16_SAMPLES
= 16,
881 D3DMULTISAMPLE_FORCE_DWORD
= 0x7fffffff
882 } D3DMULTISAMPLE_TYPE
;
885 typedef enum _D3DORDERTYPE
{
887 D3DORDER_QUADRATIC
= 2,
889 D3DORDER_QUINTIC
= 5,
891 D3DORDER_FORCE_DWORD
= 0x7fffffff
894 typedef enum _D3DPATCHEDGESTYLE
{
895 D3DPATCHEDGE_DISCRETE
= 0,
896 D3DPATCHEDGE_CONTINUOUS
= 1,
898 D3DPATCHEDGE_FORCE_DWORD
= 0x7fffffff,
901 typedef enum _D3DPOOL
{
904 D3DPOOL_SYSTEMMEM
= 2,
907 D3DPOOL_FORCE_DWORD
= 0x7fffffff
910 typedef enum _D3DPRIMITIVETYPE
{
914 D3DPT_TRIANGLELIST
= 4,
915 D3DPT_TRIANGLESTRIP
= 5,
916 D3DPT_TRIANGLEFAN
= 6,
918 D3DPT_FORCE_DWORD
= 0x7fffffff
921 typedef enum _D3DRENDERSTATETYPE
{
925 D3DRS_ZWRITEENABLE
= 14,
926 D3DRS_ALPHATESTENABLE
= 15,
927 D3DRS_LASTPIXEL
= 16,
929 D3DRS_DESTBLEND
= 20,
933 D3DRS_ALPHAFUNC
= 25,
934 D3DRS_DITHERENABLE
= 26,
935 D3DRS_ALPHABLENDENABLE
= 27,
936 D3DRS_FOGENABLE
= 28,
937 D3DRS_SPECULARENABLE
= 29,
939 D3DRS_FOGTABLEMODE
= 35,
942 D3DRS_FOGDENSITY
= 38,
943 D3DRS_RANGEFOGENABLE
= 48,
944 D3DRS_STENCILENABLE
= 52,
945 D3DRS_STENCILFAIL
= 53,
946 D3DRS_STENCILZFAIL
= 54,
947 D3DRS_STENCILPASS
= 55,
948 D3DRS_STENCILFUNC
= 56,
949 D3DRS_STENCILREF
= 57,
950 D3DRS_STENCILMASK
= 58,
951 D3DRS_STENCILWRITEMASK
= 59,
952 D3DRS_TEXTUREFACTOR
= 60,
961 D3DRS_CLIPPING
= 136,
962 D3DRS_LIGHTING
= 137,
964 D3DRS_FOGVERTEXMODE
= 140,
965 D3DRS_COLORVERTEX
= 141,
966 D3DRS_LOCALVIEWER
= 142,
967 D3DRS_NORMALIZENORMALS
= 143,
968 D3DRS_DIFFUSEMATERIALSOURCE
= 145,
969 D3DRS_SPECULARMATERIALSOURCE
= 146,
970 D3DRS_AMBIENTMATERIALSOURCE
= 147,
971 D3DRS_EMISSIVEMATERIALSOURCE
= 148,
972 D3DRS_VERTEXBLEND
= 151,
973 D3DRS_CLIPPLANEENABLE
= 152,
974 D3DRS_POINTSIZE
= 154,
975 D3DRS_POINTSIZE_MIN
= 155,
976 D3DRS_POINTSPRITEENABLE
= 156,
977 D3DRS_POINTSCALEENABLE
= 157,
978 D3DRS_POINTSCALE_A
= 158,
979 D3DRS_POINTSCALE_B
= 159,
980 D3DRS_POINTSCALE_C
= 160,
981 D3DRS_MULTISAMPLEANTIALIAS
= 161,
982 D3DRS_MULTISAMPLEMASK
= 162,
983 D3DRS_PATCHEDGESTYLE
= 163,
984 D3DRS_DEBUGMONITORTOKEN
= 165,
985 D3DRS_POINTSIZE_MAX
= 166,
986 D3DRS_INDEXEDVERTEXBLENDENABLE
= 167,
987 D3DRS_COLORWRITEENABLE
= 168,
988 D3DRS_TWEENFACTOR
= 170,
990 D3DRS_POSITIONDEGREE
= 172,
991 D3DRS_NORMALDEGREE
= 173,
992 D3DRS_SCISSORTESTENABLE
= 174,
993 D3DRS_SLOPESCALEDEPTHBIAS
= 175,
994 D3DRS_ANTIALIASEDLINEENABLE
= 176,
995 D3DRS_MINTESSELLATIONLEVEL
= 178,
996 D3DRS_MAXTESSELLATIONLEVEL
= 179,
997 D3DRS_ADAPTIVETESS_X
= 180,
998 D3DRS_ADAPTIVETESS_Y
= 181,
999 D3DRS_ADAPTIVETESS_Z
= 182,
1000 D3DRS_ADAPTIVETESS_W
= 183,
1001 D3DRS_ENABLEADAPTIVETESSELLATION
= 184,
1002 D3DRS_TWOSIDEDSTENCILMODE
= 185,
1003 D3DRS_CCW_STENCILFAIL
= 186,
1004 D3DRS_CCW_STENCILZFAIL
= 187,
1005 D3DRS_CCW_STENCILPASS
= 188,
1006 D3DRS_CCW_STENCILFUNC
= 189,
1007 D3DRS_COLORWRITEENABLE1
= 190,
1008 D3DRS_COLORWRITEENABLE2
= 191,
1009 D3DRS_COLORWRITEENABLE3
= 192,
1010 D3DRS_BLENDFACTOR
= 193,
1011 D3DRS_SRGBWRITEENABLE
= 194,
1012 D3DRS_DEPTHBIAS
= 195,
1021 D3DRS_SEPARATEALPHABLENDENABLE
= 206,
1022 D3DRS_SRCBLENDALPHA
= 207,
1023 D3DRS_DESTBLENDALPHA
= 208,
1024 D3DRS_BLENDOPALPHA
= 209,
1026 D3DRS_FORCE_DWORD
= 0x7fffffff
1027 } D3DRENDERSTATETYPE
;
1029 typedef enum _D3DRESOURCETYPE
{
1030 D3DRTYPE_SURFACE
= 1,
1031 D3DRTYPE_VOLUME
= 2,
1032 D3DRTYPE_TEXTURE
= 3,
1033 D3DRTYPE_VOLUMETEXTURE
= 4,
1034 D3DRTYPE_CUBETEXTURE
= 5,
1035 D3DRTYPE_VERTEXBUFFER
= 6,
1036 D3DRTYPE_INDEXBUFFER
= 7,
1038 D3DRTYPE_FORCE_DWORD
= 0x7fffffff
1041 #define D3DRTYPECOUNT (D3DRTYPE_INDEXBUFFER+1)
1043 typedef enum _D3DSHADEMODE
{
1045 D3DSHADE_GOURAUD
= 2,
1048 D3DSHADE_FORCE_DWORD
= 0x7fffffff
1051 typedef enum _D3DSTATEBLOCKTYPE
{
1053 D3DSBT_PIXELSTATE
= 2,
1054 D3DSBT_VERTEXSTATE
= 3,
1056 D3DSBT_FORCE_DWORD
= 0xffffffff
1057 } D3DSTATEBLOCKTYPE
;
1059 typedef enum _D3DSTENCILOP
{
1060 D3DSTENCILOP_KEEP
= 1,
1061 D3DSTENCILOP_ZERO
= 2,
1062 D3DSTENCILOP_REPLACE
= 3,
1063 D3DSTENCILOP_INCRSAT
= 4,
1064 D3DSTENCILOP_DECRSAT
= 5,
1065 D3DSTENCILOP_INVERT
= 6,
1066 D3DSTENCILOP_INCR
= 7,
1067 D3DSTENCILOP_DECR
= 8,
1069 D3DSTENCILOP_FORCE_DWORD
= 0x7fffffff
1072 typedef enum _D3DSWAPEFFECT
{
1073 D3DSWAPEFFECT_DISCARD
= 1,
1074 D3DSWAPEFFECT_FLIP
= 2,
1075 D3DSWAPEFFECT_COPY
= 3,
1076 D3DSWAPEFFECT_OVERLAY
= 4,
1077 D3DSWAPEFFECT_FLIPEX
= 5,
1078 D3DSWAPEFFECT_FORCE_DWORD
= 0xFFFFFFFF
1081 typedef enum _D3DTEXTUREADDRESS
{
1082 D3DTADDRESS_WRAP
= 1,
1083 D3DTADDRESS_MIRROR
= 2,
1084 D3DTADDRESS_CLAMP
= 3,
1085 D3DTADDRESS_BORDER
= 4,
1086 D3DTADDRESS_MIRRORONCE
= 5,
1088 D3DTADDRESS_FORCE_DWORD
= 0x7fffffff
1089 } D3DTEXTUREADDRESS
;
1091 typedef enum _D3DTEXTUREFILTERTYPE
{
1095 D3DTEXF_ANISOTROPIC
= 3,
1096 D3DTEXF_FLATCUBIC
= 4,
1097 D3DTEXF_GAUSSIANCUBIC
= 5,
1098 D3DTEXF_PYRAMIDALQUAD
= 6,
1099 D3DTEXF_GAUSSIANQUAD
= 7,
1100 D3DTEXF_FORCE_DWORD
= 0x7fffffff
1101 } D3DTEXTUREFILTERTYPE
;
1103 typedef enum _D3DTEXTUREOP
{
1105 D3DTOP_SELECTARG1
= 2,
1106 D3DTOP_SELECTARG2
= 3,
1107 D3DTOP_MODULATE
= 4,
1108 D3DTOP_MODULATE2X
= 5,
1109 D3DTOP_MODULATE4X
= 6,
1111 D3DTOP_ADDSIGNED
= 8,
1112 D3DTOP_ADDSIGNED2X
= 9,
1113 D3DTOP_SUBTRACT
= 10,
1114 D3DTOP_ADDSMOOTH
= 11,
1115 D3DTOP_BLENDDIFFUSEALPHA
= 12,
1116 D3DTOP_BLENDTEXTUREALPHA
= 13,
1117 D3DTOP_BLENDFACTORALPHA
= 14,
1118 D3DTOP_BLENDTEXTUREALPHAPM
= 15,
1119 D3DTOP_BLENDCURRENTALPHA
= 16,
1120 D3DTOP_PREMODULATE
= 17,
1121 D3DTOP_MODULATEALPHA_ADDCOLOR
= 18,
1122 D3DTOP_MODULATECOLOR_ADDALPHA
= 19,
1123 D3DTOP_MODULATEINVALPHA_ADDCOLOR
= 20,
1124 D3DTOP_MODULATEINVCOLOR_ADDALPHA
= 21,
1125 D3DTOP_BUMPENVMAP
= 22,
1126 D3DTOP_BUMPENVMAPLUMINANCE
= 23,
1127 D3DTOP_DOTPRODUCT3
= 24,
1128 D3DTOP_MULTIPLYADD
= 25,
1131 D3DTOP_FORCE_DWORD
= 0x7fffffff,
1134 typedef enum _D3DTEXTURESTAGESTATETYPE
{
1136 D3DTSS_COLORARG1
= 2,
1137 D3DTSS_COLORARG2
= 3,
1139 D3DTSS_ALPHAARG1
= 5,
1140 D3DTSS_ALPHAARG2
= 6,
1141 D3DTSS_BUMPENVMAT00
= 7,
1142 D3DTSS_BUMPENVMAT01
= 8,
1143 D3DTSS_BUMPENVMAT10
= 9,
1144 D3DTSS_BUMPENVMAT11
= 10,
1145 D3DTSS_TEXCOORDINDEX
= 11,
1146 D3DTSS_BUMPENVLSCALE
= 22,
1147 D3DTSS_BUMPENVLOFFSET
= 23,
1148 D3DTSS_TEXTURETRANSFORMFLAGS
= 24,
1149 D3DTSS_COLORARG0
= 26,
1150 D3DTSS_ALPHAARG0
= 27,
1151 D3DTSS_RESULTARG
= 28,
1152 D3DTSS_CONSTANT
= 32,
1154 D3DTSS_FORCE_DWORD
= 0x7fffffff
1155 } D3DTEXTURESTAGESTATETYPE
;
1157 typedef enum _D3DTEXTURETRANSFORMFLAGS
{
1158 D3DTTFF_DISABLE
= 0,
1163 D3DTTFF_PROJECTED
= 256,
1165 D3DTTFF_FORCE_DWORD
= 0x7fffffff
1166 } D3DTEXTURETRANSFORMFLAGS
;
1168 typedef enum _D3DTRANSFORMSTATETYPE
{
1170 D3DTS_PROJECTION
= 3,
1171 D3DTS_TEXTURE0
= 16,
1172 D3DTS_TEXTURE1
= 17,
1173 D3DTS_TEXTURE2
= 18,
1174 D3DTS_TEXTURE3
= 19,
1175 D3DTS_TEXTURE4
= 20,
1176 D3DTS_TEXTURE5
= 21,
1177 D3DTS_TEXTURE6
= 22,
1178 D3DTS_TEXTURE7
= 23,
1180 D3DTS_FORCE_DWORD
= 0x7fffffff
1181 } D3DTRANSFORMSTATETYPE
;
1183 typedef enum _D3DVERTEXBLENDFLAGS
{
1185 D3DVBF_1WEIGHTS
= 1,
1186 D3DVBF_2WEIGHTS
= 2,
1187 D3DVBF_3WEIGHTS
= 3,
1188 D3DVBF_TWEENING
= 255,
1189 D3DVBF_0WEIGHTS
= 256
1190 } D3DVERTEXBLENDFLAGS
;
1192 typedef enum _D3DZBUFFERTYPE
{
1197 D3DZB_FORCE_DWORD
= 0x7fffffff
1200 typedef enum _D3DSAMPLERSTATETYPE
{
1201 D3DSAMP_ADDRESSU
= 1,
1202 D3DSAMP_ADDRESSV
= 2,
1203 D3DSAMP_ADDRESSW
= 3,
1204 D3DSAMP_BORDERCOLOR
= 4,
1205 D3DSAMP_MAGFILTER
= 5,
1206 D3DSAMP_MINFILTER
= 6,
1207 D3DSAMP_MIPFILTER
= 7,
1208 D3DSAMP_MIPMAPLODBIAS
= 8,
1209 D3DSAMP_MAXMIPLEVEL
= 9,
1210 D3DSAMP_MAXANISOTROPY
= 10,
1211 D3DSAMP_SRGBTEXTURE
= 11,
1212 D3DSAMP_ELEMENTINDEX
= 12,
1213 D3DSAMP_DMAPOFFSET
= 13,
1215 D3DSAMP_FORCE_DWORD
= 0x7fffffff,
1216 } D3DSAMPLERSTATETYPE
;
1219 /*****************************************************************************
1220 * Direct 3D v9 typedefs
1222 #ifndef D3DCOLOR_DEFINED
1223 typedef DWORD D3DCOLOR
;
1224 #define D3DCOLOR_DEFINED
1227 /*****************************************************************************
1228 * Direct 3D v9 structures
1230 typedef struct _D3DADAPTER_IDENTIFIER9
{
1231 char Driver
[MAX_DEVICE_IDENTIFIER_STRING
];
1232 char Description
[MAX_DEVICE_IDENTIFIER_STRING
];
1233 char DeviceName
[32];
1234 LARGE_INTEGER DriverVersion
;
1241 GUID DeviceIdentifier
;
1244 } D3DADAPTER_IDENTIFIER9
;
1246 typedef struct _D3DBOX
{
1255 typedef struct _D3DCLIPSTATUS9
{
1257 DWORD ClipIntersection
;
1260 #ifndef D3DCOLORVALUE_DEFINED
1261 typedef struct _D3DCOLORVALUE
{
1267 #define D3DCOLORVALUE_DEFINED
1270 typedef struct _D3DDEVICE_CREATION_PARAMETERS
{
1271 UINT AdapterOrdinal
;
1272 D3DDEVTYPE DeviceType
;
1274 DWORD BehaviorFlags
;
1275 } D3DDEVICE_CREATION_PARAMETERS
;
1277 typedef struct _D3DDEVINFO_D3D9BANDWIDTHTIMINGS
{
1278 float MaxBandwidthUtilized
;
1279 float FrontEndUploadMemoryUtilizedPercent
;
1280 float VertexRateUtilizedPercent
;
1281 float TriangleSetupRateUtilizedPercent
;
1282 float FillRateUtilizedPercent
;
1283 } D3DDEVINFO_D3D9BANDWIDTHTIMINGS
;
1285 typedef struct _D3DDEVINFO_D3D9CACHEUTILIZATION
{
1286 float TextureCacheHitRate
;
1287 float PostTransformVertexCacheHitRate
;
1288 } D3DDEVINFO_D3D9CACHEUTILIZATION
;
1290 typedef struct _D3DDEVINFO_D3D9INTERFACETIMINGS
{
1291 float WaitingForGPUToUseApplicationResourceTimePercent
;
1292 float WaitingForGPUToAcceptMoreCommandsTimePercent
;
1293 float WaitingForGPUToStayWithinLatencyTimePercent
;
1294 float WaitingForGPUExclusiveResourceTimePercent
;
1295 float WaitingForGPUOtherTimePercent
;
1296 } D3DDEVINFO_D3D9INTERFACETIMINGS
;
1298 typedef struct _D3DDEVINFO_D3D9PIPELINETIMINGS
{
1299 float VertexProcessingTimePercent
;
1300 float PixelProcessingTimePercent
;
1301 float OtherGPUProcessingTimePercent
;
1302 float GPUIdleTimePercent
;
1303 } D3DDEVINFO_D3D9PIPELINETIMINGS
;
1305 typedef struct _D3DDEVINFO_D3D9STAGETIMINGS
{
1306 float MemoryProcessingPercent
;
1307 float ComputationProcessingPercent
;
1308 } D3DDEVINFO_D3D9STAGETIMINGS
;
1311 /* Vertex cache optimization hints. */
1312 typedef struct D3DDEVINFO_VCACHE
{
1313 /* Must be a 4 char code FOURCC (e.g. CACH) */
1315 /* 0 to get the longest strips, 1 vertex cache */
1317 /* Cache size to use (only valid if OptMethod==1) */
1319 /* internal for deciding when to restart strips, non user modifiable (only valid if OptMethod==1) */
1321 } D3DDEVINFO_VCACHE
;
1323 typedef struct D3DRESOURCESTATS
{
1325 DWORD ApproxBytesDownloaded
;
1327 DWORD NumVidCreates
;
1330 DWORD NumUsedInVidMem
;
1332 DWORD WorkingSetBytes
;
1337 typedef struct _D3DDEVINFO_D3DRESOURCEMANAGER
{
1338 D3DRESOURCESTATS stats
[D3DRTYPECOUNT
];
1339 } D3DDEVINFO_D3DRESOURCEMANAGER
;
1341 typedef struct _D3DDEVINFO_D3DVERTEXSTATS
{
1342 DWORD NumRenderedTriangles
;
1343 DWORD NumExtraClippingTriangles
;
1344 } D3DDEVINFO_D3DVERTEXSTATS
;
1346 typedef struct _D3DDISPLAYMODE
{
1353 typedef struct _D3DGAMMARAMP
{
1359 typedef struct _D3DINDEXBUFFER_DESC
{
1361 D3DRESOURCETYPE Type
;
1365 } D3DINDEXBUFFER_DESC
;
1367 #ifndef D3DVECTOR_DEFINED
1368 typedef struct _D3DVECTOR
{
1373 #define D3DVECTOR_DEFINED
1376 typedef struct _D3DLIGHT9
{
1378 D3DCOLORVALUE Diffuse
;
1379 D3DCOLORVALUE Specular
;
1380 D3DCOLORVALUE Ambient
;
1382 D3DVECTOR Direction
;
1392 typedef struct _D3DLINEPATTERN
{
1397 typedef struct _D3DLOCKED_BOX
{
1403 typedef struct _D3DLOCKED_RECT
{
1408 typedef struct _D3DMATERIAL9
{
1409 D3DCOLORVALUE Diffuse
;
1410 D3DCOLORVALUE Ambient
;
1411 D3DCOLORVALUE Specular
;
1412 D3DCOLORVALUE Emissive
;
1416 #ifndef D3DMATRIX_DEFINED
1417 typedef struct _D3DMATRIX
{
1420 float _11
, _12
, _13
, _14
;
1421 float _21
, _22
, _23
, _24
;
1422 float _31
, _32
, _33
, _34
;
1423 float _41
, _42
, _43
, _44
;
1428 #define D3DMATRIX_DEFINED
1431 typedef struct _D3DPRESENT_PARAMETERS_
{
1432 UINT BackBufferWidth
;
1433 UINT BackBufferHeight
;
1434 D3DFORMAT BackBufferFormat
;
1435 UINT BackBufferCount
;
1437 D3DMULTISAMPLE_TYPE MultiSampleType
;
1438 DWORD MultiSampleQuality
;
1440 D3DSWAPEFFECT SwapEffect
;
1443 BOOL EnableAutoDepthStencil
;
1444 D3DFORMAT AutoDepthStencilFormat
;
1447 UINT FullScreen_RefreshRateInHz
;
1448 UINT PresentationInterval
;
1450 } D3DPRESENT_PARAMETERS
;
1452 typedef struct _D3DRANGE
{
1457 typedef struct _D3DRASTER_STATUS
{
1462 #ifndef D3DRECT_DEFINED
1463 typedef struct _D3DRECT
{
1469 #define D3DRECT_DEFINED
1472 typedef struct _D3DRECTPATCH_INFO
{
1473 UINT StartVertexOffsetWidth
;
1474 UINT StartVertexOffsetHeight
;
1479 D3DDEGREETYPE Degree
;
1480 } D3DRECTPATCH_INFO
;
1482 typedef struct _D3DSURFACE_DESC
{
1484 D3DRESOURCETYPE Type
;
1487 D3DMULTISAMPLE_TYPE MultiSampleType
;
1488 DWORD MultiSampleQuality
;
1493 typedef struct _D3DTRIPATCH_INFO
{
1494 UINT StartVertexOffset
;
1497 D3DDEGREETYPE Degree
;
1500 typedef struct _D3DVERTEXBUFFER_DESC
{
1502 D3DRESOURCETYPE Type
;
1507 } D3DVERTEXBUFFER_DESC
;
1509 typedef struct _D3DVIEWPORT9
{
1518 typedef struct _D3DVOLUME_DESC
{
1520 D3DRESOURCETYPE Type
;
1529 /* Parts added with d3d9ex */
1530 #if !defined(D3D_DISABLE_9EX)
1531 typedef enum D3DSCANLINEORDERING
1533 D3DSCANLINEORDERING_UNKNOWN
,
1534 D3DSCANLINEORDERING_PROGRESSIVE
,
1535 D3DSCANLINEORDERING_INTERLACED
,
1536 } D3DSCANLINEORDERING
;
1539 typedef struct D3DDISPLAYMODEFILTER
1543 D3DSCANLINEORDERING ScanLineOrdering
;
1544 } D3DDISPLAYMODEFILTER
;
1546 typedef struct D3DDISPLAYMODEEX
1553 D3DSCANLINEORDERING ScanLineOrdering
;
1556 typedef enum D3DDISPLAYROTATION
1558 D3DDISPLAYROTATION_IDENTITY
= 1,
1559 D3DDISPLAYROTATION_90
,
1560 D3DDISPLAYROTATION_180
,
1561 D3DDISPLAYROTATION_270
1562 } D3DDISPLAYROTATION
;
1564 typedef enum _D3DCOMPOSERECTSOP
{
1565 D3DCOMPOSERECTS_COPY
= 1,
1567 D3DCOMPOSERECTS_AND
,
1568 D3DCOMPOSERECTS_NEG
,
1569 D3DCOMPOSERECTS_FORCE_DWORD
= 0x7fffffff
1570 } D3DCOMPOSERECTSOP
;
1572 typedef struct _D3DPRESENTSTATS
1575 UINT PresentRefreshCount
;
1576 UINT SyncRefreshCount
;
1577 LARGE_INTEGER SyncQPCTime
;
1578 LARGE_INTEGER SyncGPUTime
;
1581 #endif /* D3D_DISABLE_9EX */
1583 typedef enum _D3DSHADER_COMPARISON
1585 D3DSPC_RESERVED0
= 0,
1593 } D3DSHADER_COMPARISON
;
1596 #include <poppack.h>
1599 #endif /* __WINE_D3D9TYPES_H */