]> git.notmuchmail.org Git - apitrace/blob - specs/d3d9caps.py
trim: Avoid doing any analysis past the end of the user-specified range.
[apitrace] / specs / 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     "D3DCAPS3_DXVAHD",
79 ])
80
81 D3DCURSORCAPS = Flags(DWORD, [
82     "D3DCURSORCAPS_COLOR",
83     "D3DCURSORCAPS_LOWRES",
84 ])
85
86 D3DDEVCAPS = Flags(DWORD, [
87     "D3DDEVCAPS_EXECUTESYSTEMMEMORY",
88     "D3DDEVCAPS_EXECUTEVIDEOMEMORY",
89     "D3DDEVCAPS_TLVERTEXSYSTEMMEMORY",
90     "D3DDEVCAPS_TLVERTEXVIDEOMEMORY",
91     "D3DDEVCAPS_TEXTURESYSTEMMEMORY",
92     "D3DDEVCAPS_TEXTUREVIDEOMEMORY",
93     "D3DDEVCAPS_DRAWPRIMTLVERTEX",
94     "D3DDEVCAPS_CANRENDERAFTERFLIP",
95     "D3DDEVCAPS_TEXTURENONLOCALVIDMEM",
96     "D3DDEVCAPS_DRAWPRIMITIVES2",
97     "D3DDEVCAPS_SEPARATETEXTUREMEMORIES",
98     "D3DDEVCAPS_DRAWPRIMITIVES2EX",
99     "D3DDEVCAPS_HWTRANSFORMANDLIGHT",
100     "D3DDEVCAPS_CANBLTSYSTONONLOCAL",
101     "D3DDEVCAPS_HWRASTERIZATION",
102     "D3DDEVCAPS_PUREDEVICE",
103     "D3DDEVCAPS_QUINTICRTPATCHES",
104     "D3DDEVCAPS_RTPATCHES",
105     "D3DDEVCAPS_RTPATCHHANDLEZERO",
106     "D3DDEVCAPS_NPATCHES",
107 ])
108
109 D3DPMISCCAPS = Flags(DWORD, [
110     "D3DPMISCCAPS_MASKZ",
111     "D3DPMISCCAPS_CULLNONE",
112     "D3DPMISCCAPS_CULLCW",
113     "D3DPMISCCAPS_CULLCCW",
114     "D3DPMISCCAPS_COLORWRITEENABLE",
115     "D3DPMISCCAPS_CLIPPLANESCALEDPOINTS",
116     "D3DPMISCCAPS_CLIPTLVERTS",
117     "D3DPMISCCAPS_TSSARGTEMP",
118     "D3DPMISCCAPS_BLENDOP",
119     "D3DPMISCCAPS_NULLREFERENCE",
120     "D3DPMISCCAPS_INDEPENDENTWRITEMASKS",
121     "D3DPMISCCAPS_PERSTAGECONSTANT",
122     "D3DPMISCCAPS_FOGANDSPECULARALPHA",
123     "D3DPMISCCAPS_SEPARATEALPHABLEND",
124     "D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS",
125     "D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING",
126     "D3DPMISCCAPS_FOGVERTEXCLAMPED",
127     "D3DPMISCCAPS_POSTBLENDSRGBCONVERT",
128 ])
129
130 D3DLINECAPS = Flags(DWORD, [
131     "D3DLINECAPS_TEXTURE",
132     "D3DLINECAPS_ZTEST",
133     "D3DLINECAPS_BLEND",
134     "D3DLINECAPS_ALPHACMP",
135     "D3DLINECAPS_FOG",
136     "D3DLINECAPS_ANTIALIAS",
137 ])
138
139 D3DPRASTERCAPS = Flags(DWORD, [
140     "D3DPRASTERCAPS_DITHER",
141     "D3DPRASTERCAPS_ZTEST",
142     "D3DPRASTERCAPS_FOGVERTEX",
143     "D3DPRASTERCAPS_FOGTABLE",
144     "D3DPRASTERCAPS_MIPMAPLODBIAS",
145     "D3DPRASTERCAPS_ZBUFFERLESSHSR",
146     "D3DPRASTERCAPS_FOGRANGE",
147     "D3DPRASTERCAPS_ANISOTROPY",
148     "D3DPRASTERCAPS_WBUFFER",
149     "D3DPRASTERCAPS_WFOG",
150     "D3DPRASTERCAPS_ZFOG",
151     "D3DPRASTERCAPS_COLORPERSPECTIVE",
152     "D3DPRASTERCAPS_SCISSORTEST",
153     "D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS",
154     "D3DPRASTERCAPS_DEPTHBIAS",
155     "D3DPRASTERCAPS_MULTISAMPLE_TOGGLE",
156 ])
157
158 D3DPCMPCAPS = Flags(DWORD, [
159     "D3DPCMPCAPS_NEVER",
160     "D3DPCMPCAPS_LESS",
161     "D3DPCMPCAPS_EQUAL",
162     "D3DPCMPCAPS_LESSEQUAL",
163     "D3DPCMPCAPS_GREATER",
164     "D3DPCMPCAPS_NOTEQUAL",
165     "D3DPCMPCAPS_GREATEREQUAL",
166     "D3DPCMPCAPS_ALWAYS",
167 ])
168
169 D3DPBLENDCAPS = Flags(DWORD, [
170     "D3DPBLENDCAPS_ZERO",
171     "D3DPBLENDCAPS_ONE",
172     "D3DPBLENDCAPS_SRCCOLOR",
173     "D3DPBLENDCAPS_INVSRCCOLOR",
174     "D3DPBLENDCAPS_SRCALPHA",
175     "D3DPBLENDCAPS_INVSRCALPHA",
176     "D3DPBLENDCAPS_DESTALPHA",
177     "D3DPBLENDCAPS_INVDESTALPHA",
178     "D3DPBLENDCAPS_DESTCOLOR",
179     "D3DPBLENDCAPS_INVDESTCOLOR",
180     "D3DPBLENDCAPS_SRCALPHASAT",
181     "D3DPBLENDCAPS_BOTHSRCALPHA",
182     "D3DPBLENDCAPS_BOTHINVSRCALPHA",
183     "D3DPBLENDCAPS_BLENDFACTOR",
184     "D3DPBLENDCAPS_SRCCOLOR2",
185     "D3DPBLENDCAPS_INVSRCCOLOR2",
186 ])
187
188 D3DPSHADECAPS = Flags(DWORD, [
189     "D3DPSHADECAPS_COLORGOURAUDRGB",
190     "D3DPSHADECAPS_SPECULARGOURAUDRGB",
191     "D3DPSHADECAPS_ALPHAGOURAUDBLEND",
192     "D3DPSHADECAPS_FOGGOURAUD",
193 ])
194
195 D3DPTEXTURECAPS = Flags(DWORD, [
196     "D3DPTEXTURECAPS_PERSPECTIVE",
197     "D3DPTEXTURECAPS_POW2",
198     "D3DPTEXTURECAPS_ALPHA",
199     "D3DPTEXTURECAPS_SQUAREONLY",
200     "D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE",
201     "D3DPTEXTURECAPS_ALPHAPALETTE",
202     "D3DPTEXTURECAPS_NONPOW2CONDITIONAL",
203     "D3DPTEXTURECAPS_PROJECTED",
204     "D3DPTEXTURECAPS_CUBEMAP",
205     "D3DPTEXTURECAPS_VOLUMEMAP",
206     "D3DPTEXTURECAPS_MIPMAP",
207     "D3DPTEXTURECAPS_MIPVOLUMEMAP",
208     "D3DPTEXTURECAPS_MIPCUBEMAP",
209     "D3DPTEXTURECAPS_CUBEMAP_POW2",
210     "D3DPTEXTURECAPS_VOLUMEMAP_POW2",
211     "D3DPTEXTURECAPS_NOPROJECTEDBUMPENV",
212 ])
213
214 D3DPTFILTERCAPS = Flags(DWORD, [
215     "D3DPTFILTERCAPS_MINFPOINT",
216     "D3DPTFILTERCAPS_MINFLINEAR",
217     "D3DPTFILTERCAPS_MINFANISOTROPIC",
218     "D3DPTFILTERCAPS_MINFPYRAMIDALQUAD",
219     "D3DPTFILTERCAPS_MINFGAUSSIANQUAD",
220     "D3DPTFILTERCAPS_MIPFPOINT",
221     "D3DPTFILTERCAPS_MIPFLINEAR",
222     "D3DPTFILTERCAPS_CONVOLUTIONMONO",
223     "D3DPTFILTERCAPS_MAGFPOINT",
224     "D3DPTFILTERCAPS_MAGFLINEAR",
225     "D3DPTFILTERCAPS_MAGFANISOTROPIC",
226     "D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD",
227     "D3DPTFILTERCAPS_MAGFGAUSSIANQUAD",
228 ])
229
230 D3DPTADDRESSCAPS = Flags(DWORD, [
231     "D3DPTADDRESSCAPS_WRAP",
232     "D3DPTADDRESSCAPS_MIRROR",
233     "D3DPTADDRESSCAPS_CLAMP",
234     "D3DPTADDRESSCAPS_BORDER",
235     "D3DPTADDRESSCAPS_INDEPENDENTUV",
236     "D3DPTADDRESSCAPS_MIRRORONCE",
237 ])
238
239 D3DSTENCILCAPS = Flags(DWORD, [
240     "D3DSTENCILCAPS_KEEP",
241     "D3DSTENCILCAPS_ZERO",
242     "D3DSTENCILCAPS_REPLACE",
243     "D3DSTENCILCAPS_INCRSAT",
244     "D3DSTENCILCAPS_DECRSAT",
245     "D3DSTENCILCAPS_INVERT",
246     "D3DSTENCILCAPS_INCR",
247     "D3DSTENCILCAPS_DECR",
248     "D3DSTENCILCAPS_TWOSIDED",
249 ])
250
251 D3DTEXOPCAPS = Flags(DWORD, [
252     "D3DTEXOPCAPS_DISABLE",
253     "D3DTEXOPCAPS_SELECTARG1",
254     "D3DTEXOPCAPS_SELECTARG2",
255     "D3DTEXOPCAPS_MODULATE",
256     "D3DTEXOPCAPS_MODULATE2X",
257     "D3DTEXOPCAPS_MODULATE4X",
258     "D3DTEXOPCAPS_ADD",
259     "D3DTEXOPCAPS_ADDSIGNED",
260     "D3DTEXOPCAPS_ADDSIGNED2X",
261     "D3DTEXOPCAPS_SUBTRACT",
262     "D3DTEXOPCAPS_ADDSMOOTH",
263     "D3DTEXOPCAPS_BLENDDIFFUSEALPHA",
264     "D3DTEXOPCAPS_BLENDTEXTUREALPHA",
265     "D3DTEXOPCAPS_BLENDFACTORALPHA",
266     "D3DTEXOPCAPS_BLENDTEXTUREALPHAPM",
267     "D3DTEXOPCAPS_BLENDCURRENTALPHA",
268     "D3DTEXOPCAPS_PREMODULATE",
269     "D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR",
270     "D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA",
271     "D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR",
272     "D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA",
273     "D3DTEXOPCAPS_BUMPENVMAP",
274     "D3DTEXOPCAPS_BUMPENVMAPLUMINANCE",
275     "D3DTEXOPCAPS_DOTPRODUCT3",
276     "D3DTEXOPCAPS_MULTIPLYADD",
277     "D3DTEXOPCAPS_LERP",
278 ])
279
280 D3DFVFCAPS = Flags(DWORD, [
281     "D3DFVFCAPS_TEXCOORDCOUNTMASK",
282     "D3DFVFCAPS_DONOTSTRIPELEMENTS",
283     "D3DFVFCAPS_PSIZE",
284 ])
285
286 D3DVTXPCAPS = Flags(DWORD, [
287     "D3DVTXPCAPS_TEXGEN",
288     "D3DVTXPCAPS_MATERIALSOURCE7",
289     "D3DVTXPCAPS_DIRECTIONALLIGHTS",
290     "D3DVTXPCAPS_POSITIONALLIGHTS",
291     "D3DVTXPCAPS_LOCALVIEWER",
292     "D3DVTXPCAPS_TWEENING",
293     "D3DVTXPCAPS_TEXGEN_SPHEREMAP",
294     "D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER",
295 ])
296
297 D3DDEVCAPS2 = Flags(DWORD, [
298     "D3DDEVCAPS2_STREAMOFFSET",
299     "D3DDEVCAPS2_DMAPNPATCH",
300     "D3DDEVCAPS2_ADAPTIVETESSRTPATCH",
301     "D3DDEVCAPS2_ADAPTIVETESSNPATCH",
302     "D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES",
303     "D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH",
304     "D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET",
305 ])
306
307 D3DDTCAPS = Flags(DWORD, [
308     "D3DDTCAPS_UBYTE4",
309     "D3DDTCAPS_UBYTE4N",
310     "D3DDTCAPS_SHORT2N",
311     "D3DDTCAPS_SHORT4N",
312     "D3DDTCAPS_USHORT2N",
313     "D3DDTCAPS_USHORT4N",
314     "D3DDTCAPS_UDEC3",
315     "D3DDTCAPS_DEC3N",
316     "D3DDTCAPS_FLOAT16_2",
317     "D3DDTCAPS_FLOAT16_4",
318 ])
319
320 #D3DPS_VERSION = Enum("DWORD", [
321 #    "D3DPS_VERSION(0,0)",
322 #    "D3DPS_VERSION(1,0)",
323 #    "D3DPS_VERSION(1,1)",
324 #    "D3DPS_VERSION(1,2)",
325 #    "D3DPS_VERSION(1,3)",
326 #    "D3DPS_VERSION(1,4)",
327 #    "D3DPS_VERSION(2,0)",
328 #    "D3DPS_VERSION(3,0)",
329 #])
330 D3DPS_VERSION = DWORD
331
332 #D3DVS_VERSION = Enum("DWORD", [
333 #    "D3DVS_VERSION(0,0)",
334 #    "D3DVS_VERSION(1,0)",
335 #    "D3DVS_VERSION(1,1)",
336 #    "D3DVS_VERSION(2,0)",
337 #    "D3DVS_VERSION(3,0)",
338 #])
339 D3DVS_VERSION = DWORD
340
341 D3DCAPS9 = Struct("D3DCAPS9", [
342     (D3DDEVTYPE, "DeviceType"),
343     (UINT, "AdapterOrdinal"),
344     (D3DCAPS, "Caps"),
345     (D3DCAPS2, "Caps2"),
346     (D3DCAPS3, "Caps3"),
347     (D3DPRESENT_INTERVAL, "PresentationIntervals"),
348     (D3DCURSORCAPS, "CursorCaps"),
349     (D3DDEVCAPS, "DevCaps"),
350     (D3DPMISCCAPS, "PrimitiveMiscCaps"),
351     (D3DPRASTERCAPS, "RasterCaps"),
352     (D3DPCMPCAPS, "ZCmpCaps"),
353     (D3DPBLENDCAPS, "SrcBlendCaps"),
354     (D3DPBLENDCAPS, "DestBlendCaps"),
355     (D3DPCMPCAPS, "AlphaCmpCaps"),
356     (D3DPSHADECAPS, "ShadeCaps"),
357     (D3DPTEXTURECAPS, "TextureCaps"),
358     (D3DPTFILTERCAPS, "TextureFilterCaps"),
359     (D3DPTFILTERCAPS, "CubeTextureFilterCaps"),
360     (D3DPTFILTERCAPS, "VolumeTextureFilterCaps"),
361     (D3DPTADDRESSCAPS, "TextureAddressCaps"),
362     (D3DPTADDRESSCAPS, "VolumeTextureAddressCaps"),
363     (D3DLINECAPS, "LineCaps"),
364     (DWORD, "MaxTextureWidth"),
365     (DWORD, "MaxTextureHeight"),
366     (DWORD, "MaxVolumeExtent"),
367     (DWORD, "MaxTextureRepeat"),
368     (DWORD, "MaxTextureAspectRatio"),
369     (DWORD, "MaxAnisotropy"),
370     (Float, "MaxVertexW"),
371     (Float, "GuardBandLeft"),
372     (Float, "GuardBandTop"),
373     (Float, "GuardBandRight"),
374     (Float, "GuardBandBottom"),
375     (Float, "ExtentsAdjust"),
376     (D3DSTENCILCAPS, "StencilCaps"),
377     (D3DFVFCAPS, "FVFCaps"),
378     (D3DTEXOPCAPS, "TextureOpCaps"),
379     (DWORD, "MaxTextureBlendStages"),
380     (DWORD, "MaxSimultaneousTextures"),
381     (D3DVTXPCAPS, "VertexProcessingCaps"),
382     (DWORD, "MaxActiveLights"),
383     (DWORD, "MaxUserClipPlanes"),
384     (DWORD, "MaxVertexBlendMatrices"),
385     (DWORD, "MaxVertexBlendMatrixIndex"),
386     (Float, "MaxPointSize"),
387     (DWORD, "MaxPrimitiveCount"),
388     (DWORD, "MaxVertexIndex"),
389     (DWORD, "MaxStreams"),
390     (DWORD, "MaxStreamStride"),
391     (D3DVS_VERSION, "VertexShaderVersion"),
392     (DWORD, "MaxVertexShaderConst"),
393     (D3DPS_VERSION, "PixelShaderVersion"),
394     (Float, "PixelShader1xMaxValue"),
395     (D3DDEVCAPS2, "DevCaps2"),
396     (Float, "MaxNpatchTessellationLevel"),
397     (DWORD, "Reserved5"),
398     (UINT, "MasterAdapterOrdinal"),
399     (UINT, "AdapterOrdinalInGroup"),
400     (UINT, "NumberOfAdaptersInGroup"),
401     (D3DDTCAPS, "DeclTypes"),
402     (DWORD, "NumSimultaneousRTs"),
403     (D3DPTFILTERCAPS, "StretchRectFilterCaps"),
404     (D3DVSHADERCAPS2_0, "VS20Caps"),
405     (D3DPSHADERCAPS2_0, "PS20Caps"),
406     (D3DPTFILTERCAPS, "VertexTextureFilterCaps"),
407     (DWORD, "MaxVShaderInstructionsExecuted"),
408     (DWORD, "MaxPShaderInstructionsExecuted"),
409     (DWORD, "MaxVertexShader30InstructionSlots"),
410     (DWORD, "MaxPixelShader30InstructionSlots"),
411 ])
412