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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_D3D9TYPES_H
22 #define __WINE_D3D9TYPES_H
24 /*****************************************************************************
25 * Direct 3D v9 #defines
27 #define D3DCLEAR_TARGET 0x00000001L
28 #define D3DCLEAR_ZBUFFER 0x00000002L
29 #define D3DCLEAR_STENCIL 0x00000004L
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 D3DCOLORWRITEENABLED_RED 1
46 #define D3DCOLORWRITEENABLED_GREEN 2
47 #define D3DCOLORWRITEENABLED_BLUE 4
48 #define D3DCOLORWRITEENABLED_ALPHA 8
50 #define D3DCS_LEFT 0x001L
51 #define D3DCS_RIGHT 0x002L
52 #define D3DCS_TOP 0x004L
53 #define D3DCS_BOTTOM 0x008L
54 #define D3DCS_FRONT 0x010L
55 #define D3DCS_BACK 0x020L
56 #define D3DCS_PLANE0 0x040L
57 #define D3DCS_PLANE1 0x080L
58 #define D3DCS_PLANE2 0x100L
59 #define D3DCS_PLANE3 0x200L
60 #define D3DCS_PLANE4 0x400L
61 #define D3DCS_PLANE5 0x800L
62 #define D3DCS_ALL 0xFFFL
64 #define D3DFVF_TEXTUREFORMAT1 3
65 #define D3DFVF_TEXTUREFORMAT2 0
66 #define D3DFVF_TEXTUREFORMAT3 1
67 #define D3DFVF_TEXTUREFORMAT4 2
68 #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
69 #define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2)
70 #define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
71 #define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
73 #define D3DLOCK_READONLY 0x0010
74 #define D3DLOCK_NOSYSLOCK 0x0800
75 #define D3DLOCK_NOOVERWRITE 0x1000
76 #define D3DLOCK_DISCARD 0x2000
77 #define D3DLOCK_DONOTWAIT 0x4000
78 #define D3DLOCK_NO_DIRTY_UPDATE 0x8000
80 #define D3DMAXUSERCLIPPLANES 32
81 #define D3DCLIPPLANE0 (1 << 0)
82 #define D3DCLIPPLANE1 (1 << 1)
83 #define D3DCLIPPLANE2 (1 << 2)
84 #define D3DCLIPPLANE3 (1 << 3)
85 #define D3DCLIPPLANE4 (1 << 4)
86 #define D3DCLIPPLANE5 (1 << 5)
89 #define D3DRENDERSTATE_WRAPBIAS 128UL
91 /* MSDN has this in d3d9caps.h, but it should be here */
92 #define D3DTSS_TCI_PASSTHRU 0x00000
93 #define D3DTSS_TCI_CAMERASPACENORMAL 0x10000
94 #define D3DTSS_TCI_CAMERASPACEPOSITION 0x20000
95 #define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x30000
96 #define D3DTSS_TCI_SPHEREMAP 0x40000
99 #define D3DTS_WORLD D3DTS_WORLDMATRIX(0)
100 #define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1)
101 #define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2)
102 #define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3)
103 #define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256)
105 #define D3DUSAGE_RENDERTARGET 0x00000001L
106 #define D3DUSAGE_DEPTHSTENCIL 0x00000002L
107 #define D3DUSAGE_WRITEONLY 0x00000008L
108 #define D3DUSAGE_SOFTWAREPROCESSING 0x00000010L
109 #define D3DUSAGE_DONOTCLIP 0x00000020L
110 #define D3DUSAGE_POINTS 0x00000040L
111 #define D3DUSAGE_RTPATCHES 0x00000080L
112 #define D3DUSAGE_NPATCHES 0x00000100L
113 #define D3DUSAGE_DYNAMIC 0x00000200L
114 #define D3DUSAGE_AUTOGENMIPMAP 0x00000400L
115 #define D3DUSAGE_DMAP 0x00004000L
117 #define D3DUSAGE_QUERY_FILTER 0x00020000L
118 #define D3DUSAGE_QUERY_LEGACYBUMPMAP 0x00008000L
119 #define D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING 0x00080000L
120 #define D3DUSAGE_QUERY_SRGBREAD 0x00010000L
121 #define D3DUSAGE_QUERY_SRGBWRITE 0x00040000L
122 #define D3DUSAGE_QUERY_VERTEXTEXTURE 0x00100000L
128 #define D3DWRAPCOORD_0 1
129 #define D3DWRAPCOORD_1 2
130 #define D3DWRAPCOORD_2 4
131 #define D3DWRAPCOORD_3 8
133 #define MAX_DEVICE_IDENTIFIER_STRING 512
135 #define D3DFVF_RESERVED0 0x0001
136 #define D3DFVF_POSITION_MASK 0x4000E
137 #define D3DFVF_XYZ 0x0002
138 #define D3DFVF_XYZRHW 0x0004
139 #define D3DFVF_XYZB1 0x0006
140 #define D3DFVF_XYZB2 0x0008
141 #define D3DFVF_XYZB3 0x000a
142 #define D3DFVF_XYZB4 0x000c
143 #define D3DFVF_XYZB5 0x000e
144 #define D3DFVF_XYZW 0x4002
145 #define D3DFVF_NORMAL 0x0010
146 #define D3DFVF_PSIZE 0x0020
147 #define D3DFVF_DIFFUSE 0x0040
148 #define D3DFVF_SPECULAR 0x0080
149 #define D3DFVF_TEXCOUNT_MASK 0x0f00
150 #define D3DFVF_TEXCOUNT_SHIFT 8
151 #define D3DFVF_TEX0 0x0000
152 #define D3DFVF_TEX1 0x0100
153 #define D3DFVF_TEX2 0x0200
154 #define D3DFVF_TEX3 0x0300
155 #define D3DFVF_TEX4 0x0400
156 #define D3DFVF_TEX5 0x0500
157 #define D3DFVF_TEX6 0x0600
158 #define D3DFVF_TEX7 0x0700
159 #define D3DFVF_TEX8 0x0800
160 #define D3DFVF_LASTBETA_UBYTE4 0x1000
161 #define D3DFVF_LASTBETA_D3DCOLOR 0x8000
162 #define D3DFVF_RESERVED2 0x6000
164 #define D3DTA_SELECTMASK 0x0000000f
165 #define D3DTA_DIFFUSE 0x00000000
166 #define D3DTA_CURRENT 0x00000001
167 #define D3DTA_TEXTURE 0x00000002
168 #define D3DTA_TFACTOR 0x00000003
169 #define D3DTA_SPECULAR 0x00000004
170 #define D3DTA_TEMP 0x00000005
171 #define D3DTA_CONSTANT 0x00000006
172 #define D3DTA_COMPLEMENT 0x00000010
173 #define D3DTA_ALPHAREPLICATE 0x00000020
175 #define D3DCOLORWRITEENABLE_RED (1L<<0)
176 #define D3DCOLORWRITEENABLE_GREEN (1L<<1)
177 #define D3DCOLORWRITEENABLE_BLUE (1L<<2)
178 #define D3DCOLORWRITEENABLE_ALPHA (1L<<3)
180 #define D3DPV_DONOTCOPYDATA (1 << 0)
182 #define D3DSTREAMSOURCE_INDEXEDDATA (1 << 30)
183 #define D3DSTREAMSOURCE_INSTANCEDATA (2 << 30)
185 #define D3D_MAX_SIMULTANEOUS_RENDERTARGETS 4
187 #define MAXD3DDECLLENGTH 64 /* +end marker */
188 #define MAXD3DDECLMETHOD D3DDECLMETHOD_LOOKUPPRESAMPLED
189 #define MAXD3DDECLTYPE D3DDECLTYPE_UNUSED
190 #define MAXD3DDECLUSAGE D3DDECLUSAGE_SAMPLE
191 #define MAXD3DDECLUSAGEINDEX 15
193 #define D3DDMAPSAMPLER 256
194 #define D3DVERTEXTEXTURESAMPLER0 (D3DDMAPSAMPLER+1)
195 #define D3DVERTEXTEXTURESAMPLER1 (D3DDMAPSAMPLER+2)
196 #define D3DVERTEXTEXTURESAMPLER2 (D3DDMAPSAMPLER+3)
197 #define D3DVERTEXTEXTURESAMPLER3 (D3DDMAPSAMPLER+4)
199 #define MAKEFOURCC(ch0, ch1, ch2, ch3) \
200 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
201 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
203 /* Constants used by D3DPRESENT_PARAMETERS. when creating a device or swapchain */
205 #define D3DPRESENTFLAG_LOCKABLE_BACKBUFFER 0x00000001 /* Create a lockable backbuffer */
206 #define D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL 0x00000002 /* Discard Z buffer */
207 #define D3DPRESENTFLAG_DEVICECLIP 0x00000004 /* Clip the window blited into the client area 2k + xp only */
208 #define D3DPRESENTFLAG_VIDEO 0x00000010 /* backbuffer 'may' contain video data */
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 /* MSDN is quite confussing at this point...
234 http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/reference/d3d/constants/OTHER_D3D.asp
235 says D3DMAX, and D3DMAXDECLUSAGE = D3DDECLUSAGE_DEPTH
236 http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/directx9_c_summer_03/directx/graphics/reference/d3d/constants/other_d3d.asp
237 says MAXD3D, and D3DDECLUSAGE_SAMPLE
242 #define D3DMAXDECLUSAGE D3DDECLUSAGE_SAMPLE
243 #define D3DMAXDECLUSAGEINDEX 15
244 #define D3DMAXDECLLENGTH 18
245 #define D3DMAXDECLUSAGE_DX8 D3DDECLUSAGE_TEXCOORD
247 typedef enum _D3DDECLMETHOD {
248 D3DDECLMETHOD_DEFAULT = 0,
249 D3DDECLMETHOD_PARTIALU = 1,
250 D3DDECLMETHOD_PARTIALV = 2,
251 D3DDECLMETHOD_CROSSUV = 3,
252 D3DDECLMETHOD_UV = 4,
253 D3DDECLMETHOD_LOOKUP = 5,
254 D3DDECLMETHOD_LOOKUPPRESAMPLED = 6
258 #define D3DMAXDECLMETHOD D3DDECLMETHOD_LOOKUPPRESAMPLED
260 typedef enum _D3DDECLTYPE {
261 D3DDECLTYPE_FLOAT1 = 0,
262 D3DDECLTYPE_FLOAT2 = 1,
263 D3DDECLTYPE_FLOAT3 = 2,
264 D3DDECLTYPE_FLOAT4 = 3,
265 D3DDECLTYPE_D3DCOLOR = 4,
266 D3DDECLTYPE_UBYTE4 = 5,
267 D3DDECLTYPE_SHORT2 = 6,
268 D3DDECLTYPE_SHORT4 = 7,
270 D3DDECLTYPE_UBYTE4N = 8,
271 D3DDECLTYPE_SHORT2N = 9,
272 D3DDECLTYPE_SHORT4N = 10,
273 D3DDECLTYPE_USHORT2N = 11,
274 D3DDECLTYPE_USHORT4N = 12,
275 D3DDECLTYPE_UDEC3 = 13,
276 D3DDECLTYPE_DEC3N = 14,
277 D3DDECLTYPE_FLOAT16_2 = 15,
278 D3DDECLTYPE_FLOAT16_4 = 16,
279 D3DDECLTYPE_UNUSED = 17,
282 #define D3DMAXDECLTYPE D3DDECLTYPE_UNUSED
284 typedef struct _D3DVERTEXELEMENT9 {
291 } D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9;
294 typedef enum _D3DQUERYTYPE {
295 D3DQUERYTYPE_VCACHE = 4,
296 D3DQUERYTYPE_RESOURCEMANAGER = 5,
297 D3DQUERYTYPE_VERTEXSTATS = 6,
298 D3DQUERYTYPE_EVENT = 8,
299 D3DQUERYTYPE_OCCLUSION = 9,
300 D3DQUERYTYPE_TIMESTAMP = 10,
301 D3DQUERYTYPE_TIMESTAMPDISJOINT = 11,
302 D3DQUERYTYPE_TIMESTAMPFREQ = 12,
303 D3DQUERYTYPE_PIPELINETIMINGS = 13,
304 D3DQUERYTYPE_INTERFACETIMINGS = 14,
305 D3DQUERYTYPE_VERTEXTIMINGS = 15,
306 D3DQUERYTYPE_PIXELTIMINGS = 16,
307 D3DQUERYTYPE_BANDWIDTHTIMINGS = 17,
308 D3DQUERYTYPE_CACHEUTILIZATION = 18
311 #define D3DISSUE_BEGIN (1 << 1)
312 #define D3DISSUE_END (1 << 0)
313 #define D3DGETDATA_FLUSH (1 << 0)
316 #define D3DDECL_END() {0xFF,0,D3DDECLTYPE_UNUSED,0,0,0}
317 #define D3DDP_MAXTEXCOORD 8
320 #define D3DVSD_MAKETOKENTYPE(TokenType) \
321 ((TokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK)
323 #define D3DVSD_CONST(ConstantAddress, Count) \
324 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | ((Count) << D3DVSD_CONSTCOUNTSHIFT) | (ConstantAddress))
326 #define D3DVSD_END() 0xFFFFFFFF
328 #define D3DVSD_NOP() 0x00000000
330 #define D3DVSD_REG(VertexRegister, Type) \
331 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | ((Type) << D3DVSD_DATATYPESHIFT) | (VertexRegister))
333 #define D3DVSD_SKIP(Count) \
334 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | ((Count) << D3DVSD_SKIPCOUNTSHIFT))
336 #define D3DVSD_STREAM(StreamNumber) \
337 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (StreamNumber))
339 #define D3DVSD_STREAM_TESS() \
340 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK))
342 #define D3DVSD_TESSNORMAL(RegisterIn, RegisterOut) \
343 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | ((RegisterIn) << D3DVSD_VERTEXREGINSHIFT) | ((0x02) << D3DVSD_DATATYPESHIFT) | (RegisterOut))
345 #define D3DVSD_TESSUV(Register) \
346 (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | ((0x01) << D3DVSD_DATATYPESHIFT) | (Register))
349 /********************************
350 * Pixel/Vertex Shaders Functions
353 /** Maximum number of supported texture coordinates sets operation */
354 #define D3DDP_MAXTEXCOORD 8
356 /** opcode token mask */
357 #define D3DSI_OPCODE_MASK 0x0000FFFF
358 #define D3DSI_INSTLENGTH_MASK 0x0F000000
359 #define D3DSI_INSTLENGTH_SHIFT 24
361 /** opcodes types for PS and VS */
362 typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE {
413 D3DSIO_TEXCOORD = 64,
418 D3DSIO_TEXREG2AR = 69,
419 D3DSIO_TEXREG2GB = 70,
420 D3DSIO_TEXM3x2PAD = 71,
421 D3DSIO_TEXM3x2TEX = 72,
422 D3DSIO_TEXM3x3PAD = 73,
423 D3DSIO_TEXM3x3TEX = 74,
424 D3DSIO_TEXM3x3DIFF = 75,
425 D3DSIO_TEXM3x3SPEC = 76,
426 D3DSIO_TEXM3x3VSPEC = 77,
431 D3DSIO_TEXREG2RGB = 82,
432 D3DSIO_TEXDP3TEX = 83,
433 D3DSIO_TEXM3x2DEPTH = 84,
436 D3DSIO_TEXDEPTH = 87,
447 D3DSIO_PHASE = 0xFFFD,
448 D3DSIO_COMMENT = 0xFFFE,
451 D3DSIO_FORCE_DWORD = 0X7FFFFFFF /** for 32-bit alignment */
452 } D3DSHADER_INSTRUCTION_OPCODE_TYPE;
454 #define D3DSINCOSCONST1 -1.5500992e-006f, -2.1701389e-005f, 0.0026041667f, 0.00026041668f
455 #define D3DSINCOSCONST2 -0.020833334f, -0.12500000f, 1.0f, 0.50000000f
457 #define D3DSHADER_INSTRUCTION_PREDICATED (1 << 28)
459 /** for parallelism */
460 #define D3DSI_COISSUE 0x40000000
462 #define D3DSP_DCL_USAGE_SHIFT 0
463 #define D3DSP_DCL_USAGE_MASK 0x0000000f
465 #define D3DSP_DCL_USAGEINDEX_SHIFT 16
466 #define D3DSP_DCL_USAGEINDEX_MASK 0x000f0000
468 #define D3DSP_TEXTURETYPE_SHIFT 27
469 #define D3DSP_TEXTURETYPE_MASK 0x78000000
471 typedef enum _D3DSAMPLER_TEXTURE_TYPE {
472 D3DSTT_UNKNOWN = 0 << D3DSP_TEXTURETYPE_SHIFT,
473 D3DSTT_2D = 2 << D3DSP_TEXTURETYPE_SHIFT,
474 D3DSTT_CUBE = 3 << D3DSP_TEXTURETYPE_SHIFT,
475 D3DSTT_VOLUME = 4 << D3DSP_TEXTURETYPE_SHIFT,
477 D3DSTT_FORCE_DWORD = 0x7FFFFFFF
478 } D3DSAMPLER_TEXTURE_TYPE;
480 #define D3DSP_REGNUM_MASK 0x000007FF
482 /** destination parameter modifiers (.xyzw) */
483 #define D3DSP_WRITEMASK_0 0x00010000 /* .x r */
484 #define D3DSP_WRITEMASK_1 0x00020000 /* .y g */
485 #define D3DSP_WRITEMASK_2 0x00040000 /* .z b */
486 #define D3DSP_WRITEMASK_3 0x00080000 /* .w a */
487 #define D3DSP_WRITEMASK_ALL 0x000F0000 /* all */
489 #define D3DSP_DSTMOD_SHIFT 20
490 #define D3DSP_DSTMOD_MASK (0xF << D3DSP_DSTMOD_SHIFT)
492 typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE {
493 D3DSPDM_NONE = 0 << D3DSP_DSTMOD_SHIFT,
494 D3DSPDM_SATURATE = 1 << D3DSP_DSTMOD_SHIFT,
495 D3DSPDM_PARTIALPRECISION = 2 << D3DSP_DSTMOD_SHIFT,
496 D3DSPDM_MSAMPCENTROID = 4 << D3DSP_DSTMOD_SHIFT,
498 D3DSPDM_FORCE_DWORD = 0x7FFFFFFF
499 } D3DSHADER_PARAM_DSTMOD_TYPE;
501 /** destination param */
502 #define D3DSP_DSTSHIFT_SHIFT 24
503 #define D3DSP_DSTSHIFT_MASK (0xF << D3DSP_DSTSHIFT_SHIFT)
505 /** destination/source reg type */
506 #define D3DSP_REGTYPE_SHIFT 28
507 #define D3DSP_REGTYPE_SHIFT2 8
508 #define D3DSP_REGTYPE_MASK (0x7 << D3DSP_REGTYPE_SHIFT)
509 #define D3DSP_REGTYPE_MASK2 0x00001800
511 typedef enum _D3DSHADER_PARAM_REGISTER_TYPE {
519 D3DSPR_TEXCRDOUT = 6,
528 D3DSPR_CONSTBOOL = 14,
530 D3DSPR_TEMPFLOAT16 = 16,
531 D3DSPR_MISCTYPE = 17,
533 D3DSPR_PREDICATE = 19,
535 D3DSPR_FORCE_DWORD = 0x7FFFFFFF
536 } D3DSHADER_PARAM_REGISTER_TYPE;
538 typedef enum _D3DSHADER_MISCTYPE_OFFSETS {
541 } D3DSHADER_MISCTYPE_OFFSETS;
543 typedef enum _D3DVS_RASTOUT_OFFSETS {
546 D3DSRO_POINT_SIZE = 2,
548 D3DSRO_FORCE_DWORD = 0x7FFFFFFF
549 } D3DVS_RASTOUT_OFFSETS;
551 #define D3DVS_ADDRESSMODE_SHIFT 13
552 #define D3DVS_ADDRESSMODE_MASK (0x1 << D3DVS_ADDRESSMODE_SHIFT)
554 typedef enum _D3DVS_ADDRESSMODE_TYPE {
555 D3DVS_ADDRMODE_ABSOLUTE = 0 << D3DVS_ADDRESSMODE_SHIFT,
556 D3DVS_ADDRMODE_RELATIVE = 1 << D3DVS_ADDRESSMODE_SHIFT,
558 D3DVS_ADDRMODE_FORCE_DWORD = 0x7FFFFFFF
559 } D3DVS_ADDRESSMODE_TYPE;
561 #define D3DSHADER_ADDRESSMODE_SHIFT 13
562 #define D3DSHADER_ADDRESSMODE_MASK (1 << D3DSHADER_ADDRESSMODE_SHIFT)
564 typedef enum _D3DSHADER_ADDRESSMODE_TYPE {
565 D3DSHADER_ADDRMODE_ABSOLUTE = 0 << D3DSHADER_ADDRESSMODE_SHIFT,
566 D3DSHADER_ADDRMODE_RELATIVE = 1 << D3DSHADER_ADDRESSMODE_SHIFT,
568 D3DSHADER_ADDRMODE_FORCE_DWORD = 0x7FFFFFFF
569 } D3DSHADER_ADDRESSMODE_TYPE;
572 #define D3DVS_SWIZZLE_SHIFT 16
573 #define D3DVS_SWIZZLE_MASK (0xFF << D3DVS_SWIZZLE_SHIFT)
575 #define D3DSP_SWIZZLE_SHIFT 16
576 #define D3DSP_SWIZZLE_MASK (0xFF << D3DSP_SWIZZLE_SHIFT)
578 #define D3DVS_X_X (0 << D3DVS_SWIZZLE_SHIFT)
579 #define D3DVS_X_Y (1 << D3DVS_SWIZZLE_SHIFT)
580 #define D3DVS_X_Z (2 << D3DVS_SWIZZLE_SHIFT)
581 #define D3DVS_X_W (3 << D3DVS_SWIZZLE_SHIFT)
583 #define D3DVS_Y_X (0 << (D3DVS_SWIZZLE_SHIFT + 2))
584 #define D3DVS_Y_Y (1 << (D3DVS_SWIZZLE_SHIFT + 2))
585 #define D3DVS_Y_Z (2 << (D3DVS_SWIZZLE_SHIFT + 2))
586 #define D3DVS_Y_W (3 << (D3DVS_SWIZZLE_SHIFT + 2))
588 #define D3DVS_Z_X (0 << (D3DVS_SWIZZLE_SHIFT + 4))
589 #define D3DVS_Z_Y (1 << (D3DVS_SWIZZLE_SHIFT + 4))
590 #define D3DVS_Z_Z (2 << (D3DVS_SWIZZLE_SHIFT + 4))
591 #define D3DVS_Z_W (3 << (D3DVS_SWIZZLE_SHIFT + 4))
593 #define D3DVS_W_X (0 << (D3DVS_SWIZZLE_SHIFT + 6))
594 #define D3DVS_W_Y (1 << (D3DVS_SWIZZLE_SHIFT + 6))
595 #define D3DVS_W_Z (2 << (D3DVS_SWIZZLE_SHIFT + 6))
596 #define D3DVS_W_W (3 << (D3DVS_SWIZZLE_SHIFT + 6))
598 #define D3DVS_NOSWIZZLE (D3DVS_X_X | D3DVS_Y_Y | D3DVS_Z_Z | D3DVS_W_W)
600 #define D3DSP_NOSWIZZLE \
601 ((0 << (D3DSP_SWIZZLE_SHIFT + 0)) | (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | (2 << (D3DSP_SWIZZLE_SHIFT + 4)) | (3 << (D3DSP_SWIZZLE_SHIFT + 6)))
603 #define D3DSP_SRCMOD_SHIFT 24
604 #define D3DSP_SRCMOD_MASK (0xF << D3DSP_SRCMOD_SHIFT)
606 typedef enum _D3DSHADER_PARAM_SRCMOD_TYPE {
607 D3DSPSM_NONE = 0 << D3DSP_SRCMOD_SHIFT,
608 D3DSPSM_NEG = 1 << D3DSP_SRCMOD_SHIFT,
609 D3DSPSM_BIAS = 2 << D3DSP_SRCMOD_SHIFT,
610 D3DSPSM_BIASNEG = 3 << D3DSP_SRCMOD_SHIFT,
611 D3DSPSM_SIGN = 4 << D3DSP_SRCMOD_SHIFT,
612 D3DSPSM_SIGNNEG = 5 << D3DSP_SRCMOD_SHIFT,
613 D3DSPSM_COMP = 6 << D3DSP_SRCMOD_SHIFT,
614 D3DSPSM_X2 = 7 << D3DSP_SRCMOD_SHIFT,
615 D3DSPSM_X2NEG = 8 << D3DSP_SRCMOD_SHIFT,
616 D3DSPSM_DZ = 9 << D3DSP_SRCMOD_SHIFT,
617 D3DSPSM_DW = 10 << D3DSP_SRCMOD_SHIFT,
618 D3DSPSM_ABS = 11 << D3DSP_SRCMOD_SHIFT,
619 D3DSPSM_ABSNEG = 12 << D3DSP_SRCMOD_SHIFT,
620 D3DSPSM_NOT = 13 << D3DSP_SRCMOD_SHIFT,
622 D3DSPSM_FORCE_DWORD = 0x7FFFFFFF
623 } D3DSHADER_PARAM_SRCMOD_TYPE;
625 #define D3DPS_VERSION(major, minor) (0xFFFF0000 | ((major) << 8) | (minor))
626 #define D3DVS_VERSION(major, minor) (0xFFFE0000 | ((major) << 8) | (minor))
627 #define D3DSHADER_VERSION_MAJOR(version) (((version) >> 8) & 0xFF)
628 #define D3DSHADER_VERSION_MINOR(version) (((version) >> 0) & 0xFF)
630 #define D3DSI_COMMENTSIZE_SHIFT 16
631 #define D3DSI_COMMENTSIZE_MASK (0x7FFF << D3DSI_COMMENTSIZE_SHIFT)
633 #define D3DSHADER_COMMENT(commentSize) \
634 ((((commentSize) << D3DSI_COMMENTSIZE_SHIFT) & D3DSI_COMMENTSIZE_MASK) | D3DSIO_COMMENT)
636 #define D3DPS_END() 0x0000FFFF
637 #define D3DVS_END() 0x0000FFFF
640 /*****************************************************************************
641 * Direct 3D v8 enumerated types
643 typedef enum _D3DBACKBUFFER_TYPE {
644 D3DBACKBUFFER_TYPE_MONO = 0,
645 D3DBACKBUFFER_TYPE_LEFT = 1,
646 D3DBACKBUFFER_TYPE_RIGHT = 2,
648 D3DBACKBUFFER_TYPE_FORCE_DWORD = 0x7fffffff
649 } D3DBACKBUFFER_TYPE;
651 #define D3DPRESENT_BACK_BUFFER_MAX 3L
653 typedef enum _D3DBASISTYPE {
655 D3DBASIS_BSPLINE = 1,
656 D3DBASIS_INTERPOLATE = 2,
658 D3DBASIS_FORCE_DWORD = 0x7fffffff
661 typedef enum _D3DBLEND {
664 D3DBLEND_SRCCOLOR = 3,
665 D3DBLEND_INVSRCCOLOR = 4,
666 D3DBLEND_SRCALPHA = 5,
667 D3DBLEND_INVSRCALPHA = 6,
668 D3DBLEND_DESTALPHA = 7,
669 D3DBLEND_INVDESTALPHA = 8,
670 D3DBLEND_DESTCOLOR = 9,
671 D3DBLEND_INVDESTCOLOR = 10,
672 D3DBLEND_SRCALPHASAT = 11,
673 D3DBLEND_BOTHSRCALPHA = 12,
674 D3DBLEND_BOTHINVSRCALPHA = 13,
675 D3DBLEND_BLENDFACTOR = 14,
676 D3DBLEND_INVBLENDFACTOR = 15,
677 D3DBLEND_FORCE_DWORD = 0x7fffffff
680 typedef enum _D3DBLENDOP {
682 D3DBLENDOP_SUBTRACT = 2,
683 D3DBLENDOP_REVSUBTRACT = 3,
687 D3DBLENDOP_FORCE_DWORD = 0x7fffffff
690 typedef enum _D3DCMPFUNC {
694 D3DCMP_LESSEQUAL = 4,
697 D3DCMP_GREATEREQUAL = 7,
700 D3DCMP_FORCE_DWORD = 0x7fffffff
703 typedef enum _D3DCUBEMAP_FACES {
704 D3DCUBEMAP_FACE_POSITIVE_X = 0,
705 D3DCUBEMAP_FACE_NEGATIVE_X = 1,
706 D3DCUBEMAP_FACE_POSITIVE_Y = 2,
707 D3DCUBEMAP_FACE_NEGATIVE_Y = 3,
708 D3DCUBEMAP_FACE_POSITIVE_Z = 4,
709 D3DCUBEMAP_FACE_NEGATIVE_Z = 5,
711 D3DCUBEMAP_FACE_FORCE_DWORD = 0xffffffff
714 typedef enum _D3DCULL {
719 D3DCULL_FORCE_DWORD = 0x7fffffff
722 typedef enum _D3DDEBUGMONITORTOKENS {
726 D3DDMT_FORCE_DWORD = 0x7fffffff
727 } D3DDEBUGMONITORTOKENS;
729 typedef enum _D3DDEGREETYPE {
730 D3DDEGREE_LINEAR = 1,
731 D3DDEGREE_QUADRATIC = 2,
733 D3DDEGREE_QUINTIC = 5,
735 D3DDEGREE_FORCE_DWORD = 0x7fffffff
738 typedef enum _D3DDEVTYPE {
743 D3DDEVTYPE_FORCE_DWORD = 0xffffffff
746 typedef enum _D3DFILLMODE {
748 D3DFILL_WIREFRAME = 2,
751 D3DFILL_FORCE_DWORD = 0x7fffffff
754 typedef enum _D3DFOGMODE {
760 D3DFOG_FORCE_DWORD = 0x7fffffff
763 typedef enum _D3DFORMAT {
767 D3DFMT_A8R8G8B8 = 21,
768 D3DFMT_X8R8G8B8 = 22,
770 D3DFMT_X1R5G5B5 = 24,
771 D3DFMT_A1R5G5B5 = 25,
772 D3DFMT_A4R4G4B4 = 26,
775 D3DFMT_A8R3G3B2 = 29,
776 D3DFMT_X4R4G4B4 = 30,
777 D3DFMT_A2B10G10R10 = 31,
778 D3DFMT_A8B8G8R8 = 32,
779 D3DFMT_X8B8G8R8 = 33,
781 D3DFMT_A2R10G10B10 = 35,
782 D3DFMT_A16B16G16R16 = 36,
794 D3DFMT_X8L8V8U8 = 62,
795 D3DFMT_Q8W8V8U8 = 63,
797 D3DFMT_W11V11U10 = 65,
798 D3DFMT_A2W10V10U10 = 67,
800 D3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'),
801 D3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'),
802 D3DFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'),
803 D3DFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'),
804 D3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'),
805 D3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'),
806 D3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'),
807 D3DFMT_MULTI2_ARGB = MAKEFOURCC('M', 'E', 'T', '1'),
808 D3DFMT_G8R8_G8B8 = MAKEFOURCC('G', 'R', 'G', 'B'),
809 D3DFMT_R8G8_B8G8 = MAKEFOURCC('R', 'G', 'B', 'G'),
811 D3DFMT_D16_LOCKABLE = 70,
817 D3DFMT_D32F_LOCKABLE = 82,
820 D3DFMT_VERTEXDATA = 100,
821 D3DFMT_INDEX16 = 101,
822 D3DFMT_INDEX32 = 102,
823 D3DFMT_Q16W16V16U16 = 110,
824 /* Flaoting point formats */
826 D3DFMT_G16R16F = 112,
827 D3DFMT_A16B16G16R16F = 113,
831 D3DFMT_G32R32F = 115,
832 D3DFMT_A32B32G32R32F = 116,
837 D3DFMT_FORCE_DWORD = 0xFFFFFFFF
840 typedef enum _D3DLIGHTTYPE {
843 D3DLIGHT_DIRECTIONAL = 3,
845 D3DLIGHT_FORCE_DWORD = 0x7fffffff
848 typedef enum _D3DMATERIALCOLORSOURCE {
853 D3DMCS_FORCE_DWORD = 0x7fffffff
854 } D3DMATERIALCOLORSOURCE;
856 typedef enum _D3DMULTISAMPLE_TYPE {
857 D3DMULTISAMPLE_NONE = 0,
858 D3DMULTISAMPLE_NONMASKABLE = 1,
859 D3DMULTISAMPLE_2_SAMPLES = 2,
860 D3DMULTISAMPLE_3_SAMPLES = 3,
861 D3DMULTISAMPLE_4_SAMPLES = 4,
862 D3DMULTISAMPLE_5_SAMPLES = 5,
863 D3DMULTISAMPLE_6_SAMPLES = 6,
864 D3DMULTISAMPLE_7_SAMPLES = 7,
865 D3DMULTISAMPLE_8_SAMPLES = 8,
866 D3DMULTISAMPLE_9_SAMPLES = 9,
867 D3DMULTISAMPLE_10_SAMPLES = 10,
868 D3DMULTISAMPLE_11_SAMPLES = 11,
869 D3DMULTISAMPLE_12_SAMPLES = 12,
870 D3DMULTISAMPLE_13_SAMPLES = 13,
871 D3DMULTISAMPLE_14_SAMPLES = 14,
872 D3DMULTISAMPLE_15_SAMPLES = 15,
873 D3DMULTISAMPLE_16_SAMPLES = 16,
875 D3DMULTISAMPLE_FORCE_DWORD = 0xffffffff
876 } D3DMULTISAMPLE_TYPE;
879 typedef enum _D3DORDERTYPE {
881 D3DORDER_QUADRATIC = 2,
883 D3DORDER_QUINTIC = 5,
885 D3DORDER_FORCE_DWORD = 0x7fffffff
888 typedef enum _D3DPATCHEDGESTYLE {
889 D3DPATCHEDGE_DISCRETE = 0,
890 D3DPATCHEDGE_CONTINUOUS = 1,
892 D3DPATCHEDGE_FORCE_DWORD = 0x7fffffff,
895 typedef enum _D3DPOOL {
898 D3DPOOL_SYSTEMMEM = 2,
901 D3DPOOL_FORCE_DWORD = 0x7fffffff
904 typedef enum _D3DPRIMITIVETYPE {
908 D3DPT_TRIANGLELIST = 4,
909 D3DPT_TRIANGLESTRIP = 5,
910 D3DPT_TRIANGLEFAN = 6,
912 D3DPT_FORCE_DWORD = 0x7fffffff
915 typedef enum _D3DRENDERSTATETYPE {
919 D3DRS_ZWRITEENABLE = 14,
920 D3DRS_ALPHATESTENABLE = 15,
921 D3DRS_LASTPIXEL = 16,
923 D3DRS_DESTBLEND = 20,
927 D3DRS_ALPHAFUNC = 25,
928 D3DRS_DITHERENABLE = 26,
929 D3DRS_ALPHABLENDENABLE = 27,
930 D3DRS_FOGENABLE = 28,
931 D3DRS_SPECULARENABLE = 29,
933 D3DRS_FOGTABLEMODE = 35,
936 D3DRS_FOGDENSITY = 38,
937 D3DRS_RANGEFOGENABLE = 48,
938 D3DRS_STENCILENABLE = 52,
939 D3DRS_STENCILFAIL = 53,
940 D3DRS_STENCILZFAIL = 54,
941 D3DRS_STENCILPASS = 55,
942 D3DRS_STENCILFUNC = 56,
943 D3DRS_STENCILREF = 57,
944 D3DRS_STENCILMASK = 58,
945 D3DRS_STENCILWRITEMASK = 59,
946 D3DRS_TEXTUREFACTOR = 60,
955 D3DRS_CLIPPING = 136,
956 D3DRS_LIGHTING = 137,
958 D3DRS_FOGVERTEXMODE = 140,
959 D3DRS_COLORVERTEX = 141,
960 D3DRS_LOCALVIEWER = 142,
961 D3DRS_NORMALIZENORMALS = 143,
962 D3DRS_DIFFUSEMATERIALSOURCE = 145,
963 D3DRS_SPECULARMATERIALSOURCE = 146,
964 D3DRS_AMBIENTMATERIALSOURCE = 147,
965 D3DRS_EMISSIVEMATERIALSOURCE = 148,
966 D3DRS_VERTEXBLEND = 151,
967 D3DRS_CLIPPLANEENABLE = 152,
968 D3DRS_POINTSIZE = 154,
969 D3DRS_POINTSIZE_MIN = 155,
970 D3DRS_POINTSPRITEENABLE = 156,
971 D3DRS_POINTSCALEENABLE = 157,
972 D3DRS_POINTSCALE_A = 158,
973 D3DRS_POINTSCALE_B = 159,
974 D3DRS_POINTSCALE_C = 160,
975 D3DRS_MULTISAMPLEANTIALIAS = 161,
976 D3DRS_MULTISAMPLEMASK = 162,
977 D3DRS_PATCHEDGESTYLE = 163,
978 D3DRS_DEBUGMONITORTOKEN = 165,
979 D3DRS_POINTSIZE_MAX = 166,
980 D3DRS_INDEXEDVERTEXBLENDENABLE = 167,
981 D3DRS_COLORWRITEENABLE = 168,
982 D3DRS_TWEENFACTOR = 170,
984 D3DRS_POSITIONDEGREE = 172,
985 D3DRS_NORMALDEGREE = 173,
986 D3DRS_SCISSORTESTENABLE = 174,
987 D3DRS_SLOPESCALEDEPTHBIAS = 175,
988 D3DRS_ANTIALIASEDLINEENABLE = 176,
989 D3DRS_MINTESSELLATIONLEVEL = 178,
990 D3DRS_MAXTESSELLATIONLEVEL = 179,
991 D3DRS_ADAPTIVETESS_X = 180,
992 D3DRS_ADAPTIVETESS_Y = 181,
993 D3DRS_ADAPTIVETESS_Z = 182,
994 D3DRS_ADAPTIVETESS_W = 183,
995 D3DRS_ENABLEADAPTIVETESSELLATION= 184,
996 D3DRS_TWOSIDEDSTENCILMODE = 185,
997 D3DRS_CCW_STENCILFAIL = 186,
998 D3DRS_CCW_STENCILZFAIL = 187,
999 D3DRS_CCW_STENCILPASS = 188,
1000 D3DRS_CCW_STENCILFUNC = 189,
1001 D3DRS_COLORWRITEENABLE1 = 190,
1002 D3DRS_COLORWRITEENABLE2 = 191,
1003 D3DRS_COLORWRITEENABLE3 = 192,
1004 D3DRS_BLENDFACTOR = 193,
1005 D3DRS_SRGBWRITEENABLE = 194,
1006 D3DRS_DEPTHBIAS = 195,
1015 D3DRS_SEPARATEALPHABLENDENABLE = 206,
1016 D3DRS_SRCBLENDALPHA = 207,
1017 D3DRS_DESTBLENDALPHA = 208,
1018 D3DRS_BLENDOPALPHA = 209,
1020 D3DRS_FORCE_DWORD = 0x7fffffff
1021 } D3DRENDERSTATETYPE;
1023 typedef enum _D3DRESOURCETYPE {
1024 D3DRTYPE_SURFACE = 1,
1025 D3DRTYPE_VOLUME = 2,
1026 D3DRTYPE_TEXTURE = 3,
1027 D3DRTYPE_VOLUMETEXTURE = 4,
1028 D3DRTYPE_CUBETEXTURE = 5,
1029 D3DRTYPE_VERTEXBUFFER = 6,
1030 D3DRTYPE_INDEXBUFFER = 7,
1032 D3DRTYPE_FORCE_DWORD = 0x7fffffff
1035 #define D3DRTYPECOUNT (D3DRTYPE_INDEXBUFFER+1)
1037 typedef enum _D3DSHADEMODE {
1039 D3DSHADE_GOURAUD = 2,
1042 D3DSHADE_FORCE_DWORD = 0x7fffffff
1045 typedef enum _D3DSTATEBLOCKTYPE {
1047 D3DSBT_PIXELSTATE = 2,
1048 D3DSBT_VERTEXSTATE = 3,
1050 D3DSBT_FORCE_DWORD = 0xffffffff
1051 } D3DSTATEBLOCKTYPE;
1053 typedef enum _D3DSTENCILOP {
1054 D3DSTENCILOP_KEEP = 1,
1055 D3DSTENCILOP_ZERO = 2,
1056 D3DSTENCILOP_REPLACE = 3,
1057 D3DSTENCILOP_INCRSAT = 4,
1058 D3DSTENCILOP_DECRSAT = 5,
1059 D3DSTENCILOP_INVERT = 6,
1060 D3DSTENCILOP_INCR = 7,
1061 D3DSTENCILOP_DECR = 8,
1063 D3DSTENCILOP_FORCE_DWORD = 0x7fffffff
1066 typedef enum _D3DSWAPEFFECT {
1067 D3DSWAPEFFECT_DISCARD = 1,
1068 D3DSWAPEFFECT_FLIP = 2,
1069 D3DSWAPEFFECT_COPY = 3,
1070 D3DSWAPEFFECT_FORCE_DWORD = 0xFFFFFFFF
1073 typedef enum _D3DTEXTUREADDRESS {
1074 D3DTADDRESS_WRAP = 1,
1075 D3DTADDRESS_MIRROR = 2,
1076 D3DTADDRESS_CLAMP = 3,
1077 D3DTADDRESS_BORDER = 4,
1078 D3DTADDRESS_MIRRORONCE = 5,
1080 D3DTADDRESS_FORCE_DWORD = 0x7fffffff
1081 } D3DTEXTUREADDRESS;
1083 typedef enum _D3DTEXTUREFILTERTYPE {
1087 D3DTEXF_ANISOTROPIC = 3,
1088 D3DTEXF_FLATCUBIC = 4,
1089 D3DTEXF_GAUSSIANCUBIC = 5,
1090 D3DTEXF_PYRAMIDALQUAD = 6,
1091 D3DTEXF_GAUSSIANQUAD = 7,
1092 D3DTEXF_FORCE_DWORD = 0x7fffffff
1093 } D3DTEXTUREFILTERTYPE;
1095 typedef enum _D3DTEXTUREOP {
1097 D3DTOP_SELECTARG1 = 2,
1098 D3DTOP_SELECTARG2 = 3,
1099 D3DTOP_MODULATE = 4,
1100 D3DTOP_MODULATE2X = 5,
1101 D3DTOP_MODULATE4X = 6,
1103 D3DTOP_ADDSIGNED = 8,
1104 D3DTOP_ADDSIGNED2X = 9,
1105 D3DTOP_SUBTRACT = 10,
1106 D3DTOP_ADDSMOOTH = 11,
1107 D3DTOP_BLENDDIFFUSEALPHA = 12,
1108 D3DTOP_BLENDTEXTUREALPHA = 13,
1109 D3DTOP_BLENDFACTORALPHA = 14,
1110 D3DTOP_BLENDTEXTUREALPHAPM = 15,
1111 D3DTOP_BLENDCURRENTALPHA = 16,
1112 D3DTOP_PREMODULATE = 17,
1113 D3DTOP_MODULATEALPHA_ADDCOLOR = 18,
1114 D3DTOP_MODULATECOLOR_ADDALPHA = 19,
1115 D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
1116 D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
1117 D3DTOP_BUMPENVMAP = 22,
1118 D3DTOP_BUMPENVMAPLUMINANCE = 23,
1119 D3DTOP_DOTPRODUCT3 = 24,
1120 D3DTOP_MULTIPLYADD = 25,
1123 D3DTOP_FORCE_DWORD = 0x7fffffff,
1126 typedef enum _D3DTEXTURESTAGESTATETYPE {
1128 D3DTSS_COLORARG1 = 2,
1129 D3DTSS_COLORARG2 = 3,
1131 D3DTSS_ALPHAARG1 = 5,
1132 D3DTSS_ALPHAARG2 = 6,
1133 D3DTSS_BUMPENVMAT00 = 7,
1134 D3DTSS_BUMPENVMAT01 = 8,
1135 D3DTSS_BUMPENVMAT10 = 9,
1136 D3DTSS_BUMPENVMAT11 = 10,
1137 D3DTSS_TEXCOORDINDEX = 11,
1138 #if 1 /* TODO: remove once samplerstates are implemented. */
1139 D3DTSS_ADDRESSU = 13,
1140 D3DTSS_ADDRESSV = 14,
1141 D3DTSS_BORDERCOLOR = 15,
1142 D3DTSS_MAGFILTER = 16,
1143 D3DTSS_MINFILTER = 17,
1144 D3DTSS_MIPFILTER = 18,
1145 D3DTSS_MIPMAPLODBIAS = 19,
1146 D3DTSS_MAXMIPLEVEL = 20,
1147 D3DTSS_MAXANISOTROPY = 21,
1149 D3DTSS_BUMPENVLSCALE = 22,
1150 D3DTSS_BUMPENVLOFFSET = 23,
1151 D3DTSS_TEXTURETRANSFORMFLAGS = 24,
1152 D3DTSS_ADDRESSW = 25,
1153 D3DTSS_COLORARG0 = 26,
1154 D3DTSS_ALPHAARG0 = 27,
1155 D3DTSS_RESULTARG = 28,
1156 D3DTSS_CONSTANT = 32,
1158 D3DTSS_FORCE_DWORD = 0x7fffffff
1159 } D3DTEXTURESTAGESTATETYPE;
1161 typedef enum _D3DTEXTURETRANSFORMFLAGS {
1162 D3DTTFF_DISABLE = 0,
1167 D3DTTFF_PROJECTED = 256,
1169 D3DTTFF_FORCE_DWORD = 0x7fffffff
1170 } D3DTEXTURETRANSFORMFLAGS;
1172 typedef enum _D3DTRANSFORMSTATETYPE {
1174 D3DTS_PROJECTION = 3,
1175 D3DTS_TEXTURE0 = 16,
1176 D3DTS_TEXTURE1 = 17,
1177 D3DTS_TEXTURE2 = 18,
1178 D3DTS_TEXTURE3 = 19,
1179 D3DTS_TEXTURE4 = 20,
1180 D3DTS_TEXTURE5 = 21,
1181 D3DTS_TEXTURE6 = 22,
1182 D3DTS_TEXTURE7 = 23,
1184 D3DTS_FORCE_DWORD = 0x7fffffff
1185 } D3DTRANSFORMSTATETYPE;
1187 typedef enum _D3DVERTEXBLENDFLAGS {
1189 D3DVBF_1WEIGHTS = 1,
1190 D3DVBF_2WEIGHTS = 2,
1191 D3DVBF_3WEIGHTS = 3,
1192 D3DVBF_TWEENING = 255,
1193 D3DVBF_0WEIGHTS = 256
1194 } D3DVERTEXBLENDFLAGS;
1196 typedef enum _D3DZBUFFERTYPE {
1201 D3DZB_FORCE_DWORD = 0x7fffffff
1204 typedef enum _D3DSAMPLERSTATETYPE {
1205 D3DSAMP_ADDRESSU = 1,
1206 D3DSAMP_ADDRESSV = 2,
1207 D3DSAMP_ADDRESSW = 3,
1208 D3DSAMP_BORDERCOLOR = 4,
1209 D3DSAMP_MAGFILTER = 5,
1210 D3DSAMP_MINFILTER = 6,
1211 D3DSAMP_MIPFILTER = 7,
1212 D3DSAMP_MIPMAPLODBIAS = 8,
1213 D3DSAMP_MAXMIPLEVEL = 9,
1214 D3DSAMP_MAXANISOTROPY = 10,
1215 D3DSAMP_SRGBTEXTURE = 11,
1216 D3DSAMP_ELEMENTINDEX = 12,
1217 D3DSAMP_DMAPOFFSET = 13,
1219 D3DSAMP_FORCE_DWORD = 0x7fffffff,
1220 } D3DSAMPLERSTATETYPE;
1223 /*****************************************************************************
1224 * Direct 3D v9 typedefs
1226 typedef DWORD D3DCOLOR;
1228 /*****************************************************************************
1229 * Direct 3D v9 structures
1231 typedef struct _D3DADAPTER_IDENTIFIER9 {
1232 char Driver[MAX_DEVICE_IDENTIFIER_STRING];
1233 char Description[MAX_DEVICE_IDENTIFIER_STRING];
1234 char DeviceName[32];
1235 LARGE_INTEGER DriverVersion;
1242 GUID DeviceIdentifier;
1245 } D3DADAPTER_IDENTIFIER9;
1247 typedef struct _D3DBOX {
1256 typedef struct _D3DCLIPSTATUS9 {
1258 DWORD ClipIntersection;
1261 typedef struct _D3DCOLORVALUE {
1268 typedef struct _D3DDEVICE_CREATION_PARAMETERS {
1269 UINT AdapterOrdinal;
1270 D3DDEVTYPE DeviceType;
1272 DWORD BehaviorFlags;
1273 } D3DDEVICE_CREATION_PARAMETERS;
1275 typedef struct _D3DDEVINFO_D3D9BANDWIDTHTIMINGS {
1276 float MaxBandwidthUtilized;
1277 float FrontEndUploadMemoryUtilizedPercent;
1278 float VertexRateUtilizedPercent;
1279 float TriangleSetupRateUtilizedPercent;
1280 float FillRateUtilizedPercent;
1281 } D3DDEVINFO_D3D9BANDWIDTHTIMINGS;
1283 typedef struct _D3DDEVINFO_D3D9CACHEUTILIZATION {
1284 float TextureCacheHitRate;
1285 float PostTransformVertexCacheHitRate;
1286 } D3DDEVINFO_D3D9CACHEUTILIZATION;
1288 typedef struct _D3DDEVINFO_D3D9INTERFACETIMINGS {
1289 float WaitingForGPUToUseApplicationResourceTimePercent;
1290 float WaitingForGPUToAcceptMoreCommandsTimePercent;
1291 float WaitingForGPUToStayWithinLatencyTimePercent;
1292 float WaitingForGPUExclusiveResourceTimePercent;
1293 float WaitingForGPUOtherTimePercent;
1294 } D3DDEVINFO_D3D9INTERFACETIMINGS;
1296 typedef struct _D3DDEVINFO_D3D9PIPELINETIMINGS {
1297 float VertexProcessingTimePercent;
1298 float PixelProcessingTimePercent;
1299 float OtherGPUProcessingTimePercent;
1300 float GPUIdleTimePercent;
1301 } D3DDEVINFO_D3D9PIPELINETIMINGS;
1303 typedef struct _D3DDEVINFO_D3D9STAGETIMINGS {
1304 float MemoryProcessingPercent;
1305 float ComputationProcessingPercent;
1306 } D3DDEVINFO_D3D9STAGETIMINGS;
1309 /* Vertex cache optimization hints. */
1310 typedef struct D3DDEVINFO_VCACHE {
1311 /* Must be a 4 char code FOURCC (e.g. CACH) */
1313 /* 0 to get the longest strips, 1 vertex cache */
1315 /* Cache size to use (only valid if OptMethod==1) */
1317 /* internal for deciding when to restart strips, non user modifyable (only valid if OptMethod==1) */
1319 } D3DDEVINFO_VCACHE;
1321 typedef struct D3DRESOURCESTATS {
1323 DWORD ApproxBytesDownloaded;
1325 DWORD NumVidCreates;
1328 DWORD NumUsedInVidMem;
1330 DWORD WorkingSetBytes;
1335 typedef struct _D3DDEVINFO_D3DRESOURCEMANAGER {
1336 D3DRESOURCESTATS stats[D3DRTYPECOUNT];
1337 } D3DDEVINFO_D3DRESOURCEMANAGER;
1339 typedef struct _D3DDEVINFO_D3DVERTEXSTATS {
1340 DWORD NumRenderedTriangles;
1341 DWORD NumExtraClippingTriangles;
1342 } D3DDEVINFO_D3DVERTEXSTATS;
1344 typedef struct _D3DDISPLAYMODE {
1351 typedef struct _D3DGAMMARAMP {
1357 typedef struct _D3DINDEXBUFFER_DESC {
1359 D3DRESOURCETYPE Type;
1363 } D3DINDEXBUFFER_DESC;
1365 typedef struct _D3DVECTOR {
1371 typedef struct _D3DLIGHT9 {
1373 D3DCOLORVALUE Diffuse;
1374 D3DCOLORVALUE Specular;
1375 D3DCOLORVALUE Ambient;
1377 D3DVECTOR Direction;
1387 typedef struct _D3DLINEPATTERN {
1392 typedef struct _D3DLOCKED_BOX {
1398 typedef struct _D3DLOCKED_RECT {
1403 typedef struct _D3DMATERIAL9 {
1404 D3DCOLORVALUE Diffuse;
1405 D3DCOLORVALUE Ambient;
1406 D3DCOLORVALUE Specular;
1407 D3DCOLORVALUE Emissive;
1411 typedef struct _D3DMATRIX {
1414 float _11, _12, _13, _14;
1415 float _21, _22, _23, _24;
1416 float _31, _32, _33, _34;
1417 float _41, _42, _43, _44;
1423 typedef struct _D3DPRESENT_PARAMETERS_ {
1424 UINT BackBufferWidth;
1425 UINT BackBufferHeight;
1426 D3DFORMAT BackBufferFormat;
1427 UINT BackBufferCount;
1429 D3DMULTISAMPLE_TYPE MultiSampleType;
1430 DWORD MultiSampleQuality;
1432 D3DSWAPEFFECT SwapEffect;
1435 BOOL EnableAutoDepthStencil;
1436 D3DFORMAT AutoDepthStencilFormat;
1439 UINT FullScreen_RefreshRateInHz;
1440 UINT PresentationInterval;
1442 } D3DPRESENT_PARAMETERS;
1444 typedef struct _D3DRANGE {
1449 typedef struct _D3DRASTER_STATUS {
1454 typedef struct _D3DRECT {
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 #endif /* __WINE_D3D9TYPES_H */