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
24 /*****************************************************************************
25 * Direct 3D v9 #defines
27 #define D3DCLEAR_TARGET __MSABI_LONG(0x00000001)
28 #define D3DCLEAR_ZBUFFER __MSABI_LONG(0x00000002)
29 #define D3DCLEAR_STENCIL __MSABI_LONG(0x00000004)
31 #define D3DCLIPPLANE0 (1 << 0)
32 #define D3DCLIPPLANE1 (1 << 1)
33 #define D3DCLIPPLANE2 (1 << 2)
34 #define D3DCLIPPLANE3 (1 << 3)
35 #define D3DCLIPPLANE4 (1 << 4)
36 #define D3DCLIPPLANE5 (1 << 5)
38 #define D3DCOLOR_ARGB(a,r,g,b) ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
39 #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))
40 #define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b)
41 #define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b)
42 #define D3DCOLOR_XYUV(y,u,v) D3DCOLOR_ARGB(0xFF,y,u,v)
43 #define D3DCOLOR_AYUV(a,y,u,v) D3DCOLOR_ARGB(a,y,u,v)
45 #define D3DCS_LEFT __MSABI_LONG(0x001)
46 #define D3DCS_RIGHT __MSABI_LONG(0x002)
47 #define D3DCS_TOP __MSABI_LONG(0x004)
48 #define D3DCS_BOTTOM __MSABI_LONG(0x008)
49 #define D3DCS_FRONT __MSABI_LONG(0x010)
50 #define D3DCS_BACK __MSABI_LONG(0x020)
51 #define D3DCS_PLANE0 __MSABI_LONG(0x040)
52 #define D3DCS_PLANE1 __MSABI_LONG(0x080)
53 #define D3DCS_PLANE2 __MSABI_LONG(0x100)
54 #define D3DCS_PLANE3 __MSABI_LONG(0x200)
55 #define D3DCS_PLANE4 __MSABI_LONG(0x400)
56 #define D3DCS_PLANE5 __MSABI_LONG(0x800)
57 #define D3DCS_ALL __MSABI_LONG(0xFFF)
59 #define D3DFVF_TEXTUREFORMAT1 3
60 #define D3DFVF_TEXTUREFORMAT2 0
61 #define D3DFVF_TEXTUREFORMAT3 1
62 #define D3DFVF_TEXTUREFORMAT4 2
63 #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
64 #define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2)
65 #define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
66 #define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
68 #define D3DLOCK_READONLY 0x0010
69 #define D3DLOCK_NOSYSLOCK 0x0800
70 #define D3DLOCK_NOOVERWRITE 0x1000
71 #define D3DLOCK_DISCARD 0x2000
72 #define D3DLOCK_DONOTWAIT 0x4000
73 #define D3DLOCK_NO_DIRTY_UPDATE 0x8000
75 #define D3DMAXUSERCLIPPLANES 32
76 #define D3DCLIPPLANE0 (1 << 0)
77 #define D3DCLIPPLANE1 (1 << 1)
78 #define D3DCLIPPLANE2 (1 << 2)
79 #define D3DCLIPPLANE3 (1 << 3)
80 #define D3DCLIPPLANE4 (1 << 4)
81 #define D3DCLIPPLANE5 (1 << 5)
84 #define D3DRENDERSTATE_WRAPBIAS __MSABI_LONG(128U)
86 /* MSDN has this in d3d9caps.h, but it should be here */
87 #define D3DTSS_TCI_PASSTHRU 0x00000
88 #define D3DTSS_TCI_CAMERASPACENORMAL 0x10000
89 #define D3DTSS_TCI_CAMERASPACEPOSITION 0x20000
90 #define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x30000
91 #define D3DTSS_TCI_SPHEREMAP 0x40000
94 #define D3DTS_WORLD D3DTS_WORLDMATRIX(0)
95 #define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1)
96 #define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2)
97 #define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3)
98 #define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256)
100 #define D3DUSAGE_RENDERTARGET __MSABI_LONG(0x00000001)
101 #define D3DUSAGE_DEPTHSTENCIL __MSABI_LONG(0x00000002)
102 #define D3DUSAGE_WRITEONLY __MSABI_LONG(0x00000008)
103 #define D3DUSAGE_SOFTWAREPROCESSING __MSABI_LONG(0x00000010)
104 #define D3DUSAGE_DONOTCLIP __MSABI_LONG(0x00000020)
105 #define D3DUSAGE_POINTS __MSABI_LONG(0x00000040)
106 #define D3DUSAGE_RTPATCHES __MSABI_LONG(0x00000080)
107 #define D3DUSAGE_NPATCHES __MSABI_LONG(0x00000100)
108 #define D3DUSAGE_DYNAMIC __MSABI_LONG(0x00000200)
109 #define D3DUSAGE_AUTOGENMIPMAP __MSABI_LONG(0x00000400)
110 #define D3DUSAGE_DMAP __MSABI_LONG(0x00004000)
112 #define D3DUSAGE_QUERY_FILTER __MSABI_LONG(0x00020000)
113 #define D3DUSAGE_QUERY_LEGACYBUMPMAP __MSABI_LONG(0x00008000)
114 #define D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING __MSABI_LONG(0x00080000)
115 #define D3DUSAGE_QUERY_SRGBREAD __MSABI_LONG(0x00010000)
116 #define D3DUSAGE_QUERY_SRGBWRITE __MSABI_LONG(0x00040000)
117 #define D3DUSAGE_QUERY_VERTEXTEXTURE __MSABI_LONG(0x00100000)
118 #define D3DUSAGE_QUERY_WRAPANDMIP __MSABI_LONG(0x00200000)
123 #define D3DWRAPCOORD_0 1
124 #define D3DWRAPCOORD_1 2
125 #define D3DWRAPCOORD_2 4
126 #define D3DWRAPCOORD_3 8
128 #define MAX_DEVICE_IDENTIFIER_STRING 512
130 #define D3DFVF_RESERVED0 0x0001
131 #define D3DFVF_POSITION_MASK 0x400E
132 #define D3DFVF_XYZ 0x0002
133 #define D3DFVF_XYZRHW 0x0004
134 #define D3DFVF_XYZB1 0x0006
135 #define D3DFVF_XYZB2 0x0008
136 #define D3DFVF_XYZB3 0x000a
137 #define D3DFVF_XYZB4 0x000c
138 #define D3DFVF_XYZB5 0x000e
139 #define D3DFVF_XYZW 0x4002
140 #define D3DFVF_NORMAL 0x0010
141 #define D3DFVF_PSIZE 0x0020
142 #define D3DFVF_DIFFUSE 0x0040
143 #define D3DFVF_SPECULAR 0x0080
144 #define D3DFVF_TEXCOUNT_MASK 0x0f00
145 #define D3DFVF_TEXCOUNT_SHIFT 8
146 #define D3DFVF_TEX0 0x0000
147 #define D3DFVF_TEX1 0x0100
148 #define D3DFVF_TEX2 0x0200
149 #define D3DFVF_TEX3 0x0300
150 #define D3DFVF_TEX4 0x0400
151 #define D3DFVF_TEX5 0x0500
152 #define D3DFVF_TEX6 0x0600
153 #define D3DFVF_TEX7 0x0700
154 #define D3DFVF_TEX8 0x0800
155 #define D3DFVF_LASTBETA_UBYTE4 0x1000
156 #define D3DFVF_LASTBETA_D3DCOLOR 0x8000
157 #define D3DFVF_RESERVED2 0x6000
159 #define D3DTA_SELECTMASK 0x0000000f
160 #define D3DTA_DIFFUSE 0x00000000
161 #define D3DTA_CURRENT 0x00000001
162 #define D3DTA_TEXTURE 0x00000002
163 #define D3DTA_TFACTOR 0x00000003
164 #define D3DTA_SPECULAR 0x00000004
165 #define D3DTA_TEMP 0x00000005
166 #define D3DTA_CONSTANT 0x00000006
167 #define D3DTA_COMPLEMENT 0x00000010
168 #define D3DTA_ALPHAREPLICATE 0x00000020
170 #define D3DCOLORWRITEENABLE_RED (__MSABI_LONG(1)<<0)
171 #define D3DCOLORWRITEENABLE_GREEN (__MSABI_LONG(1)<<1)
172 #define D3DCOLORWRITEENABLE_BLUE (__MSABI_LONG(1)<<2)
173 #define D3DCOLORWRITEENABLE_ALPHA (__MSABI_LONG(1)<<3)
175 #define D3DPV_DONOTCOPYDATA (1 << 0)
177 #define D3DSTREAMSOURCE_INDEXEDDATA (1 << 30)
178 #define D3DSTREAMSOURCE_INSTANCEDATA (2 << 30)
180 #define D3D_MAX_SIMULTANEOUS_RENDERTARGETS 4
182 #define MAXD3DDECLLENGTH 64 /* +end marker */
183 #define MAXD3DDECLMETHOD D3DDECLMETHOD_LOOKUPPRESAMPLED
184 #define MAXD3DDECLTYPE D3DDECLTYPE_UNUSED
185 #define MAXD3DDECLUSAGE D3DDECLUSAGE_SAMPLE
186 #define MAXD3DDECLUSAGEINDEX 15
188 #define D3DDMAPSAMPLER 256
189 #define D3DVERTEXTEXTURESAMPLER0 (D3DDMAPSAMPLER+1)
190 #define D3DVERTEXTEXTURESAMPLER1 (D3DDMAPSAMPLER+2)
191 #define D3DVERTEXTEXTURESAMPLER2 (D3DDMAPSAMPLER+3)
192 #define D3DVERTEXTEXTURESAMPLER3 (D3DDMAPSAMPLER+4)
195 #define MAKEFOURCC(ch0, ch1, ch2, ch3) \
196 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
197 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
200 /* Constants used by D3DPRESENT_PARAMETERS. when creating a device or swapchain */
202 #define D3DPRESENTFLAG_LOCKABLE_BACKBUFFER 0x00000001 /* Create a lockable backbuffer */
203 #define D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL 0x00000002 /* Discard Z buffer */
204 #define D3DPRESENTFLAG_DEVICECLIP 0x00000004 /* Clip the window blited into the client area 2k + xp only */
205 #define D3DPRESENTFLAG_VIDEO 0x00000010 /* backbuffer 'may' contain video data */
206 #define D3DPRESENTFLAG_NOAUTOROTATE 0x00000020 /* d3d9ex, ignore display rotation */
207 #define D3DPRESENTFLAG_UNPRUNEDMODE 0x00000040 /* d3d9ex, specify invalid display modes */
209 #define D3DPRESENT_BACK_BUFFERS_MAX __MSABI_LONG(3)
210 #define D3DPRESENT_RATE_DEFAULT 0x00000000
212 /****************************
213 * Vertex Shaders Declaration
216 typedef enum _D3DDECLUSAGE {
217 D3DDECLUSAGE_POSITION = 0,
218 D3DDECLUSAGE_BLENDWEIGHT = 1,
219 D3DDECLUSAGE_BLENDINDICES = 2,
220 D3DDECLUSAGE_NORMAL = 3,
221 D3DDECLUSAGE_PSIZE = 4,
222 D3DDECLUSAGE_TEXCOORD = 5,
223 D3DDECLUSAGE_TANGENT = 6,
224 D3DDECLUSAGE_BINORMAL = 7,
225 D3DDECLUSAGE_TESSFACTOR = 8,
226 D3DDECLUSAGE_POSITIONT = 9,
227 D3DDECLUSAGE_COLOR = 10,
228 D3DDECLUSAGE_FOG = 11,
229 D3DDECLUSAGE_DEPTH = 12,
230 D3DDECLUSAGE_SAMPLE = 13
233 #define D3DMAXDECLUSAGE D3DDECLUSAGE_SAMPLE
234 #define D3DMAXDECLUSAGEINDEX 15
235 #define D3DMAXDECLLENGTH 18
236 #define D3DMAXDECLUSAGE_DX8 D3DDECLUSAGE_TEXCOORD
238 typedef enum _D3DDECLMETHOD {
239 D3DDECLMETHOD_DEFAULT = 0,
240 D3DDECLMETHOD_PARTIALU = 1,
241 D3DDECLMETHOD_PARTIALV = 2,
242 D3DDECLMETHOD_CROSSUV = 3,
243 D3DDECLMETHOD_UV = 4,
244 D3DDECLMETHOD_LOOKUP = 5,
245 D3DDECLMETHOD_LOOKUPPRESAMPLED = 6
249 #define D3DMAXDECLMETHOD D3DDECLMETHOD_LOOKUPPRESAMPLED
251 typedef enum _D3DDECLTYPE {
252 D3DDECLTYPE_FLOAT1 = 0,
253 D3DDECLTYPE_FLOAT2 = 1,
254 D3DDECLTYPE_FLOAT3 = 2,
255 D3DDECLTYPE_FLOAT4 = 3,
256 D3DDECLTYPE_D3DCOLOR = 4,
257 D3DDECLTYPE_UBYTE4 = 5,
258 D3DDECLTYPE_SHORT2 = 6,
259 D3DDECLTYPE_SHORT4 = 7,
261 D3DDECLTYPE_UBYTE4N = 8,
262 D3DDECLTYPE_SHORT2N = 9,
263 D3DDECLTYPE_SHORT4N = 10,
264 D3DDECLTYPE_USHORT2N = 11,
265 D3DDECLTYPE_USHORT4N = 12,
266 D3DDECLTYPE_UDEC3 = 13,
267 D3DDECLTYPE_DEC3N = 14,
268 D3DDECLTYPE_FLOAT16_2 = 15,
269 D3DDECLTYPE_FLOAT16_4 = 16,
270 D3DDECLTYPE_UNUSED = 17,
273 #define D3DMAXDECLTYPE D3DDECLTYPE_UNUSED
275 typedef struct _D3DVERTEXELEMENT9 {
282 } D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9;
285 typedef enum _D3DQUERYTYPE {
286 D3DQUERYTYPE_VCACHE = 4,
287 D3DQUERYTYPE_RESOURCEMANAGER = 5,
288 D3DQUERYTYPE_VERTEXSTATS = 6,
289 D3DQUERYTYPE_EVENT = 8,
290 D3DQUERYTYPE_OCCLUSION = 9,
291 D3DQUERYTYPE_TIMESTAMP = 10,
292 D3DQUERYTYPE_TIMESTAMPDISJOINT = 11,
293 D3DQUERYTYPE_TIMESTAMPFREQ = 12,
294 D3DQUERYTYPE_PIPELINETIMINGS = 13,
295 D3DQUERYTYPE_INTERFACETIMINGS = 14,
296 D3DQUERYTYPE_VERTEXTIMINGS = 15,
297 D3DQUERYTYPE_PIXELTIMINGS = 16,
298 D3DQUERYTYPE_BANDWIDTHTIMINGS = 17,
299 D3DQUERYTYPE_CACHEUTILIZATION = 18
302 #define D3DISSUE_BEGIN (1 << 1)
303 #define D3DISSUE_END (1 << 0)
304 #define D3DGETDATA_FLUSH (1 << 0)
307 #define D3DDECL_END() {0xFF,0,D3DDECLTYPE_UNUSED,0,0,0}
308 #define D3DDP_MAXTEXCOORD 8
311 #define D3DVSD_MAKETOKENTYPE(TokenType) \
312 ((TokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK)
314 #define D3DVSD_CONST(ConstantAddress, Count) \
315 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | ((Count) << D3DVSD_CONSTCOUNTSHIFT) | (ConstantAddress))
317 #define D3DVSD_END() 0xFFFFFFFF
319 #define D3DVSD_NOP() 0x00000000
321 #define D3DVSD_REG(VertexRegister, Type) \
322 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | ((Type) << D3DVSD_DATATYPESHIFT) | (VertexRegister))
324 #define D3DVSD_SKIP(Count) \
325 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | ((Count) << D3DVSD_SKIPCOUNTSHIFT))
327 #define D3DVSD_STREAM(StreamNumber) \
328 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (StreamNumber))
330 #define D3DVSD_STREAM_TESS() \
331 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK))
333 #define D3DVSD_TESSNORMAL(RegisterIn, RegisterOut) \
334 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | ((RegisterIn) << D3DVSD_VERTEXREGINSHIFT) | ((0x02) << D3DVSD_DATATYPESHIFT) | (RegisterOut))
336 #define D3DVSD_TESSUV(Register) \
337 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | ((0x01) << D3DVSD_DATATYPESHIFT) | (Register))
340 /********************************
341 * Pixel/Vertex Shaders Functions
344 /** Maximum number of supported texture coordinates sets operation */
345 #define D3DDP_MAXTEXCOORD 8
347 /** opcode token mask */
348 #define D3DSI_OPCODE_MASK 0x0000FFFF
349 #define D3DSI_INSTLENGTH_MASK 0x0F000000
350 #define D3DSI_INSTLENGTH_SHIFT 24
352 /** opcodes types for PS and VS */
353 typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE {
404 D3DSIO_TEXCOORD = 64,
409 D3DSIO_TEXREG2AR = 69,
410 D3DSIO_TEXREG2GB = 70,
411 D3DSIO_TEXM3x2PAD = 71,
412 D3DSIO_TEXM3x2TEX = 72,
413 D3DSIO_TEXM3x3PAD = 73,
414 D3DSIO_TEXM3x3TEX = 74,
415 D3DSIO_TEXM3x3DIFF = 75,
416 D3DSIO_TEXM3x3SPEC = 76,
417 D3DSIO_TEXM3x3VSPEC = 77,
422 D3DSIO_TEXREG2RGB = 82,
423 D3DSIO_TEXDP3TEX = 83,
424 D3DSIO_TEXM3x2DEPTH = 84,
427 D3DSIO_TEXDEPTH = 87,
438 D3DSIO_PHASE = 0xFFFD,
439 D3DSIO_COMMENT = 0xFFFE,
442 D3DSIO_FORCE_DWORD = 0X7FFFFFFF /** for 32-bit alignment */
443 } D3DSHADER_INSTRUCTION_OPCODE_TYPE;
445 #define D3DSINCOSCONST1 -1.5500992e-006f, -2.1701389e-005f, 0.0026041667f, 0.00026041668f
446 #define D3DSINCOSCONST2 -0.020833334f, -0.12500000f, 1.0f, 0.50000000f
448 #define D3DSHADER_INSTRUCTION_PREDICATED (1 << 28)
450 #define D3DSI_TEXLD_PROJECT 0x00010000
451 #define D3DSI_TEXLD_BIAS 0x00020000
453 /** for parallelism */
454 #define D3DSI_COISSUE 0x40000000
456 #define D3DSP_DCL_USAGE_SHIFT 0
457 #define D3DSP_DCL_USAGE_MASK 0x0000000f
459 #define D3DSP_DCL_USAGEINDEX_SHIFT 16
460 #define D3DSP_DCL_USAGEINDEX_MASK 0x000f0000
462 #define D3DSP_TEXTURETYPE_SHIFT 27
463 #define D3DSP_TEXTURETYPE_MASK 0x78000000
465 typedef enum _D3DSAMPLER_TEXTURE_TYPE {
466 D3DSTT_UNKNOWN = 0 << D3DSP_TEXTURETYPE_SHIFT,
467 D3DSTT_1D = 1 << D3DSP_TEXTURETYPE_SHIFT,
468 D3DSTT_2D = 2 << D3DSP_TEXTURETYPE_SHIFT,
469 D3DSTT_CUBE = 3 << D3DSP_TEXTURETYPE_SHIFT,
470 D3DSTT_VOLUME = 4 << D3DSP_TEXTURETYPE_SHIFT,
472 D3DSTT_FORCE_DWORD = 0x7FFFFFFF
473 } D3DSAMPLER_TEXTURE_TYPE;
475 #define D3DSP_REGNUM_MASK 0x000007FF
477 /** destination parameter modifiers (.xyzw) */
478 #define D3DSP_WRITEMASK_0 0x00010000 /* .x r */
479 #define D3DSP_WRITEMASK_1 0x00020000 /* .y g */
480 #define D3DSP_WRITEMASK_2 0x00040000 /* .z b */
481 #define D3DSP_WRITEMASK_3 0x00080000 /* .w a */
482 #define D3DSP_WRITEMASK_ALL 0x000F0000 /* all */
484 #define D3DSP_DSTMOD_SHIFT 20
485 #define D3DSP_DSTMOD_MASK (0xF << D3DSP_DSTMOD_SHIFT)
487 typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE {
488 D3DSPDM_NONE = 0 << D3DSP_DSTMOD_SHIFT,
489 D3DSPDM_SATURATE = 1 << D3DSP_DSTMOD_SHIFT,
490 D3DSPDM_PARTIALPRECISION = 2 << D3DSP_DSTMOD_SHIFT,
491 D3DSPDM_MSAMPCENTROID = 4 << D3DSP_DSTMOD_SHIFT,
493 D3DSPDM_FORCE_DWORD = 0x7FFFFFFF
494 } D3DSHADER_PARAM_DSTMOD_TYPE;
496 /** destination param */
497 #define D3DSP_DSTSHIFT_SHIFT 24
498 #define D3DSP_DSTSHIFT_MASK (0xF << D3DSP_DSTSHIFT_SHIFT)
500 /** destination/source reg type */
501 #define D3DSP_REGTYPE_SHIFT 28
502 #define D3DSP_REGTYPE_SHIFT2 8
503 #define D3DSP_REGTYPE_MASK (0x7 << D3DSP_REGTYPE_SHIFT)
504 #define D3DSP_REGTYPE_MASK2 0x00001800
506 typedef enum _D3DSHADER_PARAM_REGISTER_TYPE {
514 D3DSPR_TEXCRDOUT = 6,
523 D3DSPR_CONSTBOOL = 14,
525 D3DSPR_TEMPFLOAT16 = 16,
526 D3DSPR_MISCTYPE = 17,
528 D3DSPR_PREDICATE = 19,
530 D3DSPR_FORCE_DWORD = 0x7FFFFFFF
531 } D3DSHADER_PARAM_REGISTER_TYPE;
533 typedef enum _D3DSHADER_MISCTYPE_OFFSETS {
536 } D3DSHADER_MISCTYPE_OFFSETS;
538 typedef enum _D3DVS_RASTOUT_OFFSETS {
541 D3DSRO_POINT_SIZE = 2,
543 D3DSRO_FORCE_DWORD = 0x7FFFFFFF
544 } D3DVS_RASTOUT_OFFSETS;
546 #define D3DVS_ADDRESSMODE_SHIFT 13
547 #define D3DVS_ADDRESSMODE_MASK (0x1 << D3DVS_ADDRESSMODE_SHIFT)
549 typedef enum _D3DVS_ADDRESSMODE_TYPE {
550 D3DVS_ADDRMODE_ABSOLUTE = 0 << D3DVS_ADDRESSMODE_SHIFT,
551 D3DVS_ADDRMODE_RELATIVE = 1 << D3DVS_ADDRESSMODE_SHIFT,
553 D3DVS_ADDRMODE_FORCE_DWORD = 0x7FFFFFFF
554 } D3DVS_ADDRESSMODE_TYPE;
556 #define D3DSHADER_ADDRESSMODE_SHIFT 13
557 #define D3DSHADER_ADDRESSMODE_MASK (1 << D3DSHADER_ADDRESSMODE_SHIFT)
559 typedef enum _D3DSHADER_ADDRESSMODE_TYPE {
560 D3DSHADER_ADDRMODE_ABSOLUTE = 0 << D3DSHADER_ADDRESSMODE_SHIFT,
561 D3DSHADER_ADDRMODE_RELATIVE = 1 << D3DSHADER_ADDRESSMODE_SHIFT,
563 D3DSHADER_ADDRMODE_FORCE_DWORD = 0x7FFFFFFF
564 } D3DSHADER_ADDRESSMODE_TYPE;
567 #define D3DVS_SWIZZLE_SHIFT 16
568 #define D3DVS_SWIZZLE_MASK (0xFF << D3DVS_SWIZZLE_SHIFT)
570 #define D3DSP_SWIZZLE_SHIFT 16
571 #define D3DSP_SWIZZLE_MASK (0xFF << D3DSP_SWIZZLE_SHIFT)
573 #define D3DVS_X_X (0 << D3DVS_SWIZZLE_SHIFT)
574 #define D3DVS_X_Y (1 << D3DVS_SWIZZLE_SHIFT)
575 #define D3DVS_X_Z (2 << D3DVS_SWIZZLE_SHIFT)
576 #define D3DVS_X_W (3 << D3DVS_SWIZZLE_SHIFT)
578 #define D3DVS_Y_X (0 << (D3DVS_SWIZZLE_SHIFT + 2))
579 #define D3DVS_Y_Y (1 << (D3DVS_SWIZZLE_SHIFT + 2))
580 #define D3DVS_Y_Z (2 << (D3DVS_SWIZZLE_SHIFT + 2))
581 #define D3DVS_Y_W (3 << (D3DVS_SWIZZLE_SHIFT + 2))
583 #define D3DVS_Z_X (0 << (D3DVS_SWIZZLE_SHIFT + 4))
584 #define D3DVS_Z_Y (1 << (D3DVS_SWIZZLE_SHIFT + 4))
585 #define D3DVS_Z_Z (2 << (D3DVS_SWIZZLE_SHIFT + 4))
586 #define D3DVS_Z_W (3 << (D3DVS_SWIZZLE_SHIFT + 4))
588 #define D3DVS_W_X (0 << (D3DVS_SWIZZLE_SHIFT + 6))
589 #define D3DVS_W_Y (1 << (D3DVS_SWIZZLE_SHIFT + 6))
590 #define D3DVS_W_Z (2 << (D3DVS_SWIZZLE_SHIFT + 6))
591 #define D3DVS_W_W (3 << (D3DVS_SWIZZLE_SHIFT + 6))
593 #define D3DVS_NOSWIZZLE (D3DVS_X_X | D3DVS_Y_Y | D3DVS_Z_Z | D3DVS_W_W)
595 #define D3DSP_NOSWIZZLE \
596 ((0 << (D3DSP_SWIZZLE_SHIFT + 0)) | (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | (2 << (D3DSP_SWIZZLE_SHIFT + 4)) | (3 << (D3DSP_SWIZZLE_SHIFT + 6)))
598 #define D3DSP_SRCMOD_SHIFT 24
599 #define D3DSP_SRCMOD_MASK (0xF << D3DSP_SRCMOD_SHIFT)
601 typedef enum _D3DSHADER_PARAM_SRCMOD_TYPE {
602 D3DSPSM_NONE = 0 << D3DSP_SRCMOD_SHIFT,
603 D3DSPSM_NEG = 1 << D3DSP_SRCMOD_SHIFT,
604 D3DSPSM_BIAS = 2 << D3DSP_SRCMOD_SHIFT,
605 D3DSPSM_BIASNEG = 3 << D3DSP_SRCMOD_SHIFT,
606 D3DSPSM_SIGN = 4 << D3DSP_SRCMOD_SHIFT,
607 D3DSPSM_SIGNNEG = 5 << D3DSP_SRCMOD_SHIFT,
608 D3DSPSM_COMP = 6 << D3DSP_SRCMOD_SHIFT,
609 D3DSPSM_X2 = 7 << D3DSP_SRCMOD_SHIFT,
610 D3DSPSM_X2NEG = 8 << D3DSP_SRCMOD_SHIFT,
611 D3DSPSM_DZ = 9 << D3DSP_SRCMOD_SHIFT,
612 D3DSPSM_DW = 10 << D3DSP_SRCMOD_SHIFT,
613 D3DSPSM_ABS = 11 << D3DSP_SRCMOD_SHIFT,
614 D3DSPSM_ABSNEG = 12 << D3DSP_SRCMOD_SHIFT,
615 D3DSPSM_NOT = 13 << D3DSP_SRCMOD_SHIFT,
617 D3DSPSM_FORCE_DWORD = 0x7FFFFFFF
618 } D3DSHADER_PARAM_SRCMOD_TYPE;
620 #define D3DPS_VERSION(major, minor) (0xFFFF0000 | ((major) << 8) | (minor))
621 #define D3DVS_VERSION(major, minor) (0xFFFE0000 | ((major) << 8) | (minor))
622 #define D3DSHADER_VERSION_MAJOR(version) (((version) >> 8) & 0xFF)
623 #define D3DSHADER_VERSION_MINOR(version) (((version) >> 0) & 0xFF)
625 #define D3DSI_COMMENTSIZE_SHIFT 16
626 #define D3DSI_COMMENTSIZE_MASK (0x7FFF << D3DSI_COMMENTSIZE_SHIFT)
628 #define D3DSHADER_COMMENT(commentSize) \
629 ((((commentSize) << D3DSI_COMMENTSIZE_SHIFT) & D3DSI_COMMENTSIZE_MASK) | D3DSIO_COMMENT)
631 #define D3DPS_END() 0x0000FFFF
632 #define D3DVS_END() 0x0000FFFF
635 /*****************************************************************************
636 * Direct 3D v8 enumerated types
638 typedef enum _D3DBACKBUFFER_TYPE {
639 D3DBACKBUFFER_TYPE_MONO = 0,
640 D3DBACKBUFFER_TYPE_LEFT = 1,
641 D3DBACKBUFFER_TYPE_RIGHT = 2,
643 D3DBACKBUFFER_TYPE_FORCE_DWORD = 0x7fffffff
644 } D3DBACKBUFFER_TYPE;
646 #define D3DPRESENT_BACK_BUFFER_MAX __MSABI_LONG(3)
648 typedef enum _D3DBASISTYPE {
650 D3DBASIS_BSPLINE = 1,
651 D3DBASIS_INTERPOLATE = 2,
653 D3DBASIS_FORCE_DWORD = 0x7fffffff
656 typedef enum _D3DBLEND {
659 D3DBLEND_SRCCOLOR = 3,
660 D3DBLEND_INVSRCCOLOR = 4,
661 D3DBLEND_SRCALPHA = 5,
662 D3DBLEND_INVSRCALPHA = 6,
663 D3DBLEND_DESTALPHA = 7,
664 D3DBLEND_INVDESTALPHA = 8,
665 D3DBLEND_DESTCOLOR = 9,
666 D3DBLEND_INVDESTCOLOR = 10,
667 D3DBLEND_SRCALPHASAT = 11,
668 D3DBLEND_BOTHSRCALPHA = 12,
669 D3DBLEND_BOTHINVSRCALPHA = 13,
670 D3DBLEND_BLENDFACTOR = 14,
671 D3DBLEND_INVBLENDFACTOR = 15,
672 D3DBLEND_FORCE_DWORD = 0x7fffffff
675 typedef enum _D3DBLENDOP {
677 D3DBLENDOP_SUBTRACT = 2,
678 D3DBLENDOP_REVSUBTRACT = 3,
682 D3DBLENDOP_FORCE_DWORD = 0x7fffffff
685 typedef enum _D3DCMPFUNC {
689 D3DCMP_LESSEQUAL = 4,
692 D3DCMP_GREATEREQUAL = 7,
695 D3DCMP_FORCE_DWORD = 0x7fffffff
698 typedef enum _D3DCUBEMAP_FACES {
699 D3DCUBEMAP_FACE_POSITIVE_X = 0,
700 D3DCUBEMAP_FACE_NEGATIVE_X = 1,
701 D3DCUBEMAP_FACE_POSITIVE_Y = 2,
702 D3DCUBEMAP_FACE_NEGATIVE_Y = 3,
703 D3DCUBEMAP_FACE_POSITIVE_Z = 4,
704 D3DCUBEMAP_FACE_NEGATIVE_Z = 5,
706 D3DCUBEMAP_FACE_FORCE_DWORD = 0xffffffff
709 typedef enum _D3DCULL {
714 D3DCULL_FORCE_DWORD = 0x7fffffff
717 typedef enum _D3DDEBUGMONITORTOKENS {
721 D3DDMT_FORCE_DWORD = 0x7fffffff
722 } D3DDEBUGMONITORTOKENS;
724 typedef enum _D3DDEGREETYPE {
725 D3DDEGREE_LINEAR = 1,
726 D3DDEGREE_QUADRATIC = 2,
728 D3DDEGREE_QUINTIC = 5,
730 D3DDEGREE_FORCE_DWORD = 0x7fffffff
733 typedef enum _D3DDEVTYPE {
737 D3DDEVTYPE_NULLREF = 4,
739 D3DDEVTYPE_FORCE_DWORD = 0xffffffff
742 typedef enum _D3DFILLMODE {
744 D3DFILL_WIREFRAME = 2,
747 D3DFILL_FORCE_DWORD = 0x7fffffff
750 typedef enum _D3DFOGMODE {
756 D3DFOG_FORCE_DWORD = 0x7fffffff
759 typedef enum _D3DFORMAT {
763 D3DFMT_A8R8G8B8 = 21,
764 D3DFMT_X8R8G8B8 = 22,
766 D3DFMT_X1R5G5B5 = 24,
767 D3DFMT_A1R5G5B5 = 25,
768 D3DFMT_A4R4G4B4 = 26,
771 D3DFMT_A8R3G3B2 = 29,
772 D3DFMT_X4R4G4B4 = 30,
773 D3DFMT_A2B10G10R10 = 31,
774 D3DFMT_A8B8G8R8 = 32,
775 D3DFMT_X8B8G8R8 = 33,
777 D3DFMT_A2R10G10B10 = 35,
778 D3DFMT_A16B16G16R16 = 36,
790 D3DFMT_X8L8V8U8 = 62,
791 D3DFMT_Q8W8V8U8 = 63,
793 D3DFMT_A2W10V10U10 = 67,
795 D3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'),
796 D3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'),
797 D3DFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'),
798 D3DFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'),
799 D3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'),
800 D3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'),
801 D3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'),
802 D3DFMT_MULTI2_ARGB8 = MAKEFOURCC('M', 'E', 'T', '1'),
803 D3DFMT_G8R8_G8B8 = MAKEFOURCC('G', 'R', 'G', 'B'),
804 D3DFMT_R8G8_B8G8 = MAKEFOURCC('R', 'G', 'B', 'G'),
806 D3DFMT_D16_LOCKABLE = 70,
814 D3DFMT_D32F_LOCKABLE = 82,
817 D3DFMT_VERTEXDATA = 100,
818 D3DFMT_INDEX16 = 101,
819 D3DFMT_INDEX32 = 102,
820 D3DFMT_Q16W16V16U16 = 110,
821 /* Floating point formats */
823 D3DFMT_G16R16F = 112,
824 D3DFMT_A16B16G16R16F = 113,
828 D3DFMT_G32R32F = 115,
829 D3DFMT_A32B32G32R32F = 116,
834 D3DFMT_FORCE_DWORD = 0xFFFFFFFF
837 typedef enum _D3DLIGHTTYPE {
840 D3DLIGHT_DIRECTIONAL = 3,
842 D3DLIGHT_FORCE_DWORD = 0x7fffffff
845 typedef enum _D3DMATERIALCOLORSOURCE {
850 D3DMCS_FORCE_DWORD = 0x7fffffff
851 } D3DMATERIALCOLORSOURCE;
853 typedef enum _D3DMULTISAMPLE_TYPE {
854 D3DMULTISAMPLE_NONE = 0,
855 D3DMULTISAMPLE_NONMASKABLE = 1,
856 D3DMULTISAMPLE_2_SAMPLES = 2,
857 D3DMULTISAMPLE_3_SAMPLES = 3,
858 D3DMULTISAMPLE_4_SAMPLES = 4,
859 D3DMULTISAMPLE_5_SAMPLES = 5,
860 D3DMULTISAMPLE_6_SAMPLES = 6,
861 D3DMULTISAMPLE_7_SAMPLES = 7,
862 D3DMULTISAMPLE_8_SAMPLES = 8,
863 D3DMULTISAMPLE_9_SAMPLES = 9,
864 D3DMULTISAMPLE_10_SAMPLES = 10,
865 D3DMULTISAMPLE_11_SAMPLES = 11,
866 D3DMULTISAMPLE_12_SAMPLES = 12,
867 D3DMULTISAMPLE_13_SAMPLES = 13,
868 D3DMULTISAMPLE_14_SAMPLES = 14,
869 D3DMULTISAMPLE_15_SAMPLES = 15,
870 D3DMULTISAMPLE_16_SAMPLES = 16,
872 D3DMULTISAMPLE_FORCE_DWORD = 0x7fffffff
873 } D3DMULTISAMPLE_TYPE;
876 typedef enum _D3DORDERTYPE {
878 D3DORDER_QUADRATIC = 2,
880 D3DORDER_QUINTIC = 5,
882 D3DORDER_FORCE_DWORD = 0x7fffffff
885 typedef enum _D3DPATCHEDGESTYLE {
886 D3DPATCHEDGE_DISCRETE = 0,
887 D3DPATCHEDGE_CONTINUOUS = 1,
889 D3DPATCHEDGE_FORCE_DWORD = 0x7fffffff,
892 typedef enum _D3DPOOL {
895 D3DPOOL_SYSTEMMEM = 2,
898 D3DPOOL_FORCE_DWORD = 0x7fffffff
901 typedef enum _D3DPRIMITIVETYPE {
905 D3DPT_TRIANGLELIST = 4,
906 D3DPT_TRIANGLESTRIP = 5,
907 D3DPT_TRIANGLEFAN = 6,
909 D3DPT_FORCE_DWORD = 0x7fffffff
912 typedef enum _D3DRENDERSTATETYPE {
916 D3DRS_ZWRITEENABLE = 14,
917 D3DRS_ALPHATESTENABLE = 15,
918 D3DRS_LASTPIXEL = 16,
920 D3DRS_DESTBLEND = 20,
924 D3DRS_ALPHAFUNC = 25,
925 D3DRS_DITHERENABLE = 26,
926 D3DRS_ALPHABLENDENABLE = 27,
927 D3DRS_FOGENABLE = 28,
928 D3DRS_SPECULARENABLE = 29,
930 D3DRS_FOGTABLEMODE = 35,
933 D3DRS_FOGDENSITY = 38,
934 D3DRS_RANGEFOGENABLE = 48,
935 D3DRS_STENCILENABLE = 52,
936 D3DRS_STENCILFAIL = 53,
937 D3DRS_STENCILZFAIL = 54,
938 D3DRS_STENCILPASS = 55,
939 D3DRS_STENCILFUNC = 56,
940 D3DRS_STENCILREF = 57,
941 D3DRS_STENCILMASK = 58,
942 D3DRS_STENCILWRITEMASK = 59,
943 D3DRS_TEXTUREFACTOR = 60,
952 D3DRS_CLIPPING = 136,
953 D3DRS_LIGHTING = 137,
955 D3DRS_FOGVERTEXMODE = 140,
956 D3DRS_COLORVERTEX = 141,
957 D3DRS_LOCALVIEWER = 142,
958 D3DRS_NORMALIZENORMALS = 143,
959 D3DRS_DIFFUSEMATERIALSOURCE = 145,
960 D3DRS_SPECULARMATERIALSOURCE = 146,
961 D3DRS_AMBIENTMATERIALSOURCE = 147,
962 D3DRS_EMISSIVEMATERIALSOURCE = 148,
963 D3DRS_VERTEXBLEND = 151,
964 D3DRS_CLIPPLANEENABLE = 152,
965 D3DRS_POINTSIZE = 154,
966 D3DRS_POINTSIZE_MIN = 155,
967 D3DRS_POINTSPRITEENABLE = 156,
968 D3DRS_POINTSCALEENABLE = 157,
969 D3DRS_POINTSCALE_A = 158,
970 D3DRS_POINTSCALE_B = 159,
971 D3DRS_POINTSCALE_C = 160,
972 D3DRS_MULTISAMPLEANTIALIAS = 161,
973 D3DRS_MULTISAMPLEMASK = 162,
974 D3DRS_PATCHEDGESTYLE = 163,
975 D3DRS_DEBUGMONITORTOKEN = 165,
976 D3DRS_POINTSIZE_MAX = 166,
977 D3DRS_INDEXEDVERTEXBLENDENABLE = 167,
978 D3DRS_COLORWRITEENABLE = 168,
979 D3DRS_TWEENFACTOR = 170,
981 D3DRS_POSITIONDEGREE = 172,
982 D3DRS_NORMALDEGREE = 173,
983 D3DRS_SCISSORTESTENABLE = 174,
984 D3DRS_SLOPESCALEDEPTHBIAS = 175,
985 D3DRS_ANTIALIASEDLINEENABLE = 176,
986 D3DRS_MINTESSELLATIONLEVEL = 178,
987 D3DRS_MAXTESSELLATIONLEVEL = 179,
988 D3DRS_ADAPTIVETESS_X = 180,
989 D3DRS_ADAPTIVETESS_Y = 181,
990 D3DRS_ADAPTIVETESS_Z = 182,
991 D3DRS_ADAPTIVETESS_W = 183,
992 D3DRS_ENABLEADAPTIVETESSELLATION= 184,
993 D3DRS_TWOSIDEDSTENCILMODE = 185,
994 D3DRS_CCW_STENCILFAIL = 186,
995 D3DRS_CCW_STENCILZFAIL = 187,
996 D3DRS_CCW_STENCILPASS = 188,
997 D3DRS_CCW_STENCILFUNC = 189,
998 D3DRS_COLORWRITEENABLE1 = 190,
999 D3DRS_COLORWRITEENABLE2 = 191,
1000 D3DRS_COLORWRITEENABLE3 = 192,
1001 D3DRS_BLENDFACTOR = 193,
1002 D3DRS_SRGBWRITEENABLE = 194,
1003 D3DRS_DEPTHBIAS = 195,
1012 D3DRS_SEPARATEALPHABLENDENABLE = 206,
1013 D3DRS_SRCBLENDALPHA = 207,
1014 D3DRS_DESTBLENDALPHA = 208,
1015 D3DRS_BLENDOPALPHA = 209,
1017 D3DRS_FORCE_DWORD = 0x7fffffff
1018 } D3DRENDERSTATETYPE;
1020 typedef enum _D3DRESOURCETYPE {
1021 D3DRTYPE_SURFACE = 1,
1022 D3DRTYPE_VOLUME = 2,
1023 D3DRTYPE_TEXTURE = 3,
1024 D3DRTYPE_VOLUMETEXTURE = 4,
1025 D3DRTYPE_CUBETEXTURE = 5,
1026 D3DRTYPE_VERTEXBUFFER = 6,
1027 D3DRTYPE_INDEXBUFFER = 7,
1029 D3DRTYPE_FORCE_DWORD = 0x7fffffff
1032 #define D3DRTYPECOUNT (D3DRTYPE_INDEXBUFFER+1)
1034 typedef enum _D3DSHADEMODE {
1036 D3DSHADE_GOURAUD = 2,
1039 D3DSHADE_FORCE_DWORD = 0x7fffffff
1042 typedef enum _D3DSTATEBLOCKTYPE {
1044 D3DSBT_PIXELSTATE = 2,
1045 D3DSBT_VERTEXSTATE = 3,
1047 D3DSBT_FORCE_DWORD = 0xffffffff
1048 } D3DSTATEBLOCKTYPE;
1050 typedef enum _D3DSTENCILOP {
1051 D3DSTENCILOP_KEEP = 1,
1052 D3DSTENCILOP_ZERO = 2,
1053 D3DSTENCILOP_REPLACE = 3,
1054 D3DSTENCILOP_INCRSAT = 4,
1055 D3DSTENCILOP_DECRSAT = 5,
1056 D3DSTENCILOP_INVERT = 6,
1057 D3DSTENCILOP_INCR = 7,
1058 D3DSTENCILOP_DECR = 8,
1060 D3DSTENCILOP_FORCE_DWORD = 0x7fffffff
1063 typedef enum _D3DSWAPEFFECT {
1064 D3DSWAPEFFECT_DISCARD = 1,
1065 D3DSWAPEFFECT_FLIP = 2,
1066 D3DSWAPEFFECT_COPY = 3,
1067 D3DSWAPEFFECT_FORCE_DWORD = 0xFFFFFFFF
1070 typedef enum _D3DTEXTUREADDRESS {
1071 D3DTADDRESS_WRAP = 1,
1072 D3DTADDRESS_MIRROR = 2,
1073 D3DTADDRESS_CLAMP = 3,
1074 D3DTADDRESS_BORDER = 4,
1075 D3DTADDRESS_MIRRORONCE = 5,
1077 D3DTADDRESS_FORCE_DWORD = 0x7fffffff
1078 } D3DTEXTUREADDRESS;
1080 typedef enum _D3DTEXTUREFILTERTYPE {
1084 D3DTEXF_ANISOTROPIC = 3,
1085 D3DTEXF_FLATCUBIC = 4,
1086 D3DTEXF_GAUSSIANCUBIC = 5,
1087 D3DTEXF_PYRAMIDALQUAD = 6,
1088 D3DTEXF_GAUSSIANQUAD = 7,
1089 D3DTEXF_FORCE_DWORD = 0x7fffffff
1090 } D3DTEXTUREFILTERTYPE;
1092 typedef enum _D3DTEXTUREOP {
1094 D3DTOP_SELECTARG1 = 2,
1095 D3DTOP_SELECTARG2 = 3,
1096 D3DTOP_MODULATE = 4,
1097 D3DTOP_MODULATE2X = 5,
1098 D3DTOP_MODULATE4X = 6,
1100 D3DTOP_ADDSIGNED = 8,
1101 D3DTOP_ADDSIGNED2X = 9,
1102 D3DTOP_SUBTRACT = 10,
1103 D3DTOP_ADDSMOOTH = 11,
1104 D3DTOP_BLENDDIFFUSEALPHA = 12,
1105 D3DTOP_BLENDTEXTUREALPHA = 13,
1106 D3DTOP_BLENDFACTORALPHA = 14,
1107 D3DTOP_BLENDTEXTUREALPHAPM = 15,
1108 D3DTOP_BLENDCURRENTALPHA = 16,
1109 D3DTOP_PREMODULATE = 17,
1110 D3DTOP_MODULATEALPHA_ADDCOLOR = 18,
1111 D3DTOP_MODULATECOLOR_ADDALPHA = 19,
1112 D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
1113 D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
1114 D3DTOP_BUMPENVMAP = 22,
1115 D3DTOP_BUMPENVMAPLUMINANCE = 23,
1116 D3DTOP_DOTPRODUCT3 = 24,
1117 D3DTOP_MULTIPLYADD = 25,
1120 D3DTOP_FORCE_DWORD = 0x7fffffff,
1123 typedef enum _D3DTEXTURESTAGESTATETYPE {
1125 D3DTSS_COLORARG1 = 2,
1126 D3DTSS_COLORARG2 = 3,
1128 D3DTSS_ALPHAARG1 = 5,
1129 D3DTSS_ALPHAARG2 = 6,
1130 D3DTSS_BUMPENVMAT00 = 7,
1131 D3DTSS_BUMPENVMAT01 = 8,
1132 D3DTSS_BUMPENVMAT10 = 9,
1133 D3DTSS_BUMPENVMAT11 = 10,
1134 D3DTSS_TEXCOORDINDEX = 11,
1135 D3DTSS_BUMPENVLSCALE = 22,
1136 D3DTSS_BUMPENVLOFFSET = 23,
1137 D3DTSS_TEXTURETRANSFORMFLAGS = 24,
1138 D3DTSS_COLORARG0 = 26,
1139 D3DTSS_ALPHAARG0 = 27,
1140 D3DTSS_RESULTARG = 28,
1141 D3DTSS_CONSTANT = 32,
1143 D3DTSS_FORCE_DWORD = 0x7fffffff
1144 } D3DTEXTURESTAGESTATETYPE;
1146 typedef enum _D3DTEXTURETRANSFORMFLAGS {
1147 D3DTTFF_DISABLE = 0,
1152 D3DTTFF_PROJECTED = 256,
1154 D3DTTFF_FORCE_DWORD = 0x7fffffff
1155 } D3DTEXTURETRANSFORMFLAGS;
1157 typedef enum _D3DTRANSFORMSTATETYPE {
1159 D3DTS_PROJECTION = 3,
1160 D3DTS_TEXTURE0 = 16,
1161 D3DTS_TEXTURE1 = 17,
1162 D3DTS_TEXTURE2 = 18,
1163 D3DTS_TEXTURE3 = 19,
1164 D3DTS_TEXTURE4 = 20,
1165 D3DTS_TEXTURE5 = 21,
1166 D3DTS_TEXTURE6 = 22,
1167 D3DTS_TEXTURE7 = 23,
1169 D3DTS_FORCE_DWORD = 0x7fffffff
1170 } D3DTRANSFORMSTATETYPE;
1172 typedef enum _D3DVERTEXBLENDFLAGS {
1174 D3DVBF_1WEIGHTS = 1,
1175 D3DVBF_2WEIGHTS = 2,
1176 D3DVBF_3WEIGHTS = 3,
1177 D3DVBF_TWEENING = 255,
1178 D3DVBF_0WEIGHTS = 256
1179 } D3DVERTEXBLENDFLAGS;
1181 typedef enum _D3DZBUFFERTYPE {
1186 D3DZB_FORCE_DWORD = 0x7fffffff
1189 typedef enum _D3DSAMPLERSTATETYPE {
1190 D3DSAMP_ADDRESSU = 1,
1191 D3DSAMP_ADDRESSV = 2,
1192 D3DSAMP_ADDRESSW = 3,
1193 D3DSAMP_BORDERCOLOR = 4,
1194 D3DSAMP_MAGFILTER = 5,
1195 D3DSAMP_MINFILTER = 6,
1196 D3DSAMP_MIPFILTER = 7,
1197 D3DSAMP_MIPMAPLODBIAS = 8,
1198 D3DSAMP_MAXMIPLEVEL = 9,
1199 D3DSAMP_MAXANISOTROPY = 10,
1200 D3DSAMP_SRGBTEXTURE = 11,
1201 D3DSAMP_ELEMENTINDEX = 12,
1202 D3DSAMP_DMAPOFFSET = 13,
1204 D3DSAMP_FORCE_DWORD = 0x7fffffff,
1205 } D3DSAMPLERSTATETYPE;
1208 /*****************************************************************************
1209 * Direct 3D v9 typedefs
1211 #ifndef D3DCOLOR_DEFINED
1212 typedef DWORD D3DCOLOR;
1213 #define D3DCOLOR_DEFINED
1216 /*****************************************************************************
1217 * Direct 3D v9 structures
1219 typedef struct _D3DADAPTER_IDENTIFIER9 {
1220 char Driver[MAX_DEVICE_IDENTIFIER_STRING];
1221 char Description[MAX_DEVICE_IDENTIFIER_STRING];
1222 char DeviceName[32];
1223 LARGE_INTEGER DriverVersion;
1230 GUID DeviceIdentifier;
1233 } D3DADAPTER_IDENTIFIER9;
1235 typedef struct _D3DBOX {
1244 typedef struct _D3DCLIPSTATUS9 {
1246 DWORD ClipIntersection;
1249 #ifndef D3DCOLORVALUE_DEFINED
1250 typedef struct _D3DCOLORVALUE {
1256 #define D3DCOLORVALUE_DEFINED
1259 typedef struct _D3DDEVICE_CREATION_PARAMETERS {
1260 UINT AdapterOrdinal;
1261 D3DDEVTYPE DeviceType;
1263 DWORD BehaviorFlags;
1264 } D3DDEVICE_CREATION_PARAMETERS;
1266 typedef struct _D3DDEVINFO_D3D9BANDWIDTHTIMINGS {
1267 float MaxBandwidthUtilized;
1268 float FrontEndUploadMemoryUtilizedPercent;
1269 float VertexRateUtilizedPercent;
1270 float TriangleSetupRateUtilizedPercent;
1271 float FillRateUtilizedPercent;
1272 } D3DDEVINFO_D3D9BANDWIDTHTIMINGS;
1274 typedef struct _D3DDEVINFO_D3D9CACHEUTILIZATION {
1275 float TextureCacheHitRate;
1276 float PostTransformVertexCacheHitRate;
1277 } D3DDEVINFO_D3D9CACHEUTILIZATION;
1279 typedef struct _D3DDEVINFO_D3D9INTERFACETIMINGS {
1280 float WaitingForGPUToUseApplicationResourceTimePercent;
1281 float WaitingForGPUToAcceptMoreCommandsTimePercent;
1282 float WaitingForGPUToStayWithinLatencyTimePercent;
1283 float WaitingForGPUExclusiveResourceTimePercent;
1284 float WaitingForGPUOtherTimePercent;
1285 } D3DDEVINFO_D3D9INTERFACETIMINGS;
1287 typedef struct _D3DDEVINFO_D3D9PIPELINETIMINGS {
1288 float VertexProcessingTimePercent;
1289 float PixelProcessingTimePercent;
1290 float OtherGPUProcessingTimePercent;
1291 float GPUIdleTimePercent;
1292 } D3DDEVINFO_D3D9PIPELINETIMINGS;
1294 typedef struct _D3DDEVINFO_D3D9STAGETIMINGS {
1295 float MemoryProcessingPercent;
1296 float ComputationProcessingPercent;
1297 } D3DDEVINFO_D3D9STAGETIMINGS;
1300 /* Vertex cache optimization hints. */
1301 typedef struct D3DDEVINFO_VCACHE {
1302 /* Must be a 4 char code FOURCC (e.g. CACH) */
1304 /* 0 to get the longest strips, 1 vertex cache */
1306 /* Cache size to use (only valid if OptMethod==1) */
1308 /* internal for deciding when to restart strips, non user modifiable (only valid if OptMethod==1) */
1310 } D3DDEVINFO_VCACHE;
1312 typedef struct D3DRESOURCESTATS {
1314 DWORD ApproxBytesDownloaded;
1316 DWORD NumVidCreates;
1319 DWORD NumUsedInVidMem;
1321 DWORD WorkingSetBytes;
1326 typedef struct _D3DDEVINFO_D3DRESOURCEMANAGER {
1327 D3DRESOURCESTATS stats[D3DRTYPECOUNT];
1328 } D3DDEVINFO_D3DRESOURCEMANAGER;
1330 typedef struct _D3DDEVINFO_D3DVERTEXSTATS {
1331 DWORD NumRenderedTriangles;
1332 DWORD NumExtraClippingTriangles;
1333 } D3DDEVINFO_D3DVERTEXSTATS;
1335 typedef struct _D3DDISPLAYMODE {
1342 typedef struct _D3DGAMMARAMP {
1348 typedef struct _D3DINDEXBUFFER_DESC {
1350 D3DRESOURCETYPE Type;
1354 } D3DINDEXBUFFER_DESC;
1356 #ifndef D3DVECTOR_DEFINED
1357 typedef struct _D3DVECTOR {
1362 #define D3DVECTOR_DEFINED
1365 typedef struct _D3DLIGHT9 {
1367 D3DCOLORVALUE Diffuse;
1368 D3DCOLORVALUE Specular;
1369 D3DCOLORVALUE Ambient;
1371 D3DVECTOR Direction;
1381 typedef struct _D3DLINEPATTERN {
1386 typedef struct _D3DLOCKED_BOX {
1392 typedef struct _D3DLOCKED_RECT {
1397 typedef struct _D3DMATERIAL9 {
1398 D3DCOLORVALUE Diffuse;
1399 D3DCOLORVALUE Ambient;
1400 D3DCOLORVALUE Specular;
1401 D3DCOLORVALUE Emissive;
1405 #ifndef D3DMATRIX_DEFINED
1406 typedef struct _D3DMATRIX {
1409 float _11, _12, _13, _14;
1410 float _21, _22, _23, _24;
1411 float _31, _32, _33, _34;
1412 float _41, _42, _43, _44;
1417 #define D3DMATRIX_DEFINED
1420 typedef struct _D3DPRESENT_PARAMETERS_ {
1421 UINT BackBufferWidth;
1422 UINT BackBufferHeight;
1423 D3DFORMAT BackBufferFormat;
1424 UINT BackBufferCount;
1426 D3DMULTISAMPLE_TYPE MultiSampleType;
1427 DWORD MultiSampleQuality;
1429 D3DSWAPEFFECT SwapEffect;
1432 BOOL EnableAutoDepthStencil;
1433 D3DFORMAT AutoDepthStencilFormat;
1436 UINT FullScreen_RefreshRateInHz;
1437 UINT PresentationInterval;
1439 } D3DPRESENT_PARAMETERS;
1441 typedef struct _D3DRANGE {
1446 typedef struct _D3DRASTER_STATUS {
1451 #ifndef D3DRECT_DEFINED
1452 typedef struct _D3DRECT {
1458 #define D3DRECT_DEFINED
1461 typedef struct _D3DRECTPATCH_INFO {
1462 UINT StartVertexOffsetWidth;
1463 UINT StartVertexOffsetHeight;
1468 D3DDEGREETYPE Degree;
1469 } D3DRECTPATCH_INFO;
1471 typedef struct _D3DSURFACE_DESC {
1473 D3DRESOURCETYPE Type;
1476 D3DMULTISAMPLE_TYPE MultiSampleType;
1477 DWORD MultiSampleQuality;
1482 typedef struct _D3DTRIPATCH_INFO {
1483 UINT StartVertexOffset;
1486 D3DDEGREETYPE Degree;
1489 typedef struct _D3DVERTEXBUFFER_DESC {
1491 D3DRESOURCETYPE Type;
1496 } D3DVERTEXBUFFER_DESC;
1498 typedef struct _D3DVIEWPORT9 {
1507 typedef struct _D3DVOLUME_DESC {
1509 D3DRESOURCETYPE Type;
1518 /* Parts added with d3d9ex */
1519 #if !defined(D3D_DISABLE_9EX)
1520 typedef enum D3DSCANLINEORDERING
1522 D3DSCANLINEORDERING_UNKNOWN,
1523 D3DSCANLINEORDERING_PROGRESSIVE,
1524 D3DSCANLINEORDERING_INTERLACED,
1525 } D3DSCANLINEORDERING;
1528 typedef struct D3DDISPLAYMODEFILTER
1532 D3DSCANLINEORDERING ScanLineOrdering;
1533 } D3DDISPLAYMODEFILTER;
1535 typedef struct D3DDISPLAYMODEEX
1542 D3DSCANLINEORDERING ScanLineOrdering;
1545 typedef enum D3DDISPLAYROTATION
1547 D3DDISPLAYROTATION_IDENTITY = 1,
1548 D3DDISPLAYROTATION_90,
1549 D3DDISPLAYROTATION_180,
1550 D3DDISPLAYROTATION_270
1551 } D3DDISPLAYROTATION;
1553 typedef enum _D3DCOMPOSERECTSOP{
1554 D3DCOMPOSERECTS_COPY = 1,
1556 D3DCOMPOSERECTS_AND,
1557 D3DCOMPOSERECTS_NEG,
1558 D3DCOMPOSERECTS_FORCE_DWORD = 0x7fffffff
1559 } D3DCOMPOSERECTSOP;
1560 #endif /* D3D_DISABLE_9EX */
1562 typedef enum _D3DSHADER_COMPARISON
1564 D3DSPC_RESERVED0 = 0,
1572 } D3DSHADER_COMPARISON;
1574 #endif /* __WINE_D3D9TYPES_H */