]> git.cworth.org Git - apitrace/blob - d3d9caps.py
Merge remote-tracking branch 'github/markdown'
[apitrace] / d3d9caps.py
1 ##########################################################################
2 #
3 # Copyright 2008-2009 VMware, Inc.
4 # All Rights Reserved.
5 #
6 # Permission is hereby granted, free of charge, to any person obtaining a copy
7 # of this software and associated documentation files (the "Software"), to deal
8 # in the Software without restriction, including without limitation the rights
9 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 # copies of the Software, and to permit persons to whom the Software is
11 # furnished to do so, subject to the following conditions:
12 #
13 # The above copyright notice and this permission notice shall be included in
14 # all copies or substantial portions of the Software.
15 #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 # THE SOFTWARE.
23 #
24 ##########################################################################/
25
26 """d3d9caps.h"""
27
28 from winapi import *
29 from d3d9types import *
30
31 D3DVS20CAPS = Flags(DWORD, [
32     "D3DVS20CAPS_PREDICATION",
33 ])
34
35 D3DVSHADERCAPS2_0 = Struct("D3DVSHADERCAPS2_0", [
36     (D3DVS20CAPS, "Caps"),
37     (INT, "DynamicFlowControlDepth"),
38     (INT, "NumTemps"),
39     (INT, "StaticFlowControlDepth"),
40 ])
41
42 D3DPS20CAPS = Flags(DWORD, [
43     "D3DPS20CAPS_ARBITRARYSWIZZLE",
44     "D3DPS20CAPS_GRADIENTINSTRUCTIONS",
45     "D3DPS20CAPS_PREDICATION",
46     "D3DPS20CAPS_NODEPENDENTREADLIMIT",
47     "D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT",
48 ])
49
50 D3DPSHADERCAPS2_0 = Struct("D3DPSHADERCAPS2_0", [
51     (D3DPS20CAPS, "Caps"),
52     (INT, "DynamicFlowControlDepth"),
53     (INT, "NumTemps"),
54     (INT, "StaticFlowControlDepth"),
55     (INT, "NumInstructionSlots"),
56 ])
57
58 D3DCAPS = Flags(DWORD, [
59     "D3DCAPS_READ_SCANLINE",
60 ])
61
62 D3DCAPS2 = Flags(DWORD, [
63     "D3DCAPS2_FULLSCREENGAMMA",
64     "D3DCAPS2_CANCALIBRATEGAMMA",
65     "D3DCAPS2_RESERVED",
66     "D3DCAPS2_CANMANAGERESOURCE",
67     "D3DCAPS2_DYNAMICTEXTURES",
68     "D3DCAPS2_CANAUTOGENMIPMAP",
69     "D3DCAPS2_CANSHARERESOURCE",
70 ])
71
72 D3DCAPS3 = Flags(DWORD, [
73     "D3DCAPS3_RESERVED",
74     "D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD",
75     "D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION",
76     "D3DCAPS3_COPY_TO_VIDMEM",
77     "D3DCAPS3_COPY_TO_SYSTEMMEM",
78 ])
79
80
81 D3DPRESENT_INTERVAL = Flags(DWORD, [
82     #"D3DPRESENT_INTERVAL_DEFAULT", # 0
83     "D3DPRESENT_INTERVAL_ONE",
84     "D3DPRESENT_INTERVAL_TWO",
85     "D3DPRESENT_INTERVAL_THREE",
86     "D3DPRESENT_INTERVAL_FOUR",
87     "D3DPRESENT_INTERVAL_IMMEDIATE",
88 ])
89
90 D3DCURSORCAPS = Flags(DWORD, [
91     "D3DCURSORCAPS_COLOR",
92     "D3DCURSORCAPS_LOWRES",
93 ])
94
95 D3DDEVCAPS = Flags(DWORD, [
96     "D3DDEVCAPS_EXECUTESYSTEMMEMORY",
97     "D3DDEVCAPS_EXECUTEVIDEOMEMORY",
98     "D3DDEVCAPS_TLVERTEXSYSTEMMEMORY",
99     "D3DDEVCAPS_TLVERTEXVIDEOMEMORY",
100     "D3DDEVCAPS_TEXTURESYSTEMMEMORY",
101     "D3DDEVCAPS_TEXTUREVIDEOMEMORY",
102     "D3DDEVCAPS_DRAWPRIMTLVERTEX",
103     "D3DDEVCAPS_CANRENDERAFTERFLIP",
104     "D3DDEVCAPS_TEXTURENONLOCALVIDMEM",
105     "D3DDEVCAPS_DRAWPRIMITIVES2",
106     "D3DDEVCAPS_SEPARATETEXTUREMEMORIES",
107     "D3DDEVCAPS_DRAWPRIMITIVES2EX",
108     "D3DDEVCAPS_HWTRANSFORMANDLIGHT",
109     "D3DDEVCAPS_CANBLTSYSTONONLOCAL",
110     "D3DDEVCAPS_HWRASTERIZATION",
111     "D3DDEVCAPS_PUREDEVICE",
112     "D3DDEVCAPS_QUINTICRTPATCHES",
113     "D3DDEVCAPS_RTPATCHES",
114     "D3DDEVCAPS_RTPATCHHANDLEZERO",
115     "D3DDEVCAPS_NPATCHES",
116 ])
117
118 D3DPMISCCAPS = Flags(DWORD, [
119     "D3DPMISCCAPS_MASKZ",
120     "D3DPMISCCAPS_CULLNONE",
121     "D3DPMISCCAPS_CULLCW",
122     "D3DPMISCCAPS_CULLCCW",
123     "D3DPMISCCAPS_COLORWRITEENABLE",
124     "D3DPMISCCAPS_CLIPPLANESCALEDPOINTS",
125     "D3DPMISCCAPS_CLIPTLVERTS",
126     "D3DPMISCCAPS_TSSARGTEMP",
127     "D3DPMISCCAPS_BLENDOP",
128     "D3DPMISCCAPS_NULLREFERENCE",
129     "D3DPMISCCAPS_INDEPENDENTWRITEMASKS",
130     "D3DPMISCCAPS_PERSTAGECONSTANT",
131     "D3DPMISCCAPS_FOGANDSPECULARALPHA",
132     "D3DPMISCCAPS_SEPARATEALPHABLEND",
133     "D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS",
134     "D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING",
135     "D3DPMISCCAPS_FOGVERTEXCLAMPED",
136     "D3DPMISCCAPS_POSTBLENDSRGBCONVERT",
137 ])
138
139 D3DLINECAPS = Flags(DWORD, [
140     "D3DLINECAPS_TEXTURE",
141     "D3DLINECAPS_ZTEST",
142     "D3DLINECAPS_BLEND",
143     "D3DLINECAPS_ALPHACMP",
144     "D3DLINECAPS_FOG",
145     "D3DLINECAPS_ANTIALIAS",
146 ])
147
148 D3DPRASTERCAPS = Flags(DWORD, [
149     "D3DPRASTERCAPS_DITHER",
150     "D3DPRASTERCAPS_ZTEST",
151     "D3DPRASTERCAPS_FOGVERTEX",
152     "D3DPRASTERCAPS_FOGTABLE",
153     "D3DPRASTERCAPS_MIPMAPLODBIAS",
154     "D3DPRASTERCAPS_ZBUFFERLESSHSR",
155     "D3DPRASTERCAPS_FOGRANGE",
156     "D3DPRASTERCAPS_ANISOTROPY",
157     "D3DPRASTERCAPS_WBUFFER",
158     "D3DPRASTERCAPS_WFOG",
159     "D3DPRASTERCAPS_ZFOG",
160     "D3DPRASTERCAPS_COLORPERSPECTIVE",
161     "D3DPRASTERCAPS_SCISSORTEST",
162     "D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS",
163     "D3DPRASTERCAPS_DEPTHBIAS",
164     "D3DPRASTERCAPS_MULTISAMPLE_TOGGLE",
165 ])
166
167 D3DPCMPCAPS = Flags(DWORD, [
168     "D3DPCMPCAPS_NEVER",
169     "D3DPCMPCAPS_LESS",
170     "D3DPCMPCAPS_EQUAL",
171     "D3DPCMPCAPS_LESSEQUAL",
172     "D3DPCMPCAPS_GREATER",
173     "D3DPCMPCAPS_NOTEQUAL",
174     "D3DPCMPCAPS_GREATEREQUAL",
175     "D3DPCMPCAPS_ALWAYS",
176 ])
177
178 D3DPBLENDCAPS = Flags(DWORD, [
179     "D3DPBLENDCAPS_ZERO",
180     "D3DPBLENDCAPS_ONE",
181     "D3DPBLENDCAPS_SRCCOLOR",
182     "D3DPBLENDCAPS_INVSRCCOLOR",
183     "D3DPBLENDCAPS_SRCALPHA",
184     "D3DPBLENDCAPS_INVSRCALPHA",
185     "D3DPBLENDCAPS_DESTALPHA",
186     "D3DPBLENDCAPS_INVDESTALPHA",
187     "D3DPBLENDCAPS_DESTCOLOR",
188     "D3DPBLENDCAPS_INVDESTCOLOR",
189     "D3DPBLENDCAPS_SRCALPHASAT",
190     "D3DPBLENDCAPS_BOTHSRCALPHA",
191     "D3DPBLENDCAPS_BOTHINVSRCALPHA",
192     "D3DPBLENDCAPS_BLENDFACTOR",
193     "D3DPBLENDCAPS_SRCCOLOR2",
194     "D3DPBLENDCAPS_INVSRCCOLOR2",
195 ])
196
197 D3DPSHADECAPS = Flags(DWORD, [
198     "D3DPSHADECAPS_COLORGOURAUDRGB",
199     "D3DPSHADECAPS_SPECULARGOURAUDRGB",
200     "D3DPSHADECAPS_ALPHAGOURAUDBLEND",
201     "D3DPSHADECAPS_FOGGOURAUD",
202 ])
203
204 D3DPTEXTURECAPS = Flags(DWORD, [
205     "D3DPTEXTURECAPS_PERSPECTIVE",
206     "D3DPTEXTURECAPS_POW2",
207     "D3DPTEXTURECAPS_ALPHA",
208     "D3DPTEXTURECAPS_SQUAREONLY",
209     "D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE",
210     "D3DPTEXTURECAPS_ALPHAPALETTE",
211     "D3DPTEXTURECAPS_NONPOW2CONDITIONAL",
212     "D3DPTEXTURECAPS_PROJECTED",
213     "D3DPTEXTURECAPS_CUBEMAP",
214     "D3DPTEXTURECAPS_VOLUMEMAP",
215     "D3DPTEXTURECAPS_MIPMAP",
216     "D3DPTEXTURECAPS_MIPVOLUMEMAP",
217     "D3DPTEXTURECAPS_MIPCUBEMAP",
218     "D3DPTEXTURECAPS_CUBEMAP_POW2",
219     "D3DPTEXTURECAPS_VOLUMEMAP_POW2",
220     "D3DPTEXTURECAPS_NOPROJECTEDBUMPENV",
221 ])
222
223 D3DPTFILTERCAPS = Flags(DWORD, [
224     "D3DPTFILTERCAPS_MINFPOINT",
225     "D3DPTFILTERCAPS_MINFLINEAR",
226     "D3DPTFILTERCAPS_MINFANISOTROPIC",
227     "D3DPTFILTERCAPS_MINFPYRAMIDALQUAD",
228     "D3DPTFILTERCAPS_MINFGAUSSIANQUAD",
229     "D3DPTFILTERCAPS_MIPFPOINT",
230     "D3DPTFILTERCAPS_MIPFLINEAR",
231     "D3DPTFILTERCAPS_CONVOLUTIONMONO",
232     "D3DPTFILTERCAPS_MAGFPOINT",
233     "D3DPTFILTERCAPS_MAGFLINEAR",
234     "D3DPTFILTERCAPS_MAGFANISOTROPIC",
235     "D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD",
236     "D3DPTFILTERCAPS_MAGFGAUSSIANQUAD",
237 ])
238
239 D3DPTADDRESSCAPS = Flags(DWORD, [
240     "D3DPTADDRESSCAPS_WRAP",
241     "D3DPTADDRESSCAPS_MIRROR",
242     "D3DPTADDRESSCAPS_CLAMP",
243     "D3DPTADDRESSCAPS_BORDER",
244     "D3DPTADDRESSCAPS_INDEPENDENTUV",
245     "D3DPTADDRESSCAPS_MIRRORONCE",
246 ])
247
248 D3DSTENCILCAPS = Flags(DWORD, [
249     "D3DSTENCILCAPS_KEEP",
250     "D3DSTENCILCAPS_ZERO",
251     "D3DSTENCILCAPS_REPLACE",
252     "D3DSTENCILCAPS_INCRSAT",
253     "D3DSTENCILCAPS_DECRSAT",
254     "D3DSTENCILCAPS_INVERT",
255     "D3DSTENCILCAPS_INCR",
256     "D3DSTENCILCAPS_DECR",
257     "D3DSTENCILCAPS_TWOSIDED",
258 ])
259
260 D3DTEXOPCAPS = Flags(DWORD, [
261     "D3DTEXOPCAPS_DISABLE",
262     "D3DTEXOPCAPS_SELECTARG1",
263     "D3DTEXOPCAPS_SELECTARG2",
264     "D3DTEXOPCAPS_MODULATE",
265     "D3DTEXOPCAPS_MODULATE2X",
266     "D3DTEXOPCAPS_MODULATE4X",
267     "D3DTEXOPCAPS_ADD",
268     "D3DTEXOPCAPS_ADDSIGNED",
269     "D3DTEXOPCAPS_ADDSIGNED2X",
270     "D3DTEXOPCAPS_SUBTRACT",
271     "D3DTEXOPCAPS_ADDSMOOTH",
272     "D3DTEXOPCAPS_BLENDDIFFUSEALPHA",
273     "D3DTEXOPCAPS_BLENDTEXTUREALPHA",
274     "D3DTEXOPCAPS_BLENDFACTORALPHA",
275     "D3DTEXOPCAPS_BLENDTEXTUREALPHAPM",
276     "D3DTEXOPCAPS_BLENDCURRENTALPHA",
277     "D3DTEXOPCAPS_PREMODULATE",
278     "D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR",
279     "D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA",
280     "D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR",
281     "D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA",
282     "D3DTEXOPCAPS_BUMPENVMAP",
283     "D3DTEXOPCAPS_BUMPENVMAPLUMINANCE",
284     "D3DTEXOPCAPS_DOTPRODUCT3",
285     "D3DTEXOPCAPS_MULTIPLYADD",
286     "D3DTEXOPCAPS_LERP",
287 ])
288
289 D3DFVFCAPS = Flags(DWORD, [
290     "D3DFVFCAPS_TEXCOORDCOUNTMASK",
291     "D3DFVFCAPS_DONOTSTRIPELEMENTS",
292     "D3DFVFCAPS_PSIZE",
293 ])
294
295 D3DVTXPCAPS = Flags(DWORD, [
296     "D3DVTXPCAPS_TEXGEN",
297     "D3DVTXPCAPS_MATERIALSOURCE7",
298     "D3DVTXPCAPS_DIRECTIONALLIGHTS",
299     "D3DVTXPCAPS_POSITIONALLIGHTS",
300     "D3DVTXPCAPS_LOCALVIEWER",
301     "D3DVTXPCAPS_TWEENING",
302     "D3DVTXPCAPS_TEXGEN_SPHEREMAP",
303     "D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER",
304 ])
305
306 D3DDEVCAPS2 = Flags(DWORD, [
307     "D3DDEVCAPS2_STREAMOFFSET",
308     "D3DDEVCAPS2_DMAPNPATCH",
309     "D3DDEVCAPS2_ADAPTIVETESSRTPATCH",
310     "D3DDEVCAPS2_ADAPTIVETESSNPATCH",
311     "D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES",
312     "D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH",
313     "D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET",
314 ])
315
316 D3DDTCAPS = Flags(DWORD, [
317     "D3DDTCAPS_UBYTE4",
318     "D3DDTCAPS_UBYTE4N",
319     "D3DDTCAPS_SHORT2N",
320     "D3DDTCAPS_SHORT4N",
321     "D3DDTCAPS_USHORT2N",
322     "D3DDTCAPS_USHORT4N",
323     "D3DDTCAPS_UDEC3",
324     "D3DDTCAPS_DEC3N",
325     "D3DDTCAPS_FLOAT16_2",
326     "D3DDTCAPS_FLOAT16_4",
327 ])
328
329 #D3DPS_VERSION = Enum("DWORD", [
330 #    "D3DPS_VERSION(0,0)",
331 #    "D3DPS_VERSION(1,0)",
332 #    "D3DPS_VERSION(1,1)",
333 #    "D3DPS_VERSION(1,2)",
334 #    "D3DPS_VERSION(1,3)",
335 #    "D3DPS_VERSION(1,4)",
336 #    "D3DPS_VERSION(2,0)",
337 #    "D3DPS_VERSION(3,0)",
338 #])
339 D3DPS_VERSION = DWORD
340
341 #D3DVS_VERSION = Enum("DWORD", [
342 #    "D3DVS_VERSION(0,0)",
343 #    "D3DVS_VERSION(1,0)",
344 #    "D3DVS_VERSION(1,1)",
345 #    "D3DVS_VERSION(2,0)",
346 #    "D3DVS_VERSION(3,0)",
347 #])
348 D3DVS_VERSION = DWORD
349
350 D3DCAPS9 = Struct("D3DCAPS9", [
351     (D3DDEVTYPE, "DeviceType"),
352     (UINT, "AdapterOrdinal"),
353     (D3DCAPS, "Caps"),
354     (D3DCAPS2, "Caps2"),
355     (D3DCAPS3, "Caps3"),
356     (D3DPRESENT_INTERVAL, "PresentationIntervals"),
357     (D3DCURSORCAPS, "CursorCaps"),
358     (D3DDEVCAPS, "DevCaps"),
359     (D3DPMISCCAPS, "PrimitiveMiscCaps"),
360     (D3DPRASTERCAPS, "RasterCaps"),
361     (D3DPCMPCAPS, "ZCmpCaps"),
362     (D3DPBLENDCAPS, "SrcBlendCaps"),
363     (D3DPBLENDCAPS, "DestBlendCaps"),
364     (D3DPCMPCAPS, "AlphaCmpCaps"),
365     (D3DPSHADECAPS, "ShadeCaps"),
366     (D3DPTEXTURECAPS, "TextureCaps"),
367     (D3DPTFILTERCAPS, "TextureFilterCaps"),
368     (D3DPTFILTERCAPS, "CubeTextureFilterCaps"),
369     (D3DPTFILTERCAPS, "VolumeTextureFilterCaps"),
370     (D3DPTADDRESSCAPS, "TextureAddressCaps"),
371     (D3DPTADDRESSCAPS, "VolumeTextureAddressCaps"),
372     (D3DLINECAPS, "LineCaps"),
373     (DWORD, "MaxTextureWidth"),
374     (DWORD, "MaxTextureHeight"),
375     (DWORD, "MaxVolumeExtent"),
376     (DWORD, "MaxTextureRepeat"),
377     (DWORD, "MaxTextureAspectRatio"),
378     (DWORD, "MaxAnisotropy"),
379     (Float, "MaxVertexW"),
380     (Float, "GuardBandLeft"),
381     (Float, "GuardBandTop"),
382     (Float, "GuardBandRight"),
383     (Float, "GuardBandBottom"),
384     (Float, "ExtentsAdjust"),
385     (D3DSTENCILCAPS, "StencilCaps"),
386     (D3DFVFCAPS, "FVFCaps"),
387     (D3DTEXOPCAPS, "TextureOpCaps"),
388     (DWORD, "MaxTextureBlendStages"),
389     (DWORD, "MaxSimultaneousTextures"),
390     (D3DVTXPCAPS, "VertexProcessingCaps"),
391     (DWORD, "MaxActiveLights"),
392     (DWORD, "MaxUserClipPlanes"),
393     (DWORD, "MaxVertexBlendMatrices"),
394     (DWORD, "MaxVertexBlendMatrixIndex"),
395     (Float, "MaxPointSize"),
396     (DWORD, "MaxPrimitiveCount"),
397     (DWORD, "MaxVertexIndex"),
398     (DWORD, "MaxStreams"),
399     (DWORD, "MaxStreamStride"),
400     (D3DVS_VERSION, "VertexShaderVersion"),
401     (DWORD, "MaxVertexShaderConst"),
402     (D3DPS_VERSION, "PixelShaderVersion"),
403     (Float, "PixelShader1xMaxValue"),
404     (D3DDEVCAPS2, "DevCaps2"),
405     (Float, "MaxNpatchTessellationLevel"),
406     (DWORD, "Reserved5"),
407     (UINT, "MasterAdapterOrdinal"),
408     (UINT, "AdapterOrdinalInGroup"),
409     (UINT, "NumberOfAdaptersInGroup"),
410     (D3DDTCAPS, "DeclTypes"),
411     (DWORD, "NumSimultaneousRTs"),
412     (D3DPTFILTERCAPS, "StretchRectFilterCaps"),
413     (D3DVSHADERCAPS2_0, "VS20Caps"),
414     (D3DPSHADERCAPS2_0, "PS20Caps"),
415     (D3DPTFILTERCAPS, "VertexTextureFilterCaps"),
416     (DWORD, "MaxVShaderInstructionsExecuted"),
417     (DWORD, "MaxPShaderInstructionsExecuted"),
418     (DWORD, "MaxVertexShader30InstructionSlots"),
419     (DWORD, "MaxPixelShader30InstructionSlots"),
420 ])
421