1/*==========================================================================;
2 *
3 * Copyright (C) Microsoft Corporation. All Rights Reserved.
4 *
5 * File: d3d9types.h
6 * Content: Direct3D capabilities include file
7 *
8 ***************************************************************************/
9
10#ifndef _d3d9TYPES_H_
11#define _d3d9TYPES_H_
12
13
14#ifndef DIRECT3D_VERSION
15#define DIRECT3D_VERSION 0x0900
16#endif //DIRECT3D_VERSION
17
18// include this file content only if compiling for DX9 interfaces
19#if(DIRECT3D_VERSION >= 0x0900)
20
21#include <float.h>
22
23#if _MSC_VER >= 1200
24#pragma warning(push)
25#endif
26#pragma warning(disable:4201) // anonymous unions warning
27#if defined(_X86_) || defined(_IA64_)
28#pragma pack(4)
29#endif
30
31
32// D3DCOLOR is equivalent to D3DFMT_A8R8G8B8
33#ifndef D3DCOLOR_DEFINED
34typedef DWORD D3DCOLOR;
35#define D3DCOLOR_DEFINED
36#endif
37
38// maps unsigned 8 bits/channel to D3DCOLOR
39#define D3DCOLOR_ARGB(a,r,g,b) \
40 ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
41#define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b)
42#define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b)
43
44#define D3DCOLOR_XYUV(y,u,v) D3DCOLOR_ARGB(0xff,y,u,v)
45#define D3DCOLOR_AYUV(a,y,u,v) D3DCOLOR_ARGB(a,y,u,v)
46
47// maps floating point channels (0.f to 1.f range) to D3DCOLOR
48#define D3DCOLOR_COLORVALUE(r,g,b,a) \
49 D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f))
50
51
52#ifndef D3DVECTOR_DEFINED
53typedef struct _D3DVECTOR {
54 float x;
55 float y;
56 float z;
57} D3DVECTOR;
58#define D3DVECTOR_DEFINED
59#endif
60
61#ifndef D3DCOLORVALUE_DEFINED
62typedef struct _D3DCOLORVALUE {
63 float r;
64 float g;
65 float b;
66 float a;
67} D3DCOLORVALUE;
68#define D3DCOLORVALUE_DEFINED
69#endif
70
71#ifndef D3DRECT_DEFINED
72typedef struct _D3DRECT {
73 LONG x1;
74 LONG y1;
75 LONG x2;
76 LONG y2;
77} D3DRECT;
78#define D3DRECT_DEFINED
79#endif
80
81
82
83#ifndef D3DMATRIX_DEFINED
84typedef struct _D3DMATRIX {
85 union {
86 struct {
87 float _11, _12, _13, _14;
88 float _21, _22, _23, _24;
89 float _31, _32, _33, _34;
90 float _41, _42, _43, _44;
91
92 };
93 float m[4][4];
94 };
95} D3DMATRIX;
96#define D3DMATRIX_DEFINED
97#endif
98
99
100
101typedef struct _D3DVIEWPORT9 {
102 DWORD X;
103 DWORD Y; /* Viewport Top left */
104 DWORD Width;
105 DWORD Height; /* Viewport Dimensions */
106 float MinZ; /* Min/max of clip Volume */
107 float MaxZ;
108} D3DVIEWPORT9;
109
110/*
111 * Values for clip fields.
112 */
113
114// Max number of user clipping planes, supported in D3D.
115#define D3DMAXUSERCLIPPLANES 32
116
117// These bits could be ORed together to use with D3DRS_CLIPPLANEENABLE
118//
119#define D3DCLIPPLANE0 (1 << 0)
120#define D3DCLIPPLANE1 (1 << 1)
121#define D3DCLIPPLANE2 (1 << 2)
122#define D3DCLIPPLANE3 (1 << 3)
123#define D3DCLIPPLANE4 (1 << 4)
124#define D3DCLIPPLANE5 (1 << 5)
125
126// The following bits are used in the ClipUnion and ClipIntersection
127// members of the D3DCLIPSTATUS9
128//
129
130#define D3DCS_LEFT 0x00000001L
131#define D3DCS_RIGHT 0x00000002L
132#define D3DCS_TOP 0x00000004L
133#define D3DCS_BOTTOM 0x00000008L
134#define D3DCS_FRONT 0x00000010L
135#define D3DCS_BACK 0x00000020L
136#define D3DCS_PLANE0 0x00000040L
137#define D3DCS_PLANE1 0x00000080L
138#define D3DCS_PLANE2 0x00000100L
139#define D3DCS_PLANE3 0x00000200L
140#define D3DCS_PLANE4 0x00000400L
141#define D3DCS_PLANE5 0x00000800L
142
143#define D3DCS_ALL (D3DCS_LEFT | \
144 D3DCS_RIGHT | \
145 D3DCS_TOP | \
146 D3DCS_BOTTOM | \
147 D3DCS_FRONT | \
148 D3DCS_BACK | \
149 D3DCS_PLANE0 | \
150 D3DCS_PLANE1 | \
151 D3DCS_PLANE2 | \
152 D3DCS_PLANE3 | \
153 D3DCS_PLANE4 | \
154 D3DCS_PLANE5)
155
156typedef struct _D3DCLIPSTATUS9 {
157 DWORD ClipUnion;
158 DWORD ClipIntersection;
159} D3DCLIPSTATUS9;
160
161typedef struct _D3DMATERIAL9 {
162 D3DCOLORVALUE Diffuse; /* Diffuse color RGBA */
163 D3DCOLORVALUE Ambient; /* Ambient color RGB */
164 D3DCOLORVALUE Specular; /* Specular 'shininess' */
165 D3DCOLORVALUE Emissive; /* Emissive color RGB */
166 float Power; /* Sharpness if specular highlight */
167} D3DMATERIAL9;
168
169typedef enum _D3DLIGHTTYPE {
170 D3DLIGHT_POINT = 1,
171 D3DLIGHT_SPOT = 2,
172 D3DLIGHT_DIRECTIONAL = 3,
173 D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
174} D3DLIGHTTYPE;
175
176typedef struct _D3DLIGHT9 {
177 D3DLIGHTTYPE Type; /* Type of light source */
178 D3DCOLORVALUE Diffuse; /* Diffuse color of light */
179 D3DCOLORVALUE Specular; /* Specular color of light */
180 D3DCOLORVALUE Ambient; /* Ambient color of light */
181 D3DVECTOR Position; /* Position in world space */
182 D3DVECTOR Direction; /* Direction in world space */
183 float Range; /* Cutoff range */
184 float Falloff; /* Falloff */
185 float Attenuation0; /* Constant attenuation */
186 float Attenuation1; /* Linear attenuation */
187 float Attenuation2; /* Quadratic attenuation */
188 float Theta; /* Inner angle of spotlight cone */
189 float Phi; /* Outer angle of spotlight cone */
190} D3DLIGHT9;
191
192/*
193 * Options for clearing
194 */
195#define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */
196#define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */
197#define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */
198
199/*
200 * The following defines the rendering states
201 */
202
203typedef enum _D3DSHADEMODE {
204 D3DSHADE_FLAT = 1,
205 D3DSHADE_GOURAUD = 2,
206 D3DSHADE_PHONG = 3,
207 D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
208} D3DSHADEMODE;
209
210typedef enum _D3DFILLMODE {
211 D3DFILL_POINT = 1,
212 D3DFILL_WIREFRAME = 2,
213 D3DFILL_SOLID = 3,
214 D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
215} D3DFILLMODE;
216
217typedef enum _D3DBLEND {
218 D3DBLEND_ZERO = 1,
219 D3DBLEND_ONE = 2,
220 D3DBLEND_SRCCOLOR = 3,
221 D3DBLEND_INVSRCCOLOR = 4,
222 D3DBLEND_SRCALPHA = 5,
223 D3DBLEND_INVSRCALPHA = 6,
224 D3DBLEND_DESTALPHA = 7,
225 D3DBLEND_INVDESTALPHA = 8,
226 D3DBLEND_DESTCOLOR = 9,
227 D3DBLEND_INVDESTCOLOR = 10,
228 D3DBLEND_SRCALPHASAT = 11,
229 D3DBLEND_BOTHSRCALPHA = 12,
230 D3DBLEND_BOTHINVSRCALPHA = 13,
231 D3DBLEND_BLENDFACTOR = 14, /* Only supported if D3DPBLENDCAPS_BLENDFACTOR is on */
232 D3DBLEND_INVBLENDFACTOR = 15, /* Only supported if D3DPBLENDCAPS_BLENDFACTOR is on */
233/* D3D9Ex only -- */
234#if !defined(D3D_DISABLE_9EX)
235
236 D3DBLEND_SRCCOLOR2 = 16,
237 D3DBLEND_INVSRCCOLOR2 = 17,
238
239#endif // !D3D_DISABLE_9EX
240/* -- D3D9Ex only */
241 D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
242} D3DBLEND;
243
244typedef enum _D3DBLENDOP {
245 D3DBLENDOP_ADD = 1,
246 D3DBLENDOP_SUBTRACT = 2,
247 D3DBLENDOP_REVSUBTRACT = 3,
248 D3DBLENDOP_MIN = 4,
249 D3DBLENDOP_MAX = 5,
250 D3DBLENDOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
251} D3DBLENDOP;
252
253typedef enum _D3DTEXTUREADDRESS {
254 D3DTADDRESS_WRAP = 1,
255 D3DTADDRESS_MIRROR = 2,
256 D3DTADDRESS_CLAMP = 3,
257 D3DTADDRESS_BORDER = 4,
258 D3DTADDRESS_MIRRORONCE = 5,
259 D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
260} D3DTEXTUREADDRESS;
261
262typedef enum _D3DCULL {
263 D3DCULL_NONE = 1,
264 D3DCULL_CW = 2,
265 D3DCULL_CCW = 3,
266 D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
267} D3DCULL;
268
269typedef enum _D3DCMPFUNC {
270 D3DCMP_NEVER = 1,
271 D3DCMP_LESS = 2,
272 D3DCMP_EQUAL = 3,
273 D3DCMP_LESSEQUAL = 4,
274 D3DCMP_GREATER = 5,
275 D3DCMP_NOTEQUAL = 6,
276 D3DCMP_GREATEREQUAL = 7,
277 D3DCMP_ALWAYS = 8,
278 D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
279} D3DCMPFUNC;
280
281typedef enum _D3DSTENCILOP {
282 D3DSTENCILOP_KEEP = 1,
283 D3DSTENCILOP_ZERO = 2,
284 D3DSTENCILOP_REPLACE = 3,
285 D3DSTENCILOP_INCRSAT = 4,
286 D3DSTENCILOP_DECRSAT = 5,
287 D3DSTENCILOP_INVERT = 6,
288 D3DSTENCILOP_INCR = 7,
289 D3DSTENCILOP_DECR = 8,
290 D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
291} D3DSTENCILOP;
292
293typedef enum _D3DFOGMODE {
294 D3DFOG_NONE = 0,
295 D3DFOG_EXP = 1,
296 D3DFOG_EXP2 = 2,
297 D3DFOG_LINEAR = 3,
298 D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
299} D3DFOGMODE;
300
301typedef enum _D3DZBUFFERTYPE {
302 D3DZB_FALSE = 0,
303 D3DZB_TRUE = 1, // Z buffering
304 D3DZB_USEW = 2, // W buffering
305 D3DZB_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
306} D3DZBUFFERTYPE;
307
308// Primitives supported by draw-primitive API
309typedef enum _D3DPRIMITIVETYPE {
310 D3DPT_POINTLIST = 1,
311 D3DPT_LINELIST = 2,
312 D3DPT_LINESTRIP = 3,
313 D3DPT_TRIANGLELIST = 4,
314 D3DPT_TRIANGLESTRIP = 5,
315 D3DPT_TRIANGLEFAN = 6,
316 D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
317} D3DPRIMITIVETYPE;
318
319typedef enum _D3DTRANSFORMSTATETYPE {
320 D3DTS_VIEW = 2,
321 D3DTS_PROJECTION = 3,
322 D3DTS_TEXTURE0 = 16,
323 D3DTS_TEXTURE1 = 17,
324 D3DTS_TEXTURE2 = 18,
325 D3DTS_TEXTURE3 = 19,
326 D3DTS_TEXTURE4 = 20,
327 D3DTS_TEXTURE5 = 21,
328 D3DTS_TEXTURE6 = 22,
329 D3DTS_TEXTURE7 = 23,
330 D3DTS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
331} D3DTRANSFORMSTATETYPE;
332
333#define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256)
334#define D3DTS_WORLD D3DTS_WORLDMATRIX(0)
335#define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1)
336#define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2)
337#define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3)
338
339typedef enum _D3DRENDERSTATETYPE {
340 D3DRS_ZENABLE = 7, /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */
341 D3DRS_FILLMODE = 8, /* D3DFILLMODE */
342 D3DRS_SHADEMODE = 9, /* D3DSHADEMODE */
343 D3DRS_ZWRITEENABLE = 14, /* TRUE to enable z writes */
344 D3DRS_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */
345 D3DRS_LASTPIXEL = 16, /* TRUE for last-pixel on lines */
346 D3DRS_SRCBLEND = 19, /* D3DBLEND */
347 D3DRS_DESTBLEND = 20, /* D3DBLEND */
348 D3DRS_CULLMODE = 22, /* D3DCULL */
349 D3DRS_ZFUNC = 23, /* D3DCMPFUNC */
350 D3DRS_ALPHAREF = 24, /* D3DFIXED */
351 D3DRS_ALPHAFUNC = 25, /* D3DCMPFUNC */
352 D3DRS_DITHERENABLE = 26, /* TRUE to enable dithering */
353 D3DRS_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */
354 D3DRS_FOGENABLE = 28, /* TRUE to enable fog blending */
355 D3DRS_SPECULARENABLE = 29, /* TRUE to enable specular */
356 D3DRS_FOGCOLOR = 34, /* D3DCOLOR */
357 D3DRS_FOGTABLEMODE = 35, /* D3DFOGMODE */
358 D3DRS_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */
359 D3DRS_FOGEND = 37, /* Fog end */
360 D3DRS_FOGDENSITY = 38, /* Fog density */
361 D3DRS_RANGEFOGENABLE = 48, /* Enables range-based fog */
362 D3DRS_STENCILENABLE = 52, /* BOOL enable/disable stenciling */
363 D3DRS_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */
364 D3DRS_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */
365 D3DRS_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */
366 D3DRS_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */
367 D3DRS_STENCILREF = 57, /* Reference value used in stencil test */
368 D3DRS_STENCILMASK = 58, /* Mask value used in stencil test */
369 D3DRS_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */
370 D3DRS_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */
371 D3DRS_WRAP0 = 128, /* wrap for 1st texture coord. set */
372 D3DRS_WRAP1 = 129, /* wrap for 2nd texture coord. set */
373 D3DRS_WRAP2 = 130, /* wrap for 3rd texture coord. set */
374 D3DRS_WRAP3 = 131, /* wrap for 4th texture coord. set */
375 D3DRS_WRAP4 = 132, /* wrap for 5th texture coord. set */
376 D3DRS_WRAP5 = 133, /* wrap for 6th texture coord. set */
377 D3DRS_WRAP6 = 134, /* wrap for 7th texture coord. set */
378 D3DRS_WRAP7 = 135, /* wrap for 8th texture coord. set */
379 D3DRS_CLIPPING = 136,
380 D3DRS_LIGHTING = 137,
381 D3DRS_AMBIENT = 139,
382 D3DRS_FOGVERTEXMODE = 140,
383 D3DRS_COLORVERTEX = 141,
384 D3DRS_LOCALVIEWER = 142,
385 D3DRS_NORMALIZENORMALS = 143,
386 D3DRS_DIFFUSEMATERIALSOURCE = 145,
387 D3DRS_SPECULARMATERIALSOURCE = 146,
388 D3DRS_AMBIENTMATERIALSOURCE = 147,
389 D3DRS_EMISSIVEMATERIALSOURCE = 148,
390 D3DRS_VERTEXBLEND = 151,
391 D3DRS_CLIPPLANEENABLE = 152,
392 D3DRS_POINTSIZE = 154, /* float point size */
393 D3DRS_POINTSIZE_MIN = 155, /* float point size min threshold */
394 D3DRS_POINTSPRITEENABLE = 156, /* BOOL point texture coord control */
395 D3DRS_POINTSCALEENABLE = 157, /* BOOL point size scale enable */
396 D3DRS_POINTSCALE_A = 158, /* float point attenuation A value */
397 D3DRS_POINTSCALE_B = 159, /* float point attenuation B value */
398 D3DRS_POINTSCALE_C = 160, /* float point attenuation C value */
399 D3DRS_MULTISAMPLEANTIALIAS = 161, // BOOL - set to do FSAA with multisample buffer
400 D3DRS_MULTISAMPLEMASK = 162, // DWORD - per-sample enable/disable
401 D3DRS_PATCHEDGESTYLE = 163, // Sets whether patch edges will use float style tessellation
402 D3DRS_DEBUGMONITORTOKEN = 165, // DEBUG ONLY - token to debug monitor
403 D3DRS_POINTSIZE_MAX = 166, /* float point size max threshold */
404 D3DRS_INDEXEDVERTEXBLENDENABLE = 167,
405 D3DRS_COLORWRITEENABLE = 168, // per-channel write enable
406 D3DRS_TWEENFACTOR = 170, // float tween factor
407 D3DRS_BLENDOP = 171, // D3DBLENDOP setting
408 D3DRS_POSITIONDEGREE = 172, // NPatch position interpolation degree. D3DDEGREE_LINEAR or D3DDEGREE_CUBIC (default)
409 D3DRS_NORMALDEGREE = 173, // NPatch normal interpolation degree. D3DDEGREE_LINEAR (default) or D3DDEGREE_QUADRATIC
410 D3DRS_SCISSORTESTENABLE = 174,
411 D3DRS_SLOPESCALEDEPTHBIAS = 175,
412 D3DRS_ANTIALIASEDLINEENABLE = 176,
413 D3DRS_MINTESSELLATIONLEVEL = 178,
414 D3DRS_MAXTESSELLATIONLEVEL = 179,
415 D3DRS_ADAPTIVETESS_X = 180,
416 D3DRS_ADAPTIVETESS_Y = 181,
417 D3DRS_ADAPTIVETESS_Z = 182,
418 D3DRS_ADAPTIVETESS_W = 183,
419 D3DRS_ENABLEADAPTIVETESSELLATION = 184,
420 D3DRS_TWOSIDEDSTENCILMODE = 185, /* BOOL enable/disable 2 sided stenciling */
421 D3DRS_CCW_STENCILFAIL = 186, /* D3DSTENCILOP to do if ccw stencil test fails */
422 D3DRS_CCW_STENCILZFAIL = 187, /* D3DSTENCILOP to do if ccw stencil test passes and Z test fails */
423 D3DRS_CCW_STENCILPASS = 188, /* D3DSTENCILOP to do if both ccw stencil and Z tests pass */
424 D3DRS_CCW_STENCILFUNC = 189, /* D3DCMPFUNC fn. ccw Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */
425 D3DRS_COLORWRITEENABLE1 = 190, /* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS */
426 D3DRS_COLORWRITEENABLE2 = 191, /* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS */
427 D3DRS_COLORWRITEENABLE3 = 192, /* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS */
428 D3DRS_BLENDFACTOR = 193, /* D3DCOLOR used for a constant blend factor during alpha blending for devices that support D3DPBLENDCAPS_BLENDFACTOR */
429 D3DRS_SRGBWRITEENABLE = 194, /* Enable rendertarget writes to be DE-linearized to SRGB (for formats that expose D3DUSAGE_QUERY_SRGBWRITE) */
430 D3DRS_DEPTHBIAS = 195,
431 D3DRS_WRAP8 = 198, /* Additional wrap states for vs_3_0+ attributes with D3DDECLUSAGE_TEXCOORD */
432 D3DRS_WRAP9 = 199,
433 D3DRS_WRAP10 = 200,
434 D3DRS_WRAP11 = 201,
435 D3DRS_WRAP12 = 202,
436 D3DRS_WRAP13 = 203,
437 D3DRS_WRAP14 = 204,
438 D3DRS_WRAP15 = 205,
439 D3DRS_SEPARATEALPHABLENDENABLE = 206, /* TRUE to enable a separate blending function for the alpha channel */
440 D3DRS_SRCBLENDALPHA = 207, /* SRC blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */
441 D3DRS_DESTBLENDALPHA = 208, /* DST blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */
442 D3DRS_BLENDOPALPHA = 209, /* Blending operation for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */
443
444
445 D3DRS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
446} D3DRENDERSTATETYPE;
447
448// Maximum number of simultaneous render targets D3D supports
449#define D3D_MAX_SIMULTANEOUS_RENDERTARGETS 4
450
451// Values for material source
452typedef enum _D3DMATERIALCOLORSOURCE
453{
454 D3DMCS_MATERIAL = 0, // Color from material is used
455 D3DMCS_COLOR1 = 1, // Diffuse vertex color is used
456 D3DMCS_COLOR2 = 2, // Specular vertex color is used
457 D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
458} D3DMATERIALCOLORSOURCE;
459
460// Bias to apply to the texture coordinate set to apply a wrap to.
461#define D3DRENDERSTATE_WRAPBIAS 128UL
462
463/* Flags to construct the WRAP render states */
464#define D3DWRAP_U 0x00000001L
465#define D3DWRAP_V 0x00000002L
466#define D3DWRAP_W 0x00000004L
467
468/* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */
469#define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U
470#define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V
471#define D3DWRAPCOORD_2 0x00000004L // same as D3DWRAP_W
472#define D3DWRAPCOORD_3 0x00000008L
473
474/* Flags to construct D3DRS_COLORWRITEENABLE */
475#define D3DCOLORWRITEENABLE_RED (1L<<0)
476#define D3DCOLORWRITEENABLE_GREEN (1L<<1)
477#define D3DCOLORWRITEENABLE_BLUE (1L<<2)
478#define D3DCOLORWRITEENABLE_ALPHA (1L<<3)
479
480/*
481 * State enumerants for per-stage processing of fixed function pixel processing
482 * Two of these affect fixed function vertex processing as well: TEXTURETRANSFORMFLAGS and TEXCOORDINDEX.
483 */
484typedef enum _D3DTEXTURESTAGESTATETYPE
485{
486 D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */
487 D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */
488 D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */
489 D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */
490 D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */
491 D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */
492 D3DTSS_BUMPENVMAT00 = 7, /* float (bump mapping matrix) */
493 D3DTSS_BUMPENVMAT01 = 8, /* float (bump mapping matrix) */
494 D3DTSS_BUMPENVMAT10 = 9, /* float (bump mapping matrix) */
495 D3DTSS_BUMPENVMAT11 = 10, /* float (bump mapping matrix) */
496 D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */
497 D3DTSS_BUMPENVLSCALE = 22, /* float scale for bump map luminance */
498 D3DTSS_BUMPENVLOFFSET = 23, /* float offset for bump map luminance */
499 D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */
500 D3DTSS_COLORARG0 = 26, /* D3DTA_* third arg for triadic ops */
501 D3DTSS_ALPHAARG0 = 27, /* D3DTA_* third arg for triadic ops */
502 D3DTSS_RESULTARG = 28, /* D3DTA_* arg for result (CURRENT or TEMP) */
503 D3DTSS_CONSTANT = 32, /* Per-stage constant D3DTA_CONSTANT */
504
505
506 D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
507} D3DTEXTURESTAGESTATETYPE;
508
509/*
510 * State enumerants for per-sampler texture processing.
511 */
512typedef enum _D3DSAMPLERSTATETYPE
513{
514 D3DSAMP_ADDRESSU = 1, /* D3DTEXTUREADDRESS for U coordinate */
515 D3DSAMP_ADDRESSV = 2, /* D3DTEXTUREADDRESS for V coordinate */
516 D3DSAMP_ADDRESSW = 3, /* D3DTEXTUREADDRESS for W coordinate */
517 D3DSAMP_BORDERCOLOR = 4, /* D3DCOLOR */
518 D3DSAMP_MAGFILTER = 5, /* D3DTEXTUREFILTER filter to use for magnification */
519 D3DSAMP_MINFILTER = 6, /* D3DTEXTUREFILTER filter to use for minification */
520 D3DSAMP_MIPFILTER = 7, /* D3DTEXTUREFILTER filter to use between mipmaps during minification */
521 D3DSAMP_MIPMAPLODBIAS = 8, /* float Mipmap LOD bias */
522 D3DSAMP_MAXMIPLEVEL = 9, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */
523 D3DSAMP_MAXANISOTROPY = 10, /* DWORD maximum anisotropy */
524 D3DSAMP_SRGBTEXTURE = 11, /* Default = 0 (which means Gamma 1.0,
525 no correction required.) else correct for
526 Gamma = 2.2 */
527 D3DSAMP_ELEMENTINDEX = 12, /* When multi-element texture is assigned to sampler, this
528 indicates which element index to use. Default = 0. */
529 D3DSAMP_DMAPOFFSET = 13, /* Offset in vertices in the pre-sampled displacement map.
530 Only valid for D3DDMAPSAMPLER sampler */
531 D3DSAMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
532} D3DSAMPLERSTATETYPE;
533
534/* Special sampler which is used in the tesselator */
535#define D3DDMAPSAMPLER 256
536
537// Samplers used in vertex shaders
538#define D3DVERTEXTEXTURESAMPLER0 (D3DDMAPSAMPLER+1)
539#define D3DVERTEXTEXTURESAMPLER1 (D3DDMAPSAMPLER+2)
540#define D3DVERTEXTEXTURESAMPLER2 (D3DDMAPSAMPLER+3)
541#define D3DVERTEXTEXTURESAMPLER3 (D3DDMAPSAMPLER+4)
542
543// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position
544// and normal in the camera space) should be taken as texture coordinates
545// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from
546//
547#define D3DTSS_TCI_PASSTHRU 0x00000000
548#define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000
549#define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000
550#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000
551#define D3DTSS_TCI_SPHEREMAP 0x00040000
552
553/*
554 * Enumerations for COLOROP and ALPHAOP texture blending operations set in
555 * texture processing stage controls in D3DTSS.
556 */
557typedef enum _D3DTEXTUREOP
558{
559 // Control
560 D3DTOP_DISABLE = 1, // disables stage
561 D3DTOP_SELECTARG1 = 2, // the default
562 D3DTOP_SELECTARG2 = 3,
563
564 // Modulate
565 D3DTOP_MODULATE = 4, // multiply args together
566 D3DTOP_MODULATE2X = 5, // multiply and 1 bit
567 D3DTOP_MODULATE4X = 6, // multiply and 2 bits
568
569 // Add
570 D3DTOP_ADD = 7, // add arguments together
571 D3DTOP_ADDSIGNED = 8, // add with -0.5 bias
572 D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit
573 D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation
574 D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product
575 // Arg1 + Arg2 - Arg1*Arg2
576 // = Arg1 + (1-Arg1)*Arg2
577
578 // Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha)
579 D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha
580 D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha
581 D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRS_TEXTUREFACTOR
582
583 // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha)
584 D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha
585 D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color
586
587 // Specular mapping
588 D3DTOP_PREMODULATE = 17, // modulate with next texture before use
589 D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB
590 // COLOROP only
591 D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A
592 // COLOROP only
593 D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB
594 // COLOROP only
595 D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A
596 // COLOROP only
597
598 // Bump mapping
599 D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation
600 D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel
601
602 // This can do either diffuse or specular bump mapping with correct input.
603 // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B)
604 // where each component has been scaled and offset to make it signed.
605 // The result is replicated into all four (including alpha) channels.
606 // This is a valid COLOROP only.
607 D3DTOP_DOTPRODUCT3 = 24,
608
609 // Triadic ops
610 D3DTOP_MULTIPLYADD = 25, // Arg0 + Arg1*Arg2
611 D3DTOP_LERP = 26, // (Arg0)*Arg1 + (1-Arg0)*Arg2
612
613 D3DTOP_FORCE_DWORD = 0x7fffffff,
614} D3DTEXTUREOP;
615
616/*
617 * Values for COLORARG0,1,2, ALPHAARG0,1,2, and RESULTARG texture blending
618 * operations set in texture processing stage controls in D3DRENDERSTATE.
619 */
620#define D3DTA_SELECTMASK 0x0000000f // mask for arg selector
621#define D3DTA_DIFFUSE 0x00000000 // select diffuse color (read only)
622#define D3DTA_CURRENT 0x00000001 // select stage destination register (read/write)
623#define D3DTA_TEXTURE 0x00000002 // select texture color (read only)
624#define D3DTA_TFACTOR 0x00000003 // select D3DRS_TEXTUREFACTOR (read only)
625#define D3DTA_SPECULAR 0x00000004 // select specular color (read only)
626#define D3DTA_TEMP 0x00000005 // select temporary register color (read/write)
627#define D3DTA_CONSTANT 0x00000006 // select texture stage constant
628#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x (read modifier)
629#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components (read modifier)
630
631//
632// Values for D3DSAMP_***FILTER texture stage states
633//
634typedef enum _D3DTEXTUREFILTERTYPE
635{
636 D3DTEXF_NONE = 0, // filtering disabled (valid for mip filter only)
637 D3DTEXF_POINT = 1, // nearest
638 D3DTEXF_LINEAR = 2, // linear interpolation
639 D3DTEXF_ANISOTROPIC = 3, // anisotropic
640 D3DTEXF_PYRAMIDALQUAD = 6, // 4-sample tent
641 D3DTEXF_GAUSSIANQUAD = 7, // 4-sample gaussian
642/* D3D9Ex only -- */
643#if !defined(D3D_DISABLE_9EX)
644
645 D3DTEXF_CONVOLUTIONMONO = 8, // Convolution filter for monochrome textures
646
647#endif // !D3D_DISABLE_9EX
648/* -- D3D9Ex only */
649 D3DTEXF_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
650} D3DTEXTUREFILTERTYPE;
651
652/* Bits for Flags in ProcessVertices call */
653
654#define D3DPV_DONOTCOPYDATA (1 << 0)
655
656//-------------------------------------------------------------------
657
658// Flexible vertex format bits
659//
660#define D3DFVF_RESERVED0 0x001
661#define D3DFVF_POSITION_MASK 0x400E
662#define D3DFVF_XYZ 0x002
663#define D3DFVF_XYZRHW 0x004
664#define D3DFVF_XYZB1 0x006
665#define D3DFVF_XYZB2 0x008
666#define D3DFVF_XYZB3 0x00a
667#define D3DFVF_XYZB4 0x00c
668#define D3DFVF_XYZB5 0x00e
669#define D3DFVF_XYZW 0x4002
670
671#define D3DFVF_NORMAL 0x010
672#define D3DFVF_PSIZE 0x020
673#define D3DFVF_DIFFUSE 0x040
674#define D3DFVF_SPECULAR 0x080
675
676#define D3DFVF_TEXCOUNT_MASK 0xf00
677#define D3DFVF_TEXCOUNT_SHIFT 8
678#define D3DFVF_TEX0 0x000
679#define D3DFVF_TEX1 0x100
680#define D3DFVF_TEX2 0x200
681#define D3DFVF_TEX3 0x300
682#define D3DFVF_TEX4 0x400
683#define D3DFVF_TEX5 0x500
684#define D3DFVF_TEX6 0x600
685#define D3DFVF_TEX7 0x700
686#define D3DFVF_TEX8 0x800
687
688#define D3DFVF_LASTBETA_UBYTE4 0x1000
689#define D3DFVF_LASTBETA_D3DCOLOR 0x8000
690
691#define D3DFVF_RESERVED2 0x6000 // 2 reserved bits
692
693//---------------------------------------------------------------------
694// Vertex Shaders
695//
696
697// Vertex shader declaration
698
699// Vertex element semantics
700//
701typedef enum _D3DDECLUSAGE
702{
703 D3DDECLUSAGE_POSITION = 0,
704 D3DDECLUSAGE_BLENDWEIGHT, // 1
705 D3DDECLUSAGE_BLENDINDICES, // 2
706 D3DDECLUSAGE_NORMAL, // 3
707 D3DDECLUSAGE_PSIZE, // 4
708 D3DDECLUSAGE_TEXCOORD, // 5
709 D3DDECLUSAGE_TANGENT, // 6
710 D3DDECLUSAGE_BINORMAL, // 7
711 D3DDECLUSAGE_TESSFACTOR, // 8
712 D3DDECLUSAGE_POSITIONT, // 9
713 D3DDECLUSAGE_COLOR, // 10
714 D3DDECLUSAGE_FOG, // 11
715 D3DDECLUSAGE_DEPTH, // 12
716 D3DDECLUSAGE_SAMPLE, // 13
717} D3DDECLUSAGE;
718
719#define MAXD3DDECLUSAGE D3DDECLUSAGE_SAMPLE
720#define MAXD3DDECLUSAGEINDEX 15
721#define MAXD3DDECLLENGTH 64 // does not include "end" marker vertex element
722
723typedef enum _D3DDECLMETHOD
724{
725 D3DDECLMETHOD_DEFAULT = 0,
726 D3DDECLMETHOD_PARTIALU,
727 D3DDECLMETHOD_PARTIALV,
728 D3DDECLMETHOD_CROSSUV, // Normal
729 D3DDECLMETHOD_UV,
730 D3DDECLMETHOD_LOOKUP, // Lookup a displacement map
731 D3DDECLMETHOD_LOOKUPPRESAMPLED, // Lookup a pre-sampled displacement map
732} D3DDECLMETHOD;
733
734#define MAXD3DDECLMETHOD D3DDECLMETHOD_LOOKUPPRESAMPLED
735
736// Declarations for _Type fields
737//
738typedef enum _D3DDECLTYPE
739{
740 D3DDECLTYPE_FLOAT1 = 0, // 1D float expanded to (value, 0., 0., 1.)
741 D3DDECLTYPE_FLOAT2 = 1, // 2D float expanded to (value, value, 0., 1.)
742 D3DDECLTYPE_FLOAT3 = 2, // 3D float expanded to (value, value, value, 1.)
743 D3DDECLTYPE_FLOAT4 = 3, // 4D float
744 D3DDECLTYPE_D3DCOLOR = 4, // 4D packed unsigned bytes mapped to 0. to 1. range
745 // Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A)
746 D3DDECLTYPE_UBYTE4 = 5, // 4D unsigned byte
747 D3DDECLTYPE_SHORT2 = 6, // 2D signed short expanded to (value, value, 0., 1.)
748 D3DDECLTYPE_SHORT4 = 7, // 4D signed short
749
750// The following types are valid only with vertex shaders >= 2.0
751
752
753 D3DDECLTYPE_UBYTE4N = 8, // Each of 4 bytes is normalized by dividing to 255.0
754 D3DDECLTYPE_SHORT2N = 9, // 2D signed short normalized (v[0]/32767.0,v[1]/32767.0,0,1)
755 D3DDECLTYPE_SHORT4N = 10, // 4D signed short normalized (v[0]/32767.0,v[1]/32767.0,v[2]/32767.0,v[3]/32767.0)
756 D3DDECLTYPE_USHORT2N = 11, // 2D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,0,1)
757 D3DDECLTYPE_USHORT4N = 12, // 4D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,v[2]/65535.0,v[3]/65535.0)
758 D3DDECLTYPE_UDEC3 = 13, // 3D unsigned 10 10 10 format expanded to (value, value, value, 1)
759 D3DDECLTYPE_DEC3N = 14, // 3D signed 10 10 10 format normalized and expanded to (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1)
760 D3DDECLTYPE_FLOAT16_2 = 15, // Two 16-bit floating point values, expanded to (value, value, 0, 1)
761 D3DDECLTYPE_FLOAT16_4 = 16, // Four 16-bit floating point values
762 D3DDECLTYPE_UNUSED = 17, // When the type field in a decl is unused.
763} D3DDECLTYPE;
764
765#define MAXD3DDECLTYPE D3DDECLTYPE_UNUSED
766
767typedef struct _D3DVERTEXELEMENT9
768{
769 WORD Stream; // Stream index
770 WORD Offset; // Offset in the stream in bytes
771 BYTE Type; // Data type
772 BYTE Method; // Processing method
773 BYTE Usage; // Semantics
774 BYTE UsageIndex; // Semantic index
775} D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9;
776
777// This is used to initialize the last vertex element in a vertex declaration
778// array
779//
780#define D3DDECL_END() {0xFF,0,D3DDECLTYPE_UNUSED,0,0,0}
781
782// Maximum supported number of texture coordinate sets
783#define D3DDP_MAXTEXCOORD 8
784
785//---------------------------------------------------------------------
786// Values for IDirect3DDevice9::SetStreamSourceFreq's Setting parameter
787//---------------------------------------------------------------------
788#define D3DSTREAMSOURCE_INDEXEDDATA (1<<30)
789#define D3DSTREAMSOURCE_INSTANCEDATA (2<<30)
790
791
792
793//---------------------------------------------------------------------
794//
795// The internal format of Pixel Shader (PS) & Vertex Shader (VS)
796// Instruction Tokens is defined in the Direct3D Device Driver Kit
797//
798//---------------------------------------------------------------------
799
800//
801// Instruction Token Bit Definitions
802//
803#define D3DSI_OPCODE_MASK 0x0000FFFF
804
805#define D3DSI_INSTLENGTH_MASK 0x0F000000
806#define D3DSI_INSTLENGTH_SHIFT 24
807
808typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE
809{
810 D3DSIO_NOP = 0,
811 D3DSIO_MOV ,
812 D3DSIO_ADD ,
813 D3DSIO_SUB ,
814 D3DSIO_MAD ,
815 D3DSIO_MUL ,
816 D3DSIO_RCP ,
817 D3DSIO_RSQ ,
818 D3DSIO_DP3 ,
819 D3DSIO_DP4 ,
820 D3DSIO_MIN ,
821 D3DSIO_MAX ,
822 D3DSIO_SLT ,
823 D3DSIO_SGE ,
824 D3DSIO_EXP ,
825 D3DSIO_LOG ,
826 D3DSIO_LIT ,
827 D3DSIO_DST ,
828 D3DSIO_LRP ,
829 D3DSIO_FRC ,
830 D3DSIO_M4x4 ,
831 D3DSIO_M4x3 ,
832 D3DSIO_M3x4 ,
833 D3DSIO_M3x3 ,
834 D3DSIO_M3x2 ,
835 D3DSIO_CALL ,
836 D3DSIO_CALLNZ ,
837 D3DSIO_LOOP ,
838 D3DSIO_RET ,
839 D3DSIO_ENDLOOP ,
840 D3DSIO_LABEL ,
841 D3DSIO_DCL ,
842 D3DSIO_POW ,
843 D3DSIO_CRS ,
844 D3DSIO_SGN ,
845 D3DSIO_ABS ,
846 D3DSIO_NRM ,
847 D3DSIO_SINCOS ,
848 D3DSIO_REP ,
849 D3DSIO_ENDREP ,
850 D3DSIO_IF ,
851 D3DSIO_IFC ,
852 D3DSIO_ELSE ,
853 D3DSIO_ENDIF ,
854 D3DSIO_BREAK ,
855 D3DSIO_BREAKC ,
856 D3DSIO_MOVA ,
857 D3DSIO_DEFB ,
858 D3DSIO_DEFI ,
859
860 D3DSIO_TEXCOORD = 64,
861 D3DSIO_TEXKILL ,
862 D3DSIO_TEX ,
863 D3DSIO_TEXBEM ,
864 D3DSIO_TEXBEML ,
865 D3DSIO_TEXREG2AR ,
866 D3DSIO_TEXREG2GB ,
867 D3DSIO_TEXM3x2PAD ,
868 D3DSIO_TEXM3x2TEX ,
869 D3DSIO_TEXM3x3PAD ,
870 D3DSIO_TEXM3x3TEX ,
871 D3DSIO_RESERVED0 ,
872 D3DSIO_TEXM3x3SPEC ,
873 D3DSIO_TEXM3x3VSPEC ,
874 D3DSIO_EXPP ,
875 D3DSIO_LOGP ,
876 D3DSIO_CND ,
877 D3DSIO_DEF ,
878 D3DSIO_TEXREG2RGB ,
879 D3DSIO_TEXDP3TEX ,
880 D3DSIO_TEXM3x2DEPTH ,
881 D3DSIO_TEXDP3 ,
882 D3DSIO_TEXM3x3 ,
883 D3DSIO_TEXDEPTH ,
884 D3DSIO_CMP ,
885 D3DSIO_BEM ,
886 D3DSIO_DP2ADD ,
887 D3DSIO_DSX ,
888 D3DSIO_DSY ,
889 D3DSIO_TEXLDD ,
890 D3DSIO_SETP ,
891 D3DSIO_TEXLDL ,
892 D3DSIO_BREAKP ,
893
894 D3DSIO_PHASE = 0xFFFD,
895 D3DSIO_COMMENT = 0xFFFE,
896 D3DSIO_END = 0xFFFF,
897
898 D3DSIO_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
899} D3DSHADER_INSTRUCTION_OPCODE_TYPE;
900
901//---------------------------------------------------------------------
902// Use these constants with D3DSIO_SINCOS macro as SRC2, SRC3
903//
904#define D3DSINCOSCONST1 -1.5500992e-006f, -2.1701389e-005f, 0.0026041667f, 0.00026041668f
905#define D3DSINCOSCONST2 -0.020833334f, -0.12500000f, 1.0f, 0.50000000f
906
907//---------------------------------------------------------------------
908// Co-Issue Instruction Modifier - if set then this instruction is to be
909// issued in parallel with the previous instruction(s) for which this bit
910// is not set.
911//
912#define D3DSI_COISSUE 0x40000000
913
914//---------------------------------------------------------------------
915// Opcode specific controls
916
917#define D3DSP_OPCODESPECIFICCONTROL_MASK 0x00ff0000
918#define D3DSP_OPCODESPECIFICCONTROL_SHIFT 16
919
920// ps_2_0 texld controls
921#define D3DSI_TEXLD_PROJECT (0x01 << D3DSP_OPCODESPECIFICCONTROL_SHIFT)
922#define D3DSI_TEXLD_BIAS (0x02 << D3DSP_OPCODESPECIFICCONTROL_SHIFT)
923
924// Comparison for dynamic conditional instruction opcodes (i.e. if, breakc)
925typedef enum _D3DSHADER_COMPARISON
926{
927 // < = >
928 D3DSPC_RESERVED0= 0, // 0 0 0
929 D3DSPC_GT = 1, // 0 0 1
930 D3DSPC_EQ = 2, // 0 1 0
931 D3DSPC_GE = 3, // 0 1 1
932 D3DSPC_LT = 4, // 1 0 0
933 D3DSPC_NE = 5, // 1 0 1
934 D3DSPC_LE = 6, // 1 1 0
935 D3DSPC_RESERVED1= 7 // 1 1 1
936} D3DSHADER_COMPARISON;
937
938// Comparison is part of instruction opcode token:
939#define D3DSHADER_COMPARISON_SHIFT D3DSP_OPCODESPECIFICCONTROL_SHIFT
940#define D3DSHADER_COMPARISON_MASK (0x7<<D3DSHADER_COMPARISON_SHIFT)
941
942//---------------------------------------------------------------------
943// Predication flags on instruction token
944#define D3DSHADER_INSTRUCTION_PREDICATED (0x1 << 28)
945
946//---------------------------------------------------------------------
947// DCL Info Token Controls
948
949// For dcl info tokens requiring a semantic (usage + index)
950#define D3DSP_DCL_USAGE_SHIFT 0
951#define D3DSP_DCL_USAGE_MASK 0x0000000f
952
953#define D3DSP_DCL_USAGEINDEX_SHIFT 16
954#define D3DSP_DCL_USAGEINDEX_MASK 0x000f0000
955
956// DCL pixel shader sampler info token.
957#define D3DSP_TEXTURETYPE_SHIFT 27
958#define D3DSP_TEXTURETYPE_MASK 0x78000000
959
960typedef enum _D3DSAMPLER_TEXTURE_TYPE
961{
962 D3DSTT_UNKNOWN = 0<<D3DSP_TEXTURETYPE_SHIFT, // uninitialized value
963 D3DSTT_2D = 2<<D3DSP_TEXTURETYPE_SHIFT, // dcl_2d s# (for declaring a 2-D texture)
964 D3DSTT_CUBE = 3<<D3DSP_TEXTURETYPE_SHIFT, // dcl_cube s# (for declaring a cube texture)
965 D3DSTT_VOLUME = 4<<D3DSP_TEXTURETYPE_SHIFT, // dcl_volume s# (for declaring a volume texture)
966 D3DSTT_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
967} D3DSAMPLER_TEXTURE_TYPE;
968
969//---------------------------------------------------------------------
970// Parameter Token Bit Definitions
971//
972#define D3DSP_REGNUM_MASK 0x000007FF
973
974// destination parameter write mask
975#define D3DSP_WRITEMASK_0 0x00010000 // Component 0 (X;Red)
976#define D3DSP_WRITEMASK_1 0x00020000 // Component 1 (Y;Green)
977#define D3DSP_WRITEMASK_2 0x00040000 // Component 2 (Z;Blue)
978#define D3DSP_WRITEMASK_3 0x00080000 // Component 3 (W;Alpha)
979#define D3DSP_WRITEMASK_ALL 0x000F0000 // All Components
980
981// destination parameter modifiers
982#define D3DSP_DSTMOD_SHIFT 20
983#define D3DSP_DSTMOD_MASK 0x00F00000
984
985// Bit masks for destination parameter modifiers
986#define D3DSPDM_NONE (0<<D3DSP_DSTMOD_SHIFT) // nop
987#define D3DSPDM_SATURATE (1<<D3DSP_DSTMOD_SHIFT) // clamp to 0. to 1. range
988#define D3DSPDM_PARTIALPRECISION (2<<D3DSP_DSTMOD_SHIFT) // Partial precision hint
989#define D3DSPDM_MSAMPCENTROID (4<<D3DSP_DSTMOD_SHIFT) // Relevant to multisampling only:
990 // When the pixel center is not covered, sample
991 // attribute or compute gradients/LOD
992 // using multisample "centroid" location.
993 // "Centroid" is some location within the covered
994 // region of the pixel.
995
996// destination parameter
997#define D3DSP_DSTSHIFT_SHIFT 24
998#define D3DSP_DSTSHIFT_MASK 0x0F000000
999
1000// destination/source parameter register type
1001#define D3DSP_REGTYPE_SHIFT 28
1002#define D3DSP_REGTYPE_SHIFT2 8
1003#define D3DSP_REGTYPE_MASK 0x70000000
1004#define D3DSP_REGTYPE_MASK2 0x00001800
1005
1006typedef enum _D3DSHADER_PARAM_REGISTER_TYPE
1007{
1008 D3DSPR_TEMP = 0, // Temporary Register File
1009 D3DSPR_INPUT = 1, // Input Register File
1010 D3DSPR_CONST = 2, // Constant Register File
1011 D3DSPR_ADDR = 3, // Address Register (VS)
1012 D3DSPR_TEXTURE = 3, // Texture Register File (PS)
1013 D3DSPR_RASTOUT = 4, // Rasterizer Register File
1014 D3DSPR_ATTROUT = 5, // Attribute Output Register File
1015 D3DSPR_TEXCRDOUT = 6, // Texture Coordinate Output Register File
1016 D3DSPR_OUTPUT = 6, // Output register file for VS3.0+
1017 D3DSPR_CONSTINT = 7, // Constant Integer Vector Register File
1018 D3DSPR_COLOROUT = 8, // Color Output Register File
1019 D3DSPR_DEPTHOUT = 9, // Depth Output Register File
1020 D3DSPR_SAMPLER = 10, // Sampler State Register File
1021 D3DSPR_CONST2 = 11, // Constant Register File 2048 - 4095
1022 D3DSPR_CONST3 = 12, // Constant Register File 4096 - 6143
1023 D3DSPR_CONST4 = 13, // Constant Register File 6144 - 8191
1024 D3DSPR_CONSTBOOL = 14, // Constant Boolean register file
1025 D3DSPR_LOOP = 15, // Loop counter register file
1026 D3DSPR_TEMPFLOAT16 = 16, // 16-bit float temp register file
1027 D3DSPR_MISCTYPE = 17, // Miscellaneous (single) registers.
1028 D3DSPR_LABEL = 18, // Label
1029 D3DSPR_PREDICATE = 19, // Predicate register
1030 D3DSPR_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
1031} D3DSHADER_PARAM_REGISTER_TYPE;
1032
1033// The miscellaneous register file (D3DSPR_MISCTYPES)
1034// contains register types for which there is only ever one
1035// register (i.e. the register # is not needed).
1036// Rather than use up additional register types for such
1037// registers, they are defined
1038// as particular offsets into the misc. register file:
1039typedef enum _D3DSHADER_MISCTYPE_OFFSETS
1040{
1041 D3DSMO_POSITION = 0, // Input position x,y,z,rhw (PS)
1042 D3DSMO_FACE = 1, // Floating point primitive area (PS)
1043} D3DSHADER_MISCTYPE_OFFSETS;
1044
1045// Register offsets in the Rasterizer Register File
1046//
1047typedef enum _D3DVS_RASTOUT_OFFSETS
1048{
1049 D3DSRO_POSITION = 0,
1050 D3DSRO_FOG,
1051 D3DSRO_POINT_SIZE,
1052 D3DSRO_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
1053} D3DVS_RASTOUT_OFFSETS;
1054
1055// Source operand addressing modes
1056
1057#define D3DVS_ADDRESSMODE_SHIFT 13
1058#define D3DVS_ADDRESSMODE_MASK (1 << D3DVS_ADDRESSMODE_SHIFT)
1059
1060typedef enum _D3DVS_ADDRESSMODE_TYPE
1061{
1062 D3DVS_ADDRMODE_ABSOLUTE = (0 << D3DVS_ADDRESSMODE_SHIFT),
1063 D3DVS_ADDRMODE_RELATIVE = (1 << D3DVS_ADDRESSMODE_SHIFT),
1064 D3DVS_ADDRMODE_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
1065} D3DVS_ADDRESSMODE_TYPE;
1066
1067#define D3DSHADER_ADDRESSMODE_SHIFT 13
1068#define D3DSHADER_ADDRESSMODE_MASK (1 << D3DSHADER_ADDRESSMODE_SHIFT)
1069
1070typedef enum _D3DSHADER_ADDRESSMODE_TYPE
1071{
1072 D3DSHADER_ADDRMODE_ABSOLUTE = (0 << D3DSHADER_ADDRESSMODE_SHIFT),
1073 D3DSHADER_ADDRMODE_RELATIVE = (1 << D3DSHADER_ADDRESSMODE_SHIFT),
1074 D3DSHADER_ADDRMODE_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
1075} D3DSHADER_ADDRESSMODE_TYPE;
1076
1077// Source operand swizzle definitions
1078//
1079#define D3DVS_SWIZZLE_SHIFT 16
1080#define D3DVS_SWIZZLE_MASK 0x00FF0000
1081
1082// The following bits define where to take component X from:
1083
1084#define D3DVS_X_X (0 << D3DVS_SWIZZLE_SHIFT)
1085#define D3DVS_X_Y (1 << D3DVS_SWIZZLE_SHIFT)
1086#define D3DVS_X_Z (2 << D3DVS_SWIZZLE_SHIFT)
1087#define D3DVS_X_W (3 << D3DVS_SWIZZLE_SHIFT)
1088
1089// The following bits define where to take component Y from:
1090
1091#define D3DVS_Y_X (0 << (D3DVS_SWIZZLE_SHIFT + 2))
1092#define D3DVS_Y_Y (1 << (D3DVS_SWIZZLE_SHIFT + 2))
1093#define D3DVS_Y_Z (2 << (D3DVS_SWIZZLE_SHIFT + 2))
1094#define D3DVS_Y_W (3 << (D3DVS_SWIZZLE_SHIFT + 2))
1095
1096// The following bits define where to take component Z from:
1097
1098#define D3DVS_Z_X (0 << (D3DVS_SWIZZLE_SHIFT + 4))
1099#define D3DVS_Z_Y (1 << (D3DVS_SWIZZLE_SHIFT + 4))
1100#define D3DVS_Z_Z (2 << (D3DVS_SWIZZLE_SHIFT + 4))
1101#define D3DVS_Z_W (3 << (D3DVS_SWIZZLE_SHIFT + 4))
1102
1103// The following bits define where to take component W from:
1104
1105#define D3DVS_W_X (0 << (D3DVS_SWIZZLE_SHIFT + 6))
1106#define D3DVS_W_Y (1 << (D3DVS_SWIZZLE_SHIFT + 6))
1107#define D3DVS_W_Z (2 << (D3DVS_SWIZZLE_SHIFT + 6))
1108#define D3DVS_W_W (3 << (D3DVS_SWIZZLE_SHIFT + 6))
1109
1110// Value when there is no swizzle (X is taken from X, Y is taken from Y,
1111// Z is taken from Z, W is taken from W
1112//
1113#define D3DVS_NOSWIZZLE (D3DVS_X_X | D3DVS_Y_Y | D3DVS_Z_Z | D3DVS_W_W)
1114
1115// source parameter swizzle
1116#define D3DSP_SWIZZLE_SHIFT 16
1117#define D3DSP_SWIZZLE_MASK 0x00FF0000
1118
1119#define D3DSP_NOSWIZZLE \
1120 ( (0 << (D3DSP_SWIZZLE_SHIFT + 0)) | \
1121 (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | \
1122 (2 << (D3DSP_SWIZZLE_SHIFT + 4)) | \
1123 (3 << (D3DSP_SWIZZLE_SHIFT + 6)) )
1124
1125// pixel-shader swizzle ops
1126#define D3DSP_REPLICATERED \
1127 ( (0 << (D3DSP_SWIZZLE_SHIFT + 0)) | \
1128 (0 << (D3DSP_SWIZZLE_SHIFT + 2)) | \
1129 (0 << (D3DSP_SWIZZLE_SHIFT + 4)) | \
1130 (0 << (D3DSP_SWIZZLE_SHIFT + 6)) )
1131
1132#define D3DSP_REPLICATEGREEN \
1133 ( (1 << (D3DSP_SWIZZLE_SHIFT + 0)) | \
1134 (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | \
1135 (1 << (D3DSP_SWIZZLE_SHIFT + 4)) | \
1136 (1 << (D3DSP_SWIZZLE_SHIFT + 6)) )
1137
1138#define D3DSP_REPLICATEBLUE \
1139 ( (2 << (D3DSP_SWIZZLE_SHIFT + 0)) | \
1140 (2 << (D3DSP_SWIZZLE_SHIFT + 2)) | \
1141 (2 << (D3DSP_SWIZZLE_SHIFT + 4)) | \
1142 (2 << (D3DSP_SWIZZLE_SHIFT + 6)) )
1143
1144#define D3DSP_REPLICATEALPHA \
1145 ( (3 << (D3DSP_SWIZZLE_SHIFT + 0)) | \
1146 (3 << (D3DSP_SWIZZLE_SHIFT + 2)) | \
1147 (3 << (D3DSP_SWIZZLE_SHIFT + 4)) | \
1148 (3 << (D3DSP_SWIZZLE_SHIFT + 6)) )
1149
1150// source parameter modifiers
1151#define D3DSP_SRCMOD_SHIFT 24
1152#define D3DSP_SRCMOD_MASK 0x0F000000
1153
1154typedef enum _D3DSHADER_PARAM_SRCMOD_TYPE
1155{
1156 D3DSPSM_NONE = 0<<D3DSP_SRCMOD_SHIFT, // nop
1157 D3DSPSM_NEG = 1<<D3DSP_SRCMOD_SHIFT, // negate
1158 D3DSPSM_BIAS = 2<<D3DSP_SRCMOD_SHIFT, // bias
1159 D3DSPSM_BIASNEG = 3<<D3DSP_SRCMOD_SHIFT, // bias and negate
1160 D3DSPSM_SIGN = 4<<D3DSP_SRCMOD_SHIFT, // sign
1161 D3DSPSM_SIGNNEG = 5<<D3DSP_SRCMOD_SHIFT, // sign and negate
1162 D3DSPSM_COMP = 6<<D3DSP_SRCMOD_SHIFT, // complement
1163 D3DSPSM_X2 = 7<<D3DSP_SRCMOD_SHIFT, // *2
1164 D3DSPSM_X2NEG = 8<<D3DSP_SRCMOD_SHIFT, // *2 and negate
1165 D3DSPSM_DZ = 9<<D3DSP_SRCMOD_SHIFT, // divide through by z component
1166 D3DSPSM_DW = 10<<D3DSP_SRCMOD_SHIFT, // divide through by w component
1167 D3DSPSM_ABS = 11<<D3DSP_SRCMOD_SHIFT, // abs()
1168 D3DSPSM_ABSNEG = 12<<D3DSP_SRCMOD_SHIFT, // -abs()
1169 D3DSPSM_NOT = 13<<D3DSP_SRCMOD_SHIFT, // for predicate register: "!p0"
1170 D3DSPSM_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
1171} D3DSHADER_PARAM_SRCMOD_TYPE;
1172
1173// Source or dest token bits [15:14]:
1174// destination parameter modifiers
1175#define D3DSP_MIN_PRECISION_SHIFT 14
1176#define D3DSP_MIN_PRECISION_MASK 0x0000C000
1177
1178typedef enum _D3DSHADER_MIN_PRECISION
1179{
1180 D3DMP_DEFAULT = 0, // Default precision for the shader model
1181 D3DMP_16 = 1, // 16 bit per component
1182 D3DMP_2_8 = 2, // 10 bits (2.8) per component
1183} D3DSHADER_MIN_PRECISION;
1184// If the older D3DSPDM_PARTIALPRECISION is set,
1185// that is equivalent to the whole operation specifying
1186// D3DMP_16 (on all operands). The two encodings are not
1187// used together however.
1188
1189
1190
1191// pixel shader version token
1192#define D3DPS_VERSION(_Major,_Minor) (0xFFFF0000|((_Major)<<8)|(_Minor))
1193
1194// vertex shader version token
1195#define D3DVS_VERSION(_Major,_Minor) (0xFFFE0000|((_Major)<<8)|(_Minor))
1196
1197// extract major/minor from version cap
1198#define D3DSHADER_VERSION_MAJOR(_Version) (((_Version)>>8)&0xFF)
1199#define D3DSHADER_VERSION_MINOR(_Version) (((_Version)>>0)&0xFF)
1200
1201// destination/source parameter register type
1202#define D3DSI_COMMENTSIZE_SHIFT 16
1203#define D3DSI_COMMENTSIZE_MASK 0x7FFF0000
1204#define D3DSHADER_COMMENT(_DWordSize) \
1205 ((((_DWordSize)<<D3DSI_COMMENTSIZE_SHIFT)&D3DSI_COMMENTSIZE_MASK)|D3DSIO_COMMENT)
1206
1207// pixel/vertex shader end token
1208#define D3DPS_END() 0x0000FFFF
1209#define D3DVS_END() 0x0000FFFF
1210
1211
1212//---------------------------------------------------------------------
1213
1214// High order surfaces
1215//
1216typedef enum _D3DBASISTYPE
1217{
1218 D3DBASIS_BEZIER = 0,
1219 D3DBASIS_BSPLINE = 1,
1220 D3DBASIS_CATMULL_ROM = 2, /* In D3D8 this used to be D3DBASIS_INTERPOLATE */
1221 D3DBASIS_FORCE_DWORD = 0x7fffffff,
1222} D3DBASISTYPE;
1223
1224typedef enum _D3DDEGREETYPE
1225{
1226 D3DDEGREE_LINEAR = 1,
1227 D3DDEGREE_QUADRATIC = 2,
1228 D3DDEGREE_CUBIC = 3,
1229 D3DDEGREE_QUINTIC = 5,
1230 D3DDEGREE_FORCE_DWORD = 0x7fffffff,
1231} D3DDEGREETYPE;
1232
1233typedef enum _D3DPATCHEDGESTYLE
1234{
1235 D3DPATCHEDGE_DISCRETE = 0,
1236 D3DPATCHEDGE_CONTINUOUS = 1,
1237 D3DPATCHEDGE_FORCE_DWORD = 0x7fffffff,
1238} D3DPATCHEDGESTYLE;
1239
1240typedef enum _D3DSTATEBLOCKTYPE
1241{
1242 D3DSBT_ALL = 1, // capture all state
1243 D3DSBT_PIXELSTATE = 2, // capture pixel state
1244 D3DSBT_VERTEXSTATE = 3, // capture vertex state
1245 D3DSBT_FORCE_DWORD = 0x7fffffff,
1246} D3DSTATEBLOCKTYPE;
1247
1248// The D3DVERTEXBLENDFLAGS type is used with D3DRS_VERTEXBLEND state.
1249//
1250typedef enum _D3DVERTEXBLENDFLAGS
1251{
1252 D3DVBF_DISABLE = 0, // Disable vertex blending
1253 D3DVBF_1WEIGHTS = 1, // 2 matrix blending
1254 D3DVBF_2WEIGHTS = 2, // 3 matrix blending
1255 D3DVBF_3WEIGHTS = 3, // 4 matrix blending
1256 D3DVBF_TWEENING = 255, // blending using D3DRS_TWEENFACTOR
1257 D3DVBF_0WEIGHTS = 256, // one matrix is used with weight 1.0
1258 D3DVBF_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
1259} D3DVERTEXBLENDFLAGS;
1260
1261typedef enum _D3DTEXTURETRANSFORMFLAGS {
1262 D3DTTFF_DISABLE = 0, // texture coordinates are passed directly
1263 D3DTTFF_COUNT1 = 1, // rasterizer should expect 1-D texture coords
1264 D3DTTFF_COUNT2 = 2, // rasterizer should expect 2-D texture coords
1265 D3DTTFF_COUNT3 = 3, // rasterizer should expect 3-D texture coords
1266 D3DTTFF_COUNT4 = 4, // rasterizer should expect 4-D texture coords
1267 D3DTTFF_PROJECTED = 256, // texcoords to be divided by COUNTth element
1268 D3DTTFF_FORCE_DWORD = 0x7fffffff,
1269} D3DTEXTURETRANSFORMFLAGS;
1270
1271// Macros to set texture coordinate format bits in the FVF id
1272
1273#define D3DFVF_TEXTUREFORMAT2 0 // Two floating point values
1274#define D3DFVF_TEXTUREFORMAT1 3 // One floating point value
1275#define D3DFVF_TEXTUREFORMAT3 1 // Three floating point values
1276#define D3DFVF_TEXTUREFORMAT4 2 // Four floating point values
1277
1278#define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
1279#define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2)
1280#define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
1281#define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
1282
1283
1284//---------------------------------------------------------------------
1285
1286/* Direct3D9 Device types */
1287typedef enum _D3DDEVTYPE
1288{
1289 D3DDEVTYPE_HAL = 1,
1290 D3DDEVTYPE_REF = 2,
1291 D3DDEVTYPE_SW = 3,
1292
1293 D3DDEVTYPE_NULLREF = 4,
1294
1295 D3DDEVTYPE_FORCE_DWORD = 0x7fffffff
1296} D3DDEVTYPE;
1297
1298/* Multi-Sample buffer types */
1299typedef enum _D3DMULTISAMPLE_TYPE
1300{
1301 D3DMULTISAMPLE_NONE = 0,
1302 D3DMULTISAMPLE_NONMASKABLE = 1,
1303 D3DMULTISAMPLE_2_SAMPLES = 2,
1304 D3DMULTISAMPLE_3_SAMPLES = 3,
1305 D3DMULTISAMPLE_4_SAMPLES = 4,
1306 D3DMULTISAMPLE_5_SAMPLES = 5,
1307 D3DMULTISAMPLE_6_SAMPLES = 6,
1308 D3DMULTISAMPLE_7_SAMPLES = 7,
1309 D3DMULTISAMPLE_8_SAMPLES = 8,
1310 D3DMULTISAMPLE_9_SAMPLES = 9,
1311 D3DMULTISAMPLE_10_SAMPLES = 10,
1312 D3DMULTISAMPLE_11_SAMPLES = 11,
1313 D3DMULTISAMPLE_12_SAMPLES = 12,
1314 D3DMULTISAMPLE_13_SAMPLES = 13,
1315 D3DMULTISAMPLE_14_SAMPLES = 14,
1316 D3DMULTISAMPLE_15_SAMPLES = 15,
1317 D3DMULTISAMPLE_16_SAMPLES = 16,
1318
1319 D3DMULTISAMPLE_FORCE_DWORD = 0x7fffffff
1320} D3DMULTISAMPLE_TYPE;
1321
1322/* Formats
1323 * Most of these names have the following convention:
1324 * A = Alpha
1325 * R = Red
1326 * G = Green
1327 * B = Blue
1328 * X = Unused Bits
1329 * P = Palette
1330 * L = Luminance
1331 * U = dU coordinate for BumpMap
1332 * V = dV coordinate for BumpMap
1333 * S = Stencil
1334 * D = Depth (e.g. Z or W buffer)
1335 * C = Computed from other channels (typically on certain read operations)
1336 *
1337 * Further, the order of the pieces are from MSB first; hence
1338 * D3DFMT_A8L8 indicates that the high byte of this two byte
1339 * format is alpha.
1340 *
1341 * D3DFMT_D16_LOCKABLE indicates:
1342 * - An integer 16-bit value.
1343 * - An app-lockable surface.
1344 *
1345 * D3DFMT_D32F_LOCKABLE indicates:
1346 * - An IEEE 754 floating-point value.
1347 * - An app-lockable surface.
1348 *
1349 * All Depth/Stencil formats except D3DFMT_D16_LOCKABLE and D3DFMT_D32F_LOCKABLE indicate:
1350 * - no particular bit ordering per pixel, and
1351 * - are not app lockable, and
1352 * - the driver is allowed to consume more than the indicated
1353 * number of bits per Depth channel (but not Stencil channel).
1354 */
1355#ifndef MAKEFOURCC
1356 #define MAKEFOURCC(ch0, ch1, ch2, ch3) \
1357 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
1358 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
1359#endif /* defined(MAKEFOURCC) */
1360
1361
1362typedef enum _D3DFORMAT
1363{
1364 D3DFMT_UNKNOWN = 0,
1365
1366 D3DFMT_R8G8B8 = 20,
1367 D3DFMT_A8R8G8B8 = 21,
1368 D3DFMT_X8R8G8B8 = 22,
1369 D3DFMT_R5G6B5 = 23,
1370 D3DFMT_X1R5G5B5 = 24,
1371 D3DFMT_A1R5G5B5 = 25,
1372 D3DFMT_A4R4G4B4 = 26,
1373 D3DFMT_R3G3B2 = 27,
1374 D3DFMT_A8 = 28,
1375 D3DFMT_A8R3G3B2 = 29,
1376 D3DFMT_X4R4G4B4 = 30,
1377 D3DFMT_A2B10G10R10 = 31,
1378 D3DFMT_A8B8G8R8 = 32,
1379 D3DFMT_X8B8G8R8 = 33,
1380 D3DFMT_G16R16 = 34,
1381 D3DFMT_A2R10G10B10 = 35,
1382 D3DFMT_A16B16G16R16 = 36,
1383
1384 D3DFMT_A8P8 = 40,
1385 D3DFMT_P8 = 41,
1386
1387 D3DFMT_L8 = 50,
1388 D3DFMT_A8L8 = 51,
1389 D3DFMT_A4L4 = 52,
1390
1391 D3DFMT_V8U8 = 60,
1392 D3DFMT_L6V5U5 = 61,
1393 D3DFMT_X8L8V8U8 = 62,
1394 D3DFMT_Q8W8V8U8 = 63,
1395 D3DFMT_V16U16 = 64,
1396 D3DFMT_A2W10V10U10 = 67,
1397
1398 D3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'),
1399 D3DFMT_R8G8_B8G8 = MAKEFOURCC('R', 'G', 'B', 'G'),
1400 D3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'),
1401 D3DFMT_G8R8_G8B8 = MAKEFOURCC('G', 'R', 'G', 'B'),
1402 D3DFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'),
1403 D3DFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'),
1404 D3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'),
1405 D3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'),
1406 D3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'),
1407
1408 D3DFMT_D16_LOCKABLE = 70,
1409 D3DFMT_D32 = 71,
1410 D3DFMT_D15S1 = 73,
1411 D3DFMT_D24S8 = 75,
1412 D3DFMT_D24X8 = 77,
1413 D3DFMT_D24X4S4 = 79,
1414 D3DFMT_D16 = 80,
1415
1416 D3DFMT_D32F_LOCKABLE = 82,
1417 D3DFMT_D24FS8 = 83,
1418
1419/* D3D9Ex only -- */
1420#if !defined(D3D_DISABLE_9EX)
1421
1422 /* Z-Stencil formats valid for CPU access */
1423 D3DFMT_D32_LOCKABLE = 84,
1424 D3DFMT_S8_LOCKABLE = 85,
1425
1426#endif // !D3D_DISABLE_9EX
1427/* -- D3D9Ex only */
1428
1429
1430 D3DFMT_L16 = 81,
1431
1432 D3DFMT_VERTEXDATA =100,
1433 D3DFMT_INDEX16 =101,
1434 D3DFMT_INDEX32 =102,
1435
1436 D3DFMT_Q16W16V16U16 =110,
1437
1438 D3DFMT_MULTI2_ARGB8 = MAKEFOURCC('M','E','T','1'),
1439
1440 // Floating point surface formats
1441
1442 // s10e5 formats (16-bits per channel)
1443 D3DFMT_R16F = 111,
1444 D3DFMT_G16R16F = 112,
1445 D3DFMT_A16B16G16R16F = 113,
1446
1447 // IEEE s23e8 formats (32-bits per channel)
1448 D3DFMT_R32F = 114,
1449 D3DFMT_G32R32F = 115,
1450 D3DFMT_A32B32G32R32F = 116,
1451
1452 D3DFMT_CxV8U8 = 117,
1453
1454/* D3D9Ex only -- */
1455#if !defined(D3D_DISABLE_9EX)
1456
1457 // Monochrome 1 bit per pixel format
1458 D3DFMT_A1 = 118,
1459
1460 // 2.8 biased fixed point
1461 D3DFMT_A2B10G10R10_XR_BIAS = 119,
1462
1463
1464 // Binary format indicating that the data has no inherent type
1465 D3DFMT_BINARYBUFFER = 199,
1466
1467#endif // !D3D_DISABLE_9EX
1468/* -- D3D9Ex only */
1469
1470
1471 D3DFMT_FORCE_DWORD =0x7fffffff
1472} D3DFORMAT;
1473
1474/* Display Modes */
1475typedef struct _D3DDISPLAYMODE
1476{
1477 UINT Width;
1478 UINT Height;
1479 UINT RefreshRate;
1480 D3DFORMAT Format;
1481} D3DDISPLAYMODE;
1482
1483/* Creation Parameters */
1484typedef struct _D3DDEVICE_CREATION_PARAMETERS
1485{
1486 UINT AdapterOrdinal;
1487 D3DDEVTYPE DeviceType;
1488 HWND hFocusWindow;
1489 DWORD BehaviorFlags;
1490} D3DDEVICE_CREATION_PARAMETERS;
1491
1492
1493/* SwapEffects */
1494typedef enum _D3DSWAPEFFECT
1495{
1496 D3DSWAPEFFECT_DISCARD = 1,
1497 D3DSWAPEFFECT_FLIP = 2,
1498 D3DSWAPEFFECT_COPY = 3,
1499
1500/* D3D9Ex only -- */
1501#if !defined(D3D_DISABLE_9EX)
1502 D3DSWAPEFFECT_OVERLAY = 4,
1503 D3DSWAPEFFECT_FLIPEX = 5,
1504#endif // !D3D_DISABLE_9EX
1505/* -- D3D9Ex only */
1506
1507 D3DSWAPEFFECT_FORCE_DWORD = 0x7fffffff
1508} D3DSWAPEFFECT;
1509
1510/* Pool types */
1511typedef enum _D3DPOOL {
1512 D3DPOOL_DEFAULT = 0,
1513 D3DPOOL_MANAGED = 1,
1514 D3DPOOL_SYSTEMMEM = 2,
1515 D3DPOOL_SCRATCH = 3,
1516
1517 D3DPOOL_FORCE_DWORD = 0x7fffffff
1518} D3DPOOL;
1519
1520
1521/* RefreshRate pre-defines */
1522#define D3DPRESENT_RATE_DEFAULT 0x00000000
1523
1524
1525/* Resize Optional Parameters */
1526typedef struct _D3DPRESENT_PARAMETERS_
1527{
1528 UINT BackBufferWidth;
1529 UINT BackBufferHeight;
1530 D3DFORMAT BackBufferFormat;
1531 UINT BackBufferCount;
1532
1533 D3DMULTISAMPLE_TYPE MultiSampleType;
1534 DWORD MultiSampleQuality;
1535
1536 D3DSWAPEFFECT SwapEffect;
1537 HWND hDeviceWindow;
1538 BOOL Windowed;
1539 BOOL EnableAutoDepthStencil;
1540 D3DFORMAT AutoDepthStencilFormat;
1541 DWORD Flags;
1542
1543 /* FullScreen_RefreshRateInHz must be zero for Windowed mode */
1544 UINT FullScreen_RefreshRateInHz;
1545 UINT PresentationInterval;
1546} D3DPRESENT_PARAMETERS;
1547
1548// Values for D3DPRESENT_PARAMETERS.Flags
1549
1550#define D3DPRESENTFLAG_LOCKABLE_BACKBUFFER 0x00000001
1551#define D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL 0x00000002
1552#define D3DPRESENTFLAG_DEVICECLIP 0x00000004
1553#define D3DPRESENTFLAG_VIDEO 0x00000010
1554
1555/* D3D9Ex only -- */
1556#if !defined(D3D_DISABLE_9EX)
1557
1558#define D3DPRESENTFLAG_NOAUTOROTATE 0x00000020
1559#define D3DPRESENTFLAG_UNPRUNEDMODE 0x00000040
1560#define D3DPRESENTFLAG_OVERLAY_LIMITEDRGB 0x00000080
1561#define D3DPRESENTFLAG_OVERLAY_YCbCr_BT709 0x00000100
1562#define D3DPRESENTFLAG_OVERLAY_YCbCr_xvYCC 0x00000200
1563#define D3DPRESENTFLAG_RESTRICTED_CONTENT 0x00000400
1564#define D3DPRESENTFLAG_RESTRICT_SHARED_RESOURCE_DRIVER 0x00000800
1565
1566#endif // !D3D_DISABLE_9EX
1567/* -- D3D9Ex only */
1568
1569/* Gamma Ramp: Same as DX7 */
1570
1571typedef struct _D3DGAMMARAMP
1572{
1573 WORD red [256];
1574 WORD green[256];
1575 WORD blue [256];
1576} D3DGAMMARAMP;
1577
1578/* Back buffer types */
1579typedef enum _D3DBACKBUFFER_TYPE
1580{
1581 D3DBACKBUFFER_TYPE_MONO = 0,
1582 D3DBACKBUFFER_TYPE_LEFT = 1,
1583 D3DBACKBUFFER_TYPE_RIGHT = 2,
1584
1585 D3DBACKBUFFER_TYPE_FORCE_DWORD = 0x7fffffff
1586} D3DBACKBUFFER_TYPE;
1587
1588
1589/* Types */
1590typedef enum _D3DRESOURCETYPE {
1591 D3DRTYPE_SURFACE = 1,
1592 D3DRTYPE_VOLUME = 2,
1593 D3DRTYPE_TEXTURE = 3,
1594 D3DRTYPE_VOLUMETEXTURE = 4,
1595 D3DRTYPE_CUBETEXTURE = 5,
1596 D3DRTYPE_VERTEXBUFFER = 6,
1597 D3DRTYPE_INDEXBUFFER = 7, //if this changes, change _D3DDEVINFO_RESOURCEMANAGER definition
1598
1599
1600 D3DRTYPE_FORCE_DWORD = 0x7fffffff
1601} D3DRESOURCETYPE;
1602
1603/* Usages */
1604#define D3DUSAGE_RENDERTARGET (0x00000001L)
1605#define D3DUSAGE_DEPTHSTENCIL (0x00000002L)
1606#define D3DUSAGE_DYNAMIC (0x00000200L)
1607
1608/* D3D9Ex only -- */
1609#if !defined(D3D_DISABLE_9EX)
1610
1611#define D3DUSAGE_NONSECURE (0x00800000L)
1612
1613#endif // !D3D_DISABLE_9EX
1614/* -- D3D9Ex only */
1615
1616// When passed to CheckDeviceFormat, D3DUSAGE_AUTOGENMIPMAP may return
1617// D3DOK_NOAUTOGEN if the device doesn't support autogeneration for that format.
1618// D3DOK_NOAUTOGEN is a success code, not a failure code... the SUCCEEDED and FAILED macros
1619// will return true and false respectively for this code.
1620#define D3DUSAGE_AUTOGENMIPMAP (0x00000400L)
1621#define D3DUSAGE_DMAP (0x00004000L)
1622
1623// The following usages are valid only for querying CheckDeviceFormat
1624#define D3DUSAGE_QUERY_LEGACYBUMPMAP (0x00008000L)
1625#define D3DUSAGE_QUERY_SRGBREAD (0x00010000L)
1626#define D3DUSAGE_QUERY_FILTER (0x00020000L)
1627#define D3DUSAGE_QUERY_SRGBWRITE (0x00040000L)
1628#define D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING (0x00080000L)
1629#define D3DUSAGE_QUERY_VERTEXTEXTURE (0x00100000L)
1630#define D3DUSAGE_QUERY_WRAPANDMIP (0x00200000L)
1631
1632/* Usages for Vertex/Index buffers */
1633#define D3DUSAGE_WRITEONLY (0x00000008L)
1634#define D3DUSAGE_SOFTWAREPROCESSING (0x00000010L)
1635#define D3DUSAGE_DONOTCLIP (0x00000020L)
1636#define D3DUSAGE_POINTS (0x00000040L)
1637#define D3DUSAGE_RTPATCHES (0x00000080L)
1638#define D3DUSAGE_NPATCHES (0x00000100L)
1639
1640/* D3D9Ex only -- */
1641#if !defined(D3D_DISABLE_9EX)
1642
1643#define D3DUSAGE_TEXTAPI (0x10000000L)
1644#define D3DUSAGE_RESTRICTED_CONTENT (0x00000800L)
1645#define D3DUSAGE_RESTRICT_SHARED_RESOURCE (0x00002000L)
1646#define D3DUSAGE_RESTRICT_SHARED_RESOURCE_DRIVER (0x00001000L)
1647
1648#endif // !D3D_DISABLE_9EX
1649/* -- D3D9Ex only */
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668/* CubeMap Face identifiers */
1669typedef enum _D3DCUBEMAP_FACES
1670{
1671 D3DCUBEMAP_FACE_POSITIVE_X = 0,
1672 D3DCUBEMAP_FACE_NEGATIVE_X = 1,
1673 D3DCUBEMAP_FACE_POSITIVE_Y = 2,
1674 D3DCUBEMAP_FACE_NEGATIVE_Y = 3,
1675 D3DCUBEMAP_FACE_POSITIVE_Z = 4,
1676 D3DCUBEMAP_FACE_NEGATIVE_Z = 5,
1677
1678 D3DCUBEMAP_FACE_FORCE_DWORD = 0x7fffffff
1679} D3DCUBEMAP_FACES;
1680
1681
1682/* Lock flags */
1683
1684#define D3DLOCK_READONLY 0x00000010L
1685#define D3DLOCK_DISCARD 0x00002000L
1686#define D3DLOCK_NOOVERWRITE 0x00001000L
1687#define D3DLOCK_NOSYSLOCK 0x00000800L
1688#define D3DLOCK_DONOTWAIT 0x00004000L
1689
1690#define D3DLOCK_NO_DIRTY_UPDATE 0x00008000L
1691
1692
1693
1694
1695
1696
1697
1698/* Vertex Buffer Description */
1699typedef struct _D3DVERTEXBUFFER_DESC
1700{
1701 D3DFORMAT Format;
1702 D3DRESOURCETYPE Type;
1703 DWORD Usage;
1704 D3DPOOL Pool;
1705 UINT Size;
1706
1707 DWORD FVF;
1708
1709} D3DVERTEXBUFFER_DESC;
1710
1711/* Index Buffer Description */
1712typedef struct _D3DINDEXBUFFER_DESC
1713{
1714 D3DFORMAT Format;
1715 D3DRESOURCETYPE Type;
1716 DWORD Usage;
1717 D3DPOOL Pool;
1718 UINT Size;
1719} D3DINDEXBUFFER_DESC;
1720
1721
1722/* Surface Description */
1723typedef struct _D3DSURFACE_DESC
1724{
1725 D3DFORMAT Format;
1726 D3DRESOURCETYPE Type;
1727 DWORD Usage;
1728 D3DPOOL Pool;
1729
1730 D3DMULTISAMPLE_TYPE MultiSampleType;
1731 DWORD MultiSampleQuality;
1732 UINT Width;
1733 UINT Height;
1734} D3DSURFACE_DESC;
1735
1736typedef struct _D3DVOLUME_DESC
1737{
1738 D3DFORMAT Format;
1739 D3DRESOURCETYPE Type;
1740 DWORD Usage;
1741 D3DPOOL Pool;
1742
1743 UINT Width;
1744 UINT Height;
1745 UINT Depth;
1746} D3DVOLUME_DESC;
1747
1748/* Structure for LockRect */
1749typedef struct _D3DLOCKED_RECT
1750{
1751 INT Pitch;
1752 void* pBits;
1753} D3DLOCKED_RECT;
1754
1755/* Structures for LockBox */
1756typedef struct _D3DBOX
1757{
1758 UINT Left;
1759 UINT Top;
1760 UINT Right;
1761 UINT Bottom;
1762 UINT Front;
1763 UINT Back;
1764} D3DBOX;
1765
1766typedef struct _D3DLOCKED_BOX
1767{
1768 INT RowPitch;
1769 INT SlicePitch;
1770 void* pBits;
1771} D3DLOCKED_BOX;
1772
1773/* Structures for LockRange */
1774typedef struct _D3DRANGE
1775{
1776 UINT Offset;
1777 UINT Size;
1778} D3DRANGE;
1779
1780/* Structures for high order primitives */
1781typedef struct _D3DRECTPATCH_INFO
1782{
1783 UINT StartVertexOffsetWidth;
1784 UINT StartVertexOffsetHeight;
1785 UINT Width;
1786 UINT Height;
1787 UINT Stride;
1788 D3DBASISTYPE Basis;
1789 D3DDEGREETYPE Degree;
1790} D3DRECTPATCH_INFO;
1791
1792typedef struct _D3DTRIPATCH_INFO
1793{
1794 UINT StartVertexOffset;
1795 UINT NumVertices;
1796 D3DBASISTYPE Basis;
1797 D3DDEGREETYPE Degree;
1798} D3DTRIPATCH_INFO;
1799
1800/* Adapter Identifier */
1801
1802#define MAX_DEVICE_IDENTIFIER_STRING 512
1803typedef struct _D3DADAPTER_IDENTIFIER9
1804{
1805 char Driver[MAX_DEVICE_IDENTIFIER_STRING];
1806 char Description[MAX_DEVICE_IDENTIFIER_STRING];
1807 char DeviceName[32]; /* Device name for GDI (ex. \\.\DISPLAY1) */
1808
1809#ifdef _WIN32
1810 LARGE_INTEGER DriverVersion; /* Defined for 32 bit components */
1811#else
1812 DWORD DriverVersionLowPart; /* Defined for 16 bit driver components */
1813 DWORD DriverVersionHighPart;
1814#endif
1815
1816 DWORD VendorId;
1817 DWORD DeviceId;
1818 DWORD SubSysId;
1819 DWORD Revision;
1820
1821 GUID DeviceIdentifier;
1822
1823 DWORD WHQLLevel;
1824
1825} D3DADAPTER_IDENTIFIER9;
1826
1827
1828/* Raster Status structure returned by GetRasterStatus */
1829typedef struct _D3DRASTER_STATUS
1830{
1831 BOOL InVBlank;
1832 UINT ScanLine;
1833} D3DRASTER_STATUS;
1834
1835
1836
1837/* Debug monitor tokens (DEBUG only)
1838
1839 Note that if D3DRS_DEBUGMONITORTOKEN is set, the call is treated as
1840 passing a token to the debug monitor. For example, if, after passing
1841 D3DDMT_ENABLE/DISABLE to D3DRS_DEBUGMONITORTOKEN other token values
1842 are passed in, the enabled/disabled state of the debug
1843 monitor will still persist.
1844
1845 The debug monitor defaults to enabled.
1846
1847 Calling GetRenderState on D3DRS_DEBUGMONITORTOKEN is not of any use.
1848*/
1849typedef enum _D3DDEBUGMONITORTOKENS {
1850 D3DDMT_ENABLE = 0, // enable debug monitor
1851 D3DDMT_DISABLE = 1, // disable debug monitor
1852 D3DDMT_FORCE_DWORD = 0x7fffffff,
1853} D3DDEBUGMONITORTOKENS;
1854
1855// Async feedback
1856
1857typedef enum _D3DQUERYTYPE {
1858 D3DQUERYTYPE_VCACHE = 4, /* D3DISSUE_END */
1859 D3DQUERYTYPE_RESOURCEMANAGER = 5, /* D3DISSUE_END */
1860 D3DQUERYTYPE_VERTEXSTATS = 6, /* D3DISSUE_END */
1861 D3DQUERYTYPE_EVENT = 8, /* D3DISSUE_END */
1862 D3DQUERYTYPE_OCCLUSION = 9, /* D3DISSUE_BEGIN, D3DISSUE_END */
1863 D3DQUERYTYPE_TIMESTAMP = 10, /* D3DISSUE_END */
1864 D3DQUERYTYPE_TIMESTAMPDISJOINT = 11, /* D3DISSUE_BEGIN, D3DISSUE_END */
1865 D3DQUERYTYPE_TIMESTAMPFREQ = 12, /* D3DISSUE_END */
1866 D3DQUERYTYPE_PIPELINETIMINGS = 13, /* D3DISSUE_BEGIN, D3DISSUE_END */
1867 D3DQUERYTYPE_INTERFACETIMINGS = 14, /* D3DISSUE_BEGIN, D3DISSUE_END */
1868 D3DQUERYTYPE_VERTEXTIMINGS = 15, /* D3DISSUE_BEGIN, D3DISSUE_END */
1869 D3DQUERYTYPE_PIXELTIMINGS = 16, /* D3DISSUE_BEGIN, D3DISSUE_END */
1870 D3DQUERYTYPE_BANDWIDTHTIMINGS = 17, /* D3DISSUE_BEGIN, D3DISSUE_END */
1871 D3DQUERYTYPE_CACHEUTILIZATION = 18, /* D3DISSUE_BEGIN, D3DISSUE_END */
1872/* D3D9Ex only -- */
1873#if !defined(D3D_DISABLE_9EX)
1874 D3DQUERYTYPE_MEMORYPRESSURE = 19, /* D3DISSUE_BEGIN, D3DISSUE_END */
1875#endif // !D3D_DISABLE_9EX
1876} D3DQUERYTYPE;
1877
1878// Flags field for Issue
1879#define D3DISSUE_END (1 << 0) // Tells the runtime to issue the end of a query, changing it's state to "non-signaled".
1880#define D3DISSUE_BEGIN (1 << 1) // Tells the runtime to issue the beginng of a query.
1881
1882
1883// Flags field for GetData
1884#define D3DGETDATA_FLUSH (1 << 0) // Tells the runtime to flush if the query is outstanding.
1885
1886
1887typedef struct _D3DRESOURCESTATS
1888{
1889// Data collected since last Present()
1890 BOOL bThrashing; /* indicates if thrashing */
1891 DWORD ApproxBytesDownloaded; /* Approximate number of bytes downloaded by resource manager */
1892 DWORD NumEvicts; /* number of objects evicted */
1893 DWORD NumVidCreates; /* number of objects created in video memory */
1894 DWORD LastPri; /* priority of last object evicted */
1895 DWORD NumUsed; /* number of objects set to the device */
1896 DWORD NumUsedInVidMem; /* number of objects set to the device, which are already in video memory */
1897// Persistent data
1898 DWORD WorkingSet; /* number of objects in video memory */
1899 DWORD WorkingSetBytes; /* number of bytes in video memory */
1900 DWORD TotalManaged; /* total number of managed objects */
1901 DWORD TotalBytes; /* total number of bytes of managed objects */
1902} D3DRESOURCESTATS;
1903
1904#define D3DRTYPECOUNT (D3DRTYPE_INDEXBUFFER+1)
1905
1906typedef struct _D3DDEVINFO_RESOURCEMANAGER
1907{
1908#ifndef WOW64_ENUM_WORKAROUND
1909 D3DRESOURCESTATS stats[D3DRTYPECOUNT];
1910#else
1911 D3DRESOURCESTATS stats[8];
1912#endif
1913} D3DDEVINFO_RESOURCEMANAGER, *LPD3DDEVINFO_RESOURCEMANAGER;
1914
1915typedef struct _D3DDEVINFO_D3DVERTEXSTATS
1916{
1917 DWORD NumRenderedTriangles; /* total number of triangles that are not clipped in this frame */
1918 DWORD NumExtraClippingTriangles; /* Number of new triangles generated by clipping */
1919} D3DDEVINFO_D3DVERTEXSTATS, *LPD3DDEVINFO_D3DVERTEXSTATS;
1920
1921
1922typedef struct _D3DDEVINFO_VCACHE {
1923 DWORD Pattern; /* bit pattern, return value must be FOUR_CC('C', 'A', 'C', 'H') */
1924 DWORD OptMethod; /* optimization method 0 means longest strips, 1 means vertex cache based */
1925 DWORD CacheSize; /* cache size to optimize for (only required if type is 1) */
1926 DWORD MagicNumber; /* used to determine when to restart strips (only required if type is 1)*/
1927} D3DDEVINFO_VCACHE, *LPD3DDEVINFO_VCACHE;
1928
1929typedef struct _D3DDEVINFO_D3D9PIPELINETIMINGS
1930{
1931 FLOAT VertexProcessingTimePercent;
1932 FLOAT PixelProcessingTimePercent;
1933 FLOAT OtherGPUProcessingTimePercent;
1934 FLOAT GPUIdleTimePercent;
1935} D3DDEVINFO_D3D9PIPELINETIMINGS;
1936
1937typedef struct _D3DDEVINFO_D3D9INTERFACETIMINGS
1938{
1939 FLOAT WaitingForGPUToUseApplicationResourceTimePercent;
1940 FLOAT WaitingForGPUToAcceptMoreCommandsTimePercent;
1941 FLOAT WaitingForGPUToStayWithinLatencyTimePercent;
1942 FLOAT WaitingForGPUExclusiveResourceTimePercent;
1943 FLOAT WaitingForGPUOtherTimePercent;
1944} D3DDEVINFO_D3D9INTERFACETIMINGS;
1945
1946typedef struct _D3DDEVINFO_D3D9STAGETIMINGS
1947{
1948 FLOAT MemoryProcessingPercent;
1949 FLOAT ComputationProcessingPercent;
1950} D3DDEVINFO_D3D9STAGETIMINGS;
1951
1952typedef struct _D3DDEVINFO_D3D9BANDWIDTHTIMINGS
1953{
1954 FLOAT MaxBandwidthUtilized;
1955 FLOAT FrontEndUploadMemoryUtilizedPercent;
1956 FLOAT VertexRateUtilizedPercent;
1957 FLOAT TriangleSetupRateUtilizedPercent;
1958 FLOAT FillRateUtilizedPercent;
1959} D3DDEVINFO_D3D9BANDWIDTHTIMINGS;
1960
1961typedef struct _D3DDEVINFO_D3D9CACHEUTILIZATION
1962{
1963 FLOAT TextureCacheHitRate; // Percentage of cache hits
1964 FLOAT PostTransformVertexCacheHitRate;
1965} D3DDEVINFO_D3D9CACHEUTILIZATION;
1966
1967/* D3D9Ex only -- */
1968#if !defined(D3D_DISABLE_9EX)
1969
1970typedef struct _D3DMEMORYPRESSURE
1971{
1972 UINT64 BytesEvictedFromProcess;
1973 UINT64 SizeOfInefficientAllocation;
1974 DWORD LevelOfEfficiency;
1975} D3DMEMORYPRESSURE;
1976
1977typedef enum _D3DCOMPOSERECTSOP{
1978 D3DCOMPOSERECTS_COPY = 1,
1979 D3DCOMPOSERECTS_OR = 2,
1980 D3DCOMPOSERECTS_AND = 3,
1981 D3DCOMPOSERECTS_NEG = 4,
1982 D3DCOMPOSERECTS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
1983} D3DCOMPOSERECTSOP;
1984
1985typedef struct _D3DCOMPOSERECTDESC
1986{
1987 USHORT X, Y; // Top-left coordinates of a rect in the source surface
1988 USHORT Width, Height; // Dimensions of the rect
1989} D3DCOMPOSERECTDESC;
1990
1991typedef struct _D3DCOMPOSERECTDESTINATION
1992{
1993 USHORT SrcRectIndex; // Index of D3DCOMPOSERECTDESC
1994 USHORT Reserved; // For alignment
1995 SHORT X, Y; // Top-left coordinates of the rect in the destination surface
1996} D3DCOMPOSERECTDESTINATION;
1997
1998#define D3DCOMPOSERECTS_MAXNUMRECTS 0xFFFF
1999#define D3DCONVOLUTIONMONO_MAXWIDTH 7
2000#define D3DCONVOLUTIONMONO_MAXHEIGHT D3DCONVOLUTIONMONO_MAXWIDTH
2001#define D3DFMT_A1_SURFACE_MAXWIDTH 8192
2002#define D3DFMT_A1_SURFACE_MAXHEIGHT 2048
2003
2004
2005typedef struct _D3DPRESENTSTATS {
2006 UINT PresentCount;
2007 UINT PresentRefreshCount;
2008 UINT SyncRefreshCount;
2009 LARGE_INTEGER SyncQPCTime;
2010 LARGE_INTEGER SyncGPUTime;
2011} D3DPRESENTSTATS;
2012
2013typedef enum D3DSCANLINEORDERING
2014{
2015 D3DSCANLINEORDERING_UNKNOWN = 0,
2016 D3DSCANLINEORDERING_PROGRESSIVE = 1,
2017 D3DSCANLINEORDERING_INTERLACED = 2,
2018} D3DSCANLINEORDERING;
2019
2020
2021typedef struct D3DDISPLAYMODEEX
2022{
2023 UINT Size;
2024 UINT Width;
2025 UINT Height;
2026 UINT RefreshRate;
2027 D3DFORMAT Format;
2028 D3DSCANLINEORDERING ScanLineOrdering;
2029} D3DDISPLAYMODEEX;
2030
2031typedef struct D3DDISPLAYMODEFILTER
2032{
2033 UINT Size;
2034 D3DFORMAT Format;
2035 D3DSCANLINEORDERING ScanLineOrdering;
2036} D3DDISPLAYMODEFILTER;
2037
2038
2039typedef enum D3DDISPLAYROTATION
2040{
2041 D3DDISPLAYROTATION_IDENTITY = 1, // No rotation.
2042 D3DDISPLAYROTATION_90 = 2, // Rotated 90 degrees.
2043 D3DDISPLAYROTATION_180 = 3, // Rotated 180 degrees.
2044 D3DDISPLAYROTATION_270 = 4 // Rotated 270 degrees.
2045} D3DDISPLAYROTATION;
2046
2047/* For use in ID3DResource9::SetPriority calls */
2048#define D3D9_RESOURCE_PRIORITY_MINIMUM 0x28000000
2049#define D3D9_RESOURCE_PRIORITY_LOW 0x50000000
2050#define D3D9_RESOURCE_PRIORITY_NORMAL 0x78000000
2051#define D3D9_RESOURCE_PRIORITY_HIGH 0xa0000000
2052#define D3D9_RESOURCE_PRIORITY_MAXIMUM 0xc8000000
2053
2054#define D3D_OMAC_SIZE 16
2055
2056typedef struct _D3D_OMAC
2057{
2058 BYTE Omac[D3D_OMAC_SIZE];
2059} D3D_OMAC;
2060
2061typedef enum _D3DAUTHENTICATEDCHANNELTYPE
2062{
2063 D3DAUTHENTICATEDCHANNEL_D3D9 = 1,
2064 D3DAUTHENTICATEDCHANNEL_DRIVER_SOFTWARE = 2,
2065 D3DAUTHENTICATEDCHANNEL_DRIVER_HARDWARE = 3,
2066} D3DAUTHENTICATEDCHANNELTYPE;
2067
2068typedef struct _D3DAUTHENTICATEDCHANNEL_QUERY_INPUT
2069{
2070 GUID QueryType;
2071 HANDLE hChannel;
2072 UINT SequenceNumber;
2073} D3DAUTHENTICATEDCHANNEL_QUERY_INPUT;
2074
2075typedef struct _D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT
2076{
2077 D3D_OMAC omac;
2078 GUID QueryType;
2079 HANDLE hChannel;
2080 UINT SequenceNumber;
2081 HRESULT ReturnCode;
2082} D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT;
2083
2084DEFINE_GUID(D3DAUTHENTICATEDQUERY_PROTECTION,
20850xa84eb584, 0xc495, 0x48aa, 0xb9, 0x4d, 0x8b, 0xd2, 0xd6, 0xfb, 0xce, 0x5);
2086
2087typedef struct _D3DAUTHENTICATEDCHANNEL_PROTECTION_FLAGS
2088{
2089 union
2090 {
2091 struct
2092 {
2093 UINT ProtectionEnabled : 1;
2094 UINT OverlayOrFullscreenRequired : 1;
2095 UINT Reserved : 30;
2096 };
2097 UINT Value;
2098 };
2099
2100} D3DAUTHENTICATEDCHANNEL_PROTECTION_FLAGS;
2101
2102typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYPROTECTION_OUTPUT
2103{
2104 D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output;
2105
2106 D3DAUTHENTICATEDCHANNEL_PROTECTION_FLAGS ProtectionFlags;
2107
2108} D3DAUTHENTICATEDCHANNEL_QUERYPROTECTION_OUTPUT;
2109
2110
2111DEFINE_GUID(D3DAUTHENTICATEDQUERY_CHANNELTYPE,
21120xbc1b18a5, 0xb1fb, 0x42ab, 0xbd, 0x94, 0xb5, 0x82, 0x8b, 0x4b, 0xf7, 0xbe);
2113
2114typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYCHANNELTYPE_OUTPUT
2115{
2116 D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output;
2117
2118 D3DAUTHENTICATEDCHANNELTYPE ChannelType;
2119
2120} D3DAUTHENTICATEDCHANNEL_QUERYCHANNELTYPE_OUTPUT;
2121
2122
2123DEFINE_GUID(D3DAUTHENTICATEDQUERY_DEVICEHANDLE,
21240xec1c539d, 0x8cff, 0x4e2a, 0xbc, 0xc4, 0xf5, 0x69, 0x2f, 0x99, 0xf4, 0x80);
2125
2126typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYDEVICEHANDLE_OUTPUT
2127{
2128 D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output;
2129
2130 HANDLE DeviceHandle;
2131
2132} D3DAUTHENTICATEDCHANNEL_QUERYDEVICEHANDLE_OUTPUT;
2133
2134
2135DEFINE_GUID(D3DAUTHENTICATEDQUERY_CRYPTOSESSION,
21360x2634499e, 0xd018, 0x4d74, 0xac, 0x17, 0x7f, 0x72, 0x40, 0x59, 0x52, 0x8d);
2137
2138typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYCRYPTOSESSION_INPUT
2139{
2140 D3DAUTHENTICATEDCHANNEL_QUERY_INPUT Input;
2141
2142 HANDLE DXVA2DecodeHandle;
2143
2144} D3DAUTHENTICATEDCHANNEL_QUERYCRYPTOSESSION_INPUT;
2145
2146typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYCRYPTOSESSION_OUTPUT
2147{
2148 D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output;
2149
2150 HANDLE DXVA2DecodeHandle;
2151 HANDLE CryptoSessionHandle;
2152 HANDLE DeviceHandle;
2153
2154} D3DAUTHENTICATEDCHANNEL_QUERYCRYPTOSESSION_OUTPUT;
2155
2156
2157DEFINE_GUID(D3DAUTHENTICATEDQUERY_RESTRICTEDSHAREDRESOURCEPROCESSCOUNT,
21580xdb207b3, 0x9450, 0x46a6, 0x82, 0xde, 0x1b, 0x96, 0xd4, 0x4f, 0x9c, 0xf2);
2159
2160typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESSCOUNT_OUTPUT
2161{
2162 D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output;
2163
2164 UINT NumRestrictedSharedResourceProcesses;
2165
2166} D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESSCOUNT_OUTPUT;
2167
2168
2169DEFINE_GUID(D3DAUTHENTICATEDQUERY_RESTRICTEDSHAREDRESOURCEPROCESS,
21700x649bbadb, 0xf0f4, 0x4639, 0xa1, 0x5b, 0x24, 0x39, 0x3f, 0xc3, 0xab, 0xac);
2171
2172typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESS_INPUT
2173{
2174 D3DAUTHENTICATEDCHANNEL_QUERY_INPUT Input;
2175
2176 UINT ProcessIndex;
2177
2178} D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESS_INPUT;
2179
2180typedef enum _D3DAUTHENTICATEDCHANNEL_PROCESSIDENTIFIERTYPE
2181{
2182 PROCESSIDTYPE_UNKNOWN = 0,
2183 PROCESSIDTYPE_DWM = 1,
2184 PROCESSIDTYPE_HANDLE = 2
2185} D3DAUTHENTICATEDCHANNEL_PROCESSIDENTIFIERTYPE;
2186
2187typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESS_OUTPUT
2188{
2189 D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output;
2190
2191 UINT ProcessIndex;
2192 D3DAUTHENTICATEDCHANNEL_PROCESSIDENTIFIERTYPE ProcessIdentifer;
2193 HANDLE ProcessHandle;
2194
2195} D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESS_OUTPUT;
2196
2197
2198DEFINE_GUID(D3DAUTHENTICATEDQUERY_UNRESTRICTEDPROTECTEDSHAREDRESOURCECOUNT,
21990x12f0bd6, 0xe662, 0x4474, 0xbe, 0xfd, 0xaa, 0x53, 0xe5, 0x14, 0x3c, 0x6d);
2200
2201typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYUNRESTRICTEDPROTECTEDSHAREDRESOURCECOUNT_OUTPUT
2202{
2203 D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output;
2204
2205 UINT NumUnrestrictedProtectedSharedResources;
2206
2207} D3DAUTHENTICATEDCHANNEL_QUERYUNRESTRICTEDPROTECTEDSHAREDRESOURCECOUNT_OUTPUT;
2208
2209
2210DEFINE_GUID(D3DAUTHENTICATEDQUERY_OUTPUTIDCOUNT,
22110x2c042b5e, 0x8c07, 0x46d5, 0xaa, 0xbe, 0x8f, 0x75, 0xcb, 0xad, 0x4c, 0x31);
2212
2213typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTIDCOUNT_INPUT
2214{
2215 D3DAUTHENTICATEDCHANNEL_QUERY_INPUT Input;
2216
2217 HANDLE DeviceHandle;
2218 HANDLE CryptoSessionHandle;
2219
2220} D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTIDCOUNT_INPUT;
2221
2222typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTIDCOUNT_OUTPUT
2223{
2224 D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output;
2225
2226 HANDLE DeviceHandle;
2227 HANDLE CryptoSessionHandle;
2228 UINT NumOutputIDs;
2229
2230} D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTIDCOUNT_OUTPUT;
2231
2232
2233DEFINE_GUID(D3DAUTHENTICATEDQUERY_OUTPUTID,
22340x839ddca3, 0x9b4e, 0x41e4, 0xb0, 0x53, 0x89, 0x2b, 0xd2, 0xa1, 0x1e, 0xe7);
2235
2236typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTID_INPUT
2237{
2238 D3DAUTHENTICATEDCHANNEL_QUERY_INPUT Input;
2239
2240 HANDLE DeviceHandle;
2241 HANDLE CryptoSessionHandle;
2242 UINT OutputIDIndex;
2243
2244} D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTID_INPUT;
2245
2246typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTID_OUTPUT
2247{
2248 D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output;
2249
2250 HANDLE DeviceHandle;
2251 HANDLE CryptoSessionHandle;
2252 UINT OutputIDIndex;
2253 UINT64 OutputID;
2254
2255} D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTID_OUTPUT;
2256
2257
2258DEFINE_GUID(D3DAUTHENTICATEDQUERY_ACCESSIBILITYATTRIBUTES,
22590x6214d9d2, 0x432c, 0x4abb, 0x9f, 0xce, 0x21, 0x6e, 0xea, 0x26, 0x9e, 0x3b);
2260
2261typedef enum _D3DBUSTYPE
2262{
2263 D3DBUSTYPE_OTHER = 0x00000000,
2264 D3DBUSTYPE_PCI = 0x00000001,
2265 D3DBUSTYPE_PCIX = 0x00000002,
2266 D3DBUSTYPE_PCIEXPRESS = 0x00000003,
2267 D3DBUSTYPE_AGP = 0x00000004,
2268 D3DBUSIMPL_MODIFIER_INSIDE_OF_CHIPSET = 0x00010000,
2269 D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP = 0x00020000,
2270 D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET = 0x00030000,
2271 D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR = 0x00040000,
2272 D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE = 0x00050000,
2273 D3DBUSIMPL_MODIFIER_NON_STANDARD = 0x80000000,
2274} D3DBUSTYPE;
2275
2276typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYINFOBUSTYPE_OUTPUT
2277{
2278 D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output;
2279
2280 D3DBUSTYPE BusType;
2281 BOOL bAccessibleInContiguousBlocks;
2282 BOOL bAccessibleInNonContiguousBlocks;
2283
2284} D3DAUTHENTICATEDCHANNEL_QUERYINFOBUSTYPE_OUTPUT;
2285
2286
2287DEFINE_GUID(D3DAUTHENTICATEDQUERY_ENCRYPTIONWHENACCESSIBLEGUIDCOUNT,
22880xb30f7066, 0x203c, 0x4b07, 0x93, 0xfc, 0xce, 0xaa, 0xfd, 0x61, 0x24, 0x1e);
2289
2290typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUIDCOUNT_OUTPUT
2291{
2292 D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output;
2293
2294 UINT NumEncryptionGuids;
2295
2296} D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUIDCOUNT_OUTPUT;
2297
2298
2299DEFINE_GUID(D3DAUTHENTICATEDQUERY_ENCRYPTIONWHENACCESSIBLEGUID,
23000xf83a5958, 0xe986, 0x4bda, 0xbe, 0xb0, 0x41, 0x1f, 0x6a, 0x7a, 0x1, 0xb7);
2301
2302typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUID_INPUT
2303{
2304 D3DAUTHENTICATEDCHANNEL_QUERY_INPUT Input;
2305
2306 UINT EncryptionGuidIndex;
2307
2308} D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUID_INPUT;
2309
2310typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUID_OUTPUT
2311{
2312 D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output;
2313
2314 UINT EncryptionGuidIndex;
2315 GUID EncryptionGuid;
2316
2317} D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUID_OUTPUT;
2318
2319
2320DEFINE_GUID(D3DAUTHENTICATEDQUERY_CURRENTENCRYPTIONWHENACCESSIBLE,
23210xec1791c7, 0xdad3, 0x4f15, 0x9e, 0xc3, 0xfa, 0xa9, 0x3d, 0x60, 0xd4, 0xf0);
2322
2323typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYUNCOMPRESSEDENCRYPTIONLEVEL_OUTPUT
2324{
2325 D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output;
2326
2327 GUID EncryptionGuid;
2328
2329} D3DAUTHENTICATEDCHANNEL_QUERYUNCOMPRESSEDENCRYPTIONLEVEL_OUTPUT;
2330
2331
2332typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT
2333{
2334 D3D_OMAC omac;
2335 GUID ConfigureType;
2336 HANDLE hChannel;
2337 UINT SequenceNumber;
2338
2339} D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT;
2340
2341typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGURE_OUTPUT
2342{
2343 D3D_OMAC omac;
2344 GUID ConfigureType;
2345 HANDLE hChannel;
2346 UINT SequenceNumber;
2347 HRESULT ReturnCode;
2348
2349} D3DAUTHENTICATEDCHANNEL_CONFIGURE_OUTPUT;
2350
2351DEFINE_GUID(D3DAUTHENTICATEDCONFIGURE_INITIALIZE,
23520x6114bdb, 0x3523, 0x470a, 0x8d, 0xca, 0xfb, 0xc2, 0x84, 0x51, 0x54, 0xf0);
2353
2354typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGUREINITIALIZE
2355{
2356 D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT Parameters;
2357
2358 UINT StartSequenceQuery;
2359 UINT StartSequenceConfigure;
2360
2361} D3DAUTHENTICATEDCHANNEL_CONFIGUREINITIALIZE;
2362
2363
2364DEFINE_GUID(D3DAUTHENTICATEDCONFIGURE_PROTECTION,
23650x50455658, 0x3f47, 0x4362, 0xbf, 0x99, 0xbf, 0xdf, 0xcd, 0xe9, 0xed, 0x29);
2366
2367typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGUREPROTECTION
2368{
2369 D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT Parameters;
2370
2371 D3DAUTHENTICATEDCHANNEL_PROTECTION_FLAGS Protections;
2372
2373} D3DAUTHENTICATEDCHANNEL_CONFIGUREPROTECTION;
2374
2375
2376DEFINE_GUID(D3DAUTHENTICATEDCONFIGURE_CRYPTOSESSION,
23770x6346cc54, 0x2cfc, 0x4ad4, 0x82, 0x24, 0xd1, 0x58, 0x37, 0xde, 0x77, 0x0);
2378
2379typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGURECRYPTOSESSION
2380{
2381 D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT Parameters;
2382
2383 HANDLE DXVA2DecodeHandle;
2384 HANDLE CryptoSessionHandle;
2385 HANDLE DeviceHandle;
2386
2387} D3DAUTHENTICATEDCHANNEL_CONFIGURECRYPTOSESSION;
2388
2389
2390DEFINE_GUID(D3DAUTHENTICATEDCONFIGURE_SHAREDRESOURCE,
23910x772d047, 0x1b40, 0x48e8, 0x9c, 0xa6, 0xb5, 0xf5, 0x10, 0xde, 0x9f, 0x1);
2392
2393typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGURESHAREDRESOURCE
2394{
2395 D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT Parameters;
2396
2397 D3DAUTHENTICATEDCHANNEL_PROCESSIDENTIFIERTYPE ProcessIdentiferType;
2398 HANDLE ProcessHandle;
2399 BOOL AllowAccess;
2400
2401} D3DAUTHENTICATEDCHANNEL_CONFIGURESHAREDRESOURCE;
2402
2403
2404DEFINE_GUID(D3DAUTHENTICATEDCONFIGURE_ENCRYPTIONWHENACCESSIBLE,
24050x41fff286, 0x6ae0, 0x4d43, 0x9d, 0x55, 0xa4, 0x6e, 0x9e, 0xfd, 0x15, 0x8a);
2406
2407typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGUREUNCOMPRESSEDENCRYPTION
2408{
2409 D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT Parameters;
2410
2411 GUID EncryptionGuid;
2412
2413} D3DAUTHENTICATEDCHANNEL_CONFIGUREUNCOMPRESSEDENCRYPTION;
2414
2415typedef struct _D3DENCRYPTED_BLOCK_INFO
2416{
2417 UINT NumEncryptedBytesAtBeginning;
2418 UINT NumBytesInSkipPattern;
2419 UINT NumBytesInEncryptPattern;
2420} D3DENCRYPTED_BLOCK_INFO;
2421
2422typedef struct _D3DAES_CTR_IV
2423{
2424 UINT64 IV; // Big-Endian IV
2425 UINT64 Count; // Big-Endian Block Count
2426} D3DAES_CTR_IV;
2427
2428
2429#endif // !D3D_DISABLE_9EX
2430/* -- D3D9Ex only */
2431
2432#pragma pack()
2433#if _MSC_VER >= 1200
2434#pragma warning(pop)
2435#else
2436#pragma warning(default:4201)
2437#endif
2438
2439
2440#endif /* (DIRECT3D_VERSION >= 0x0900) */
2441#endif /* _d3d9TYPES(P)_H_ */
2442
2443

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of imgui/dxsdk/Include/d3d9types.h