]> git.cworth.org Git - apitrace/blobdiff - specs/d3d9types.py
s/all_types/getAllTypes/
[apitrace] / specs / d3d9types.py
index d9874984ddd70e9e1faf265888a3d68492f7f1ed..c5f0724d98c39efacf7bda2536f481c680afa6db 100644 (file)
@@ -1,5 +1,6 @@
 ##########################################################################
 #
+# Copyright 2011 Jose Fonseca
 # Copyright 2008-2009 VMware, Inc.
 # All Rights Reserved.
 #
@@ -404,11 +405,11 @@ D3DRENDERSTATEVALUE = Polymorphic(DWORD, "State", [
 ])
 
 D3DRENDERSTATETYPE = Enum("D3DRENDERSTATETYPE", [
-    expr for expr, types in D3DRENDERSTATEVALUE.switch_types
+    expr for expr, types in D3DRENDERSTATEVALUE.switchTypes
 ])
 
 D3DTSS_TCI = Flags(DWORD, [
-    #"D3DTSS_TCI_PASSTHRU", 0
+    #"D3DTSS_TCI_PASSTHRU", 0
     "D3DTSS_TCI_CAMERASPACENORMAL",
     "D3DTSS_TCI_CAMERASPACEPOSITION",
     "D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR",
@@ -444,8 +445,8 @@ D3DTEXTUREOP = Enum("D3DTEXTUREOP", [
     "D3DTOP_LERP",
 ])
 
-D3DTA = Flags(DWORD, [
-    "D3DTA_SELECTMASK",
+# XXX: Actually a mixture of enums and flags
+D3DTA = FakeEnum(DWORD, [
     "D3DTA_DIFFUSE",
     "D3DTA_CURRENT",
     "D3DTA_TEXTURE",
@@ -453,8 +454,8 @@ D3DTA = Flags(DWORD, [
     "D3DTA_SPECULAR",
     "D3DTA_TEMP",
     "D3DTA_CONSTANT",
-    "D3DTA_COMPLEMENT",
-    "D3DTA_ALPHAREPLICATE",
+    #"D3DTA_COMPLEMENT",
+    #"D3DTA_ALPHAREPLICATE",
 ])
 
 D3DTEXTURETRANSFORMFLAGS = Enum("D3DTEXTURETRANSFORMFLAGS", [
@@ -489,7 +490,7 @@ D3DTEXTURESTAGESTATEVALUE = Polymorphic(DWORD, "Type", [
 ])
 
 D3DTEXTURESTAGESTATETYPE = Enum("D3DTEXTURESTAGESTATETYPE", [
-    expr for expr, types in D3DTEXTURESTAGESTATEVALUE.switch_types
+    expr for expr, types in D3DTEXTURESTAGESTATEVALUE.switchTypes
 ])
 
 D3DTEXTUREFILTERTYPE = Enum("D3DTEXTUREFILTERTYPE", [
@@ -519,16 +520,16 @@ D3DSAMPLERSTATEVALUE = Polymorphic(DWORD, "Type", [
 ])
 
 D3DSAMPLERSTATETYPE = Enum("D3DSAMPLERSTATETYPE", [
-    expr for expr, types in D3DSAMPLERSTATEVALUE.switch_types
+    expr for expr, types in D3DSAMPLERSTATEVALUE.switchTypes
 ])
 
 D3DPV = Flags(DWORD, [
     "D3DPV_DONOTCOPYDATA",
 ])
 
+# XXX: Actually a mixture of enums and flags
 D3DFVF = Flags(DWORD, [
     "D3DFVF_RESERVED0",
-    "D3DFVF_POSITION_MASK",
     "D3DFVF_XYZ",
     "D3DFVF_XYZRHW",
     "D3DFVF_XYZB1",
@@ -541,8 +542,6 @@ D3DFVF = Flags(DWORD, [
     "D3DFVF_PSIZE",
     "D3DFVF_DIFFUSE",
     "D3DFVF_SPECULAR",
-    #"D3DFVF_TEXCOUNT_MASK",
-    #"D3DFVF_TEXCOUNT_SHIFT",
     #"D3DFVF_TEX0",
     #"D3DFVF_TEX1",
     #"D3DFVF_TEX2",
@@ -555,25 +554,25 @@ D3DFVF = Flags(DWORD, [
     "D3DFVF_LASTBETA_UBYTE4",
     "D3DFVF_LASTBETA_D3DCOLOR",
     "D3DFVF_RESERVED2",
-    #"D3DFVF_TEXCOORDSIZE3(0)",
+    #"D3DFVF_TEXCOORDSIZE1(0)",
     #"D3DFVF_TEXCOORDSIZE2(0)",
+    #"D3DFVF_TEXCOORDSIZE3(0)",
     #"D3DFVF_TEXCOORDSIZE4(0)",
-    #"D3DFVF_TEXCOORDSIZE1(0)",
-    #"D3DFVF_TEXCOORDSIZE3(1)",
+    #"D3DFVF_TEXCOORDSIZE1(1)",
     #"D3DFVF_TEXCOORDSIZE2(1)",
+    #"D3DFVF_TEXCOORDSIZE3(1)",
     #"D3DFVF_TEXCOORDSIZE4(1)",
-    #"D3DFVF_TEXCOORDSIZE1(1)",
-    #"D3DFVF_TEXCOORDSIZE3(2)",
+    #"D3DFVF_TEXCOORDSIZE1(2)",
     #"D3DFVF_TEXCOORDSIZE2(2)",
+    #"D3DFVF_TEXCOORDSIZE3(2)",
     #"D3DFVF_TEXCOORDSIZE4(2)",
-    #"D3DFVF_TEXCOORDSIZE1(2)",
-    #"D3DFVF_TEXCOORDSIZE3(3)",
+    #"D3DFVF_TEXCOORDSIZE1(3)",
     #"D3DFVF_TEXCOORDSIZE2(3)",
+    #"D3DFVF_TEXCOORDSIZE3(3)",
     #"D3DFVF_TEXCOORDSIZE4(3)",
-    #"D3DFVF_TEXCOORDSIZE1(3)",
 ])
 
-D3DDECLUSAGE = Enum("D3DDECLUSAGE", [
+D3DDECLUSAGE = FakeEnum(BYTE, [
     "D3DDECLUSAGE_POSITION",
     "D3DDECLUSAGE_BLENDWEIGHT",
     "D3DDECLUSAGE_BLENDINDICES",
@@ -590,7 +589,7 @@ D3DDECLUSAGE = Enum("D3DDECLUSAGE", [
     "D3DDECLUSAGE_SAMPLE",
 ])
 
-D3DDECLMETHOD = Enum("D3DDECLMETHOD", [
+D3DDECLMETHOD = FakeEnum(BYTE, [
     "D3DDECLMETHOD_DEFAULT",
     "D3DDECLMETHOD_PARTIALU",
     "D3DDECLMETHOD_PARTIALV",
@@ -600,7 +599,7 @@ D3DDECLMETHOD = Enum("D3DDECLMETHOD", [
     "D3DDECLMETHOD_LOOKUPPRESAMPLED",
 ])
 
-D3DDECLTYPE = Enum("D3DDECLTYPE", [
+D3DDECLTYPE = FakeEnum(BYTE, [
     "D3DDECLTYPE_FLOAT1",
     "D3DDECLTYPE_FLOAT2",
     "D3DDECLTYPE_FLOAT3",
@@ -624,222 +623,17 @@ D3DDECLTYPE = Enum("D3DDECLTYPE", [
 D3DVERTEXELEMENT9 = Struct("D3DVERTEXELEMENT9", [
     (WORD, "Stream"),
     (WORD, "Offset"),
-    (BYTE, "Type"),
-    (BYTE, "Method"),
-    (BYTE, "Usage"),
+    (D3DDECLTYPE, "Type"), # BYTE
+    (D3DDECLMETHOD, "Method"), # BYTE
+    (D3DDECLUSAGE, "Usage"), # BYTE
     (BYTE, "UsageIndex"),
 ])
 
-D3DSHADER_INSTRUCTION_OPCODE_TYPE = Enum("D3DSHADER_INSTRUCTION_OPCODE_TYPE", [
-    "D3DSIO_NOP",
-    "D3DSIO_MOV",
-    "D3DSIO_ADD",
-    "D3DSIO_SUB",
-    "D3DSIO_MAD",
-    "D3DSIO_MUL",
-    "D3DSIO_RCP",
-    "D3DSIO_RSQ",
-    "D3DSIO_DP3",
-    "D3DSIO_DP4",
-    "D3DSIO_MIN",
-    "D3DSIO_MAX",
-    "D3DSIO_SLT",
-    "D3DSIO_SGE",
-    "D3DSIO_EXP",
-    "D3DSIO_LOG",
-    "D3DSIO_LIT",
-    "D3DSIO_DST",
-    "D3DSIO_LRP",
-    "D3DSIO_FRC",
-    "D3DSIO_M4x4",
-    "D3DSIO_M4x3",
-    "D3DSIO_M3x4",
-    "D3DSIO_M3x3",
-    "D3DSIO_M3x2",
-    "D3DSIO_CALL",
-    "D3DSIO_CALLNZ",
-    "D3DSIO_LOOP",
-    "D3DSIO_RET",
-    "D3DSIO_ENDLOOP",
-    "D3DSIO_LABEL",
-    "D3DSIO_DCL",
-    "D3DSIO_POW",
-    "D3DSIO_CRS",
-    "D3DSIO_SGN",
-    "D3DSIO_ABS",
-    "D3DSIO_NRM",
-    "D3DSIO_SINCOS",
-    "D3DSIO_REP",
-    "D3DSIO_ENDREP",
-    "D3DSIO_IF",
-    "D3DSIO_IFC",
-    "D3DSIO_ELSE",
-    "D3DSIO_ENDIF",
-    "D3DSIO_BREAK",
-    "D3DSIO_BREAKC",
-    "D3DSIO_MOVA",
-    "D3DSIO_DEFB",
-    "D3DSIO_DEFI",
-    "D3DSIO_TEXCOORD",
-    "D3DSIO_TEXKILL",
-    "D3DSIO_TEX",
-    "D3DSIO_TEXBEM",
-    "D3DSIO_TEXBEML",
-    "D3DSIO_TEXREG2AR",
-    "D3DSIO_TEXREG2GB",
-    "D3DSIO_TEXM3x2PAD",
-    "D3DSIO_TEXM3x2TEX",
-    "D3DSIO_TEXM3x3PAD",
-    "D3DSIO_TEXM3x3TEX",
-    "D3DSIO_RESERVED0",
-    "D3DSIO_TEXM3x3SPEC",
-    "D3DSIO_TEXM3x3VSPEC",
-    "D3DSIO_EXPP",
-    "D3DSIO_LOGP",
-    "D3DSIO_CND",
-    "D3DSIO_DEF",
-    "D3DSIO_TEXREG2RGB",
-    "D3DSIO_TEXDP3TEX",
-    "D3DSIO_TEXM3x2DEPTH",
-    "D3DSIO_TEXDP3",
-    "D3DSIO_TEXM3x3",
-    "D3DSIO_TEXDEPTH",
-    "D3DSIO_CMP",
-    "D3DSIO_BEM",
-    "D3DSIO_DP2ADD",
-    "D3DSIO_DSX",
-    "D3DSIO_DSY",
-    "D3DSIO_TEXLDD",
-    "D3DSIO_SETP",
-    "D3DSIO_TEXLDL",
-    "D3DSIO_BREAKP",
-    "D3DSIO_PHASE",
-    "D3DSIO_COMMENT",
-    "D3DSIO_END",
-])
-
-D3DSHADER_COMPARISON = Enum("D3DSHADER_COMPARISON", [
-    "D3DSPC_RESERVED0",
-    "D3DSPC_GT",
-    "D3DSPC_EQ",
-    "D3DSPC_GE",
-    "D3DSPC_LT",
-    "D3DSPC_NE",
-    "D3DSPC_LE",
-    "D3DSPC_RESERVED1",
-])
-
-D3DSAMPLER_TEXTURE_TYPE = Enum("D3DSAMPLER_TEXTURE_TYPE", [
-    "D3DSTT_UNKNOWN",
-    "D3DSTT_2D",
-    "D3DSTT_CUBE",
-    "D3DSTT_VOLUME",
-])
-
-D3DSP = Flags(DWORD, [
-    "D3DSP_WRITEMASK_0",
-    "D3DSP_WRITEMASK_1",
-    "D3DSP_WRITEMASK_2",
-    "D3DSP_WRITEMASK_3",
-    "D3DSP_WRITEMASK_ALL",
-])
-
-D3DSHADER_PARAM_DSTMOD_TYPE = Flags(DWORD, [
-    "D3DSPDM_NONE",
-    "D3DSPDM_SATURATE",
-    "D3DSPDM_PARTIALPRECISION",
-    "D3DSPDM_MSAMPCENTROID",
-])
-
-D3DSHADER_PARAM_REGISTER_TYPE = Enum("D3DSHADER_PARAM_REGISTER_TYPE", [
-    "D3DSPR_TEMP",
-    "D3DSPR_INPUT",
-    "D3DSPR_CONST",
-    "D3DSPR_ADDR|D3DSPR_TEXTURE",
-    "D3DSPR_RASTOUT",
-    "D3DSPR_ATTROUT",
-    "D3DSPR_TEXCRDOUT|D3DSPR_OUTPUT",
-    "D3DSPR_CONSTINT",
-    "D3DSPR_COLOROUT",
-    "D3DSPR_DEPTHOUT",
-    "D3DSPR_SAMPLER",
-    "D3DSPR_CONST2",
-    "D3DSPR_CONST3",
-    "D3DSPR_CONST4",
-    "D3DSPR_CONSTBOOL",
-    "D3DSPR_LOOP",
-    "D3DSPR_TEMPFLOAT16",
-    "D3DSPR_MISCTYPE",
-    "D3DSPR_LABEL",
-    "D3DSPR_PREDICATE",
-])
-
-D3DSHADER_MISCTYPE_OFFSETS = Enum("D3DSHADER_MISCTYPE_OFFSETS", [
-    "D3DSMO_POSITION",
-    "D3DSMO_FACE",
-])
-
-D3DVS_RASTOUT_OFFSETS = Enum("D3DVS_RASTOUT_OFFSETS", [
-    "D3DSRO_POSITION",
-    "D3DSRO_FOG",
-    "D3DSRO_POINT_SIZE",
-])
-
-D3DVS_ADDRESSMODE_TYPE = Enum("D3DVS_ADDRESSMODE_TYPE", [
-    "D3DVS_ADDRMODE_ABSOLUTE",
-    "D3DVS_ADDRMODE_RELATIVE",
-])
-
 D3DSHADER_ADDRESSMODE_TYPE = Enum("D3DSHADER_ADDRESSMODE_TYPE", [
     "D3DSHADER_ADDRMODE_ABSOLUTE",
     "D3DSHADER_ADDRMODE_RELATIVE",
 ])
 
-D3DVS = Flags(DWORD, [
-    "D3DVS_X_X",
-    "D3DVS_X_Y",
-    "D3DVS_X_Z",
-    "D3DVS_X_W",
-    "D3DVS_Y_X",
-    "D3DVS_Y_Y",
-    "D3DVS_Y_Z",
-    "D3DVS_Y_W",
-    "D3DVS_Z_X",
-    "D3DVS_Z_Y",
-    "D3DVS_Z_Z",
-    "D3DVS_Z_W",
-    "D3DVS_W_X",
-    "D3DVS_W_Y",
-    "D3DVS_W_Z",
-    "D3DVS_W_W",
-    "D3DVS_NOSWIZZLE",
-])
-
-D3DSP = Flags(DWORD, [
-    "D3DSP_NOSWIZZLE",
-    "D3DSP_REPLICATERED",
-    "D3DSP_REPLICATEGREEN",
-    "D3DSP_REPLICATEBLUE",
-    "D3DSP_REPLICATEALPHA",
-])
-
-D3DSHADER_PARAM_SRCMOD_TYPE = Enum("D3DSHADER_PARAM_SRCMOD_TYPE", [
-    "D3DSPSM_NONE",
-    "D3DSPSM_NEG",
-    "D3DSPSM_BIAS",
-    "D3DSPSM_BIASNEG",
-    "D3DSPSM_SIGN",
-    "D3DSPSM_SIGNNEG",
-    "D3DSPSM_COMP",
-    "D3DSPSM_X2",
-    "D3DSPSM_X2NEG",
-    "D3DSPSM_DZ",
-    "D3DSPSM_DW",
-    "D3DSPSM_ABS",
-    "D3DSPSM_ABSNEG",
-    "D3DSPSM_NOT",
-])
-
 D3DBASISTYPE = Enum("D3DBASISTYPE", [
     "D3DBASIS_BEZIER",
     "D3DBASIS_BSPLINE",