From bd14582465b298e0d90b1bd4d79a6b43bf28bb9d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 4 Jan 2018 12:42:51 +0100 Subject: [PATCH] Update D3D8 codepath --- gfx/drivers_renderchain/d3d8_renderchain.c | 2 - gfx/include/d3d8/d3d8caps.h | 125 ++-- gfx/include/d3d8/d3d8types.h | 652 ++++++++++----------- 3 files changed, 363 insertions(+), 416 deletions(-) diff --git a/gfx/drivers_renderchain/d3d8_renderchain.c b/gfx/drivers_renderchain/d3d8_renderchain.c index 843fb85814..157948cac7 100644 --- a/gfx/drivers_renderchain/d3d8_renderchain.c +++ b/gfx/drivers_renderchain/d3d8_renderchain.c @@ -21,8 +21,6 @@ #include "../drivers/d3d.h" #include "../common/d3d_common.h" -#include "../include/d3d8/d3dx8math.h" - #include "../video_driver.h" #include "../../configuration.h" diff --git a/gfx/include/d3d8/d3d8caps.h b/gfx/include/d3d8/d3d8caps.h index e41b00a70f..fe31c2d33b 100644 --- a/gfx/include/d3d8/d3d8caps.h +++ b/gfx/include/d3d8/d3d8caps.h @@ -12,9 +12,9 @@ #ifndef DIRECT3D_VERSION #define DIRECT3D_VERSION 0x0800 -#endif //DIRECT3D_VERSION +#endif /* DIRECT3D_VERSION */ -// include this file content only if compiling for DX8 interfaces +/* include this file content only if compiling for DX8 interfaces */ #if(DIRECT3D_VERSION >= 0x0800) #if defined(_X86_) || defined(_IA64_) @@ -47,13 +47,13 @@ typedef struct _D3DCAPS8 DWORD AlphaCmpCaps; DWORD ShadeCaps; DWORD TextureCaps; - DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture8's - DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture8's - DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture8's - DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture8's - DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture8's + DWORD TextureFilterCaps; /* D3DPTFILTERCAPS for IDirect3DTexture8's */ + DWORD CubeTextureFilterCaps; /* D3DPTFILTERCAPS for IDirect3DCubeTexture8's */ + DWORD VolumeTextureFilterCaps; /* D3DPTFILTERCAPS for IDirect3DVolumeTexture8's */ + DWORD TextureAddressCaps; /* D3DPTADDRESSCAPS for IDirect3DTexture8's */ + DWORD VolumeTextureAddressCaps; /* D3DPTADDRESSCAPS for IDirect3DVolumeTexture8's */ - DWORD LineCaps; // D3DLINECAPS + DWORD LineCaps; /* D3DLINECAPS */ DWORD MaxTextureWidth, MaxTextureHeight; DWORD MaxVolumeExtent; @@ -84,31 +84,25 @@ typedef struct _D3DCAPS8 float MaxPointSize; - DWORD MaxPrimitiveCount; // max number of primitives per DrawPrimitive call + DWORD MaxPrimitiveCount; /* max number of primitives per DrawPrimitive call */ DWORD MaxVertexIndex; DWORD MaxStreams; - DWORD MaxStreamStride; // max stride for SetStreamSource + DWORD MaxStreamStride; /* max stride for SetStreamSource */ DWORD VertexShaderVersion; - DWORD MaxVertexShaderConst; // number of vertex shader constant registers + DWORD MaxVertexShaderConst; /* number of vertex shader constant registers */ DWORD PixelShaderVersion; - float MaxPixelShaderValue; // max value of pixel shader arithmetic component + float MaxPixelShaderValue; /* max value of pixel shader arithmetic component */ } D3DCAPS8; -// -// BIT DEFINES FOR D3DCAPS8 DWORD MEMBERS -// +/* BIT DEFINES FOR D3DCAPS8 DWORD MEMBERS */ -// -// Caps -// +/* Caps */ #define D3DCAPS_READ_SCANLINE 0x00020000L -// -// Caps2 -// +/* Caps2 */ #define D3DCAPS2_NO2DDURING3DSCENE 0x00000002L #define D3DCAPS2_FULLSCREENGAMMA 0x00020000L #define D3DCAPS2_CANRENDERWINDOWED 0x00080000L @@ -117,19 +111,16 @@ typedef struct _D3DCAPS8 #define D3DCAPS2_CANMANAGERESOURCE 0x10000000L #define D3DCAPS2_DYNAMICTEXTURES 0x20000000L -// -// Caps3 -// +/* Caps3 */ #define D3DCAPS3_RESERVED 0x8000001fL -// Indicates that the device can respect the ALPHABLENDENABLE render state -// when fullscreen while using the FLIP or DISCARD swap effect. -// COPY and COPYVSYNC swap effects work whether or not this flag is set. +/* Indicates that the device can respect the ALPHABLENDENABLE render state + * when fullscreen while using the FLIP or DISCARD swap effect. + * COPY and COPYVSYNC swap effects work whether or not this flag is set. + */ #define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020L -// -// PresentationIntervals -// +/* PresentationIntervals */ #define D3DPRESENT_INTERVAL_DEFAULT 0x00000000L #define D3DPRESENT_INTERVAL_ONE 0x00000001L #define D3DPRESENT_INTERVAL_TWO 0x00000002L @@ -137,17 +128,14 @@ typedef struct _D3DCAPS8 #define D3DPRESENT_INTERVAL_FOUR 0x00000008L #define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000L -// -// CursorCaps -// -// Driver supports HW color cursor in at least hi-res modes(height >=400) +/* CursorCaps */ + +/* Driver supports HW color cursor in at least hi-res modes(height >=400) */ #define D3DCURSORCAPS_COLOR 0x00000001L -// Driver supports HW cursor also in low-res modes(height < 400) +/* Driver supports HW cursor also in low-res modes(height < 400) */ #define D3DCURSORCAPS_LOWRES 0x00000002L -// -// DevCaps -// +/* DevCaps */ #define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */ #define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */ #define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */ @@ -169,9 +157,7 @@ typedef struct _D3DCAPS8 #define D3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000L /* Indicates that RT Patches may be drawn efficiently using handle 0 */ #define D3DDEVCAPS_NPATCHES 0x01000000L /* Device supports N-Patches */ -// -// PrimitiveMiscCaps -// +/* PrimitiveMiscCaps */ #define D3DPMISCCAPS_MASKZ 0x00000002L #define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L #define D3DPMISCCAPS_CULLNONE 0x00000010L @@ -184,18 +170,14 @@ typedef struct _D3DCAPS8 #define D3DPMISCCAPS_BLENDOP 0x00000800L /* device supports D3DRS_BLENDOP */ #define D3DPMISCCAPS_NULLREFERENCE 0x00001000L /* Reference Device that doesnt render */ -// -// LineCaps -// +/* LineCaps */ #define D3DLINECAPS_TEXTURE 0x00000001L #define D3DLINECAPS_ZTEST 0x00000002L #define D3DLINECAPS_BLEND 0x00000004L #define D3DLINECAPS_ALPHACMP 0x00000008L #define D3DLINECAPS_FOG 0x00000010L -// -// RasterCaps -// +/* RasterCaps */ #define D3DPRASTERCAPS_DITHER 0x00000001L #define D3DPRASTERCAPS_PAT 0x00000008L #define D3DPRASTERCAPS_ZTEST 0x00000010L @@ -213,9 +195,7 @@ typedef struct _D3DCAPS8 #define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L /* Device iterates colors perspective correct */ #define D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE 0x00800000L -// -// ZCmpCaps, AlphaCmpCaps -// +/* ZCmpCaps, AlphaCmpCaps */ #define D3DPCMPCAPS_NEVER 0x00000001L #define D3DPCMPCAPS_LESS 0x00000002L #define D3DPCMPCAPS_EQUAL 0x00000004L @@ -225,9 +205,7 @@ typedef struct _D3DCAPS8 #define D3DPCMPCAPS_GREATEREQUAL 0x00000040L #define D3DPCMPCAPS_ALWAYS 0x00000080L -// -// SourceBlendCaps, DestBlendCaps -// +/* SourceBlendCaps, DestBlendCaps */ #define D3DPBLENDCAPS_ZERO 0x00000001L #define D3DPBLENDCAPS_ONE 0x00000002L #define D3DPBLENDCAPS_SRCCOLOR 0x00000004L @@ -242,27 +220,24 @@ typedef struct _D3DCAPS8 #define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L #define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L -// -// ShadeCaps -// +/* ShadeCaps */ #define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L #define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L #define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L #define D3DPSHADECAPS_FOGGOURAUD 0x00080000L -// -// TextureCaps -// +/* TextureCaps */ #define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L /* Perspective-correct texturing is supported */ #define D3DPTEXTURECAPS_POW2 0x00000002L /* Power-of-2 texture dimensions are required - applies to non-Cube/Volume textures only. */ #define D3DPTEXTURECAPS_ALPHA 0x00000004L /* Alpha in texture pixels is supported */ #define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L /* Only square textures are supported */ #define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L /* Texture indices are not scaled by the texture size prior to interpolation */ #define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L /* Device can draw alpha from texture palettes */ -// Device can use non-POW2 textures if: -// 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage -// 2) D3DRS_WRAP(N) is zero for this texture's coordinates -// 3) mip mapping is not enabled (use magnification filter only) +/* Device can use non-POW2 textures if: + * 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage + * 2) D3DRS_WRAP(N) is zero for this texture's coordinates + * 3) mip mapping is not enabled (use magnification filter only) + */ #define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L #define D3DPTEXTURECAPS_PROJECTED 0x00000400L /* Device can do D3DTTFF_PROJECTED */ #define D3DPTEXTURECAPS_CUBEMAP 0x00000800L /* Device can do cubemap textures */ @@ -273,9 +248,7 @@ typedef struct _D3DCAPS8 #define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000L /* Device requires that cubemaps be power-of-2 dimension */ #define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000L /* Device requires that volume maps be power-of-2 dimension */ -// -// TextureFilterCaps -// +/* TextureFilterCaps */ #define D3DPTFILTERCAPS_MINFPOINT 0x00000100L /* Min Filter */ #define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L #define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L @@ -287,9 +260,7 @@ typedef struct _D3DCAPS8 #define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L #define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L -// -// TextureAddressCaps -// +/* TextureAddressCaps */ #define D3DPTADDRESSCAPS_WRAP 0x00000001L #define D3DPTADDRESSCAPS_MIRROR 0x00000002L #define D3DPTADDRESSCAPS_CLAMP 0x00000004L @@ -297,9 +268,7 @@ typedef struct _D3DCAPS8 #define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L #define D3DPTADDRESSCAPS_MIRRORONCE 0x00000020L -// -// StencilCaps -// +/* StencilCaps */ #define D3DSTENCILCAPS_KEEP 0x00000001L #define D3DSTENCILCAPS_ZERO 0x00000002L #define D3DSTENCILCAPS_REPLACE 0x00000004L @@ -309,9 +278,7 @@ typedef struct _D3DCAPS8 #define D3DSTENCILCAPS_INCR 0x00000040L #define D3DSTENCILCAPS_DECR 0x00000080L -// -// TextureOpCaps -// +/* TextureOpCaps */ #define D3DTEXOPCAPS_DISABLE 0x00000001L #define D3DTEXOPCAPS_SELECTARG1 0x00000002L #define D3DTEXOPCAPS_SELECTARG2 0x00000004L @@ -339,16 +306,12 @@ typedef struct _D3DCAPS8 #define D3DTEXOPCAPS_MULTIPLYADD 0x01000000L #define D3DTEXOPCAPS_LERP 0x02000000L -// -// FVFCaps -// +/* FVFCaps */ #define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */ #define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */ #define D3DFVFCAPS_PSIZE 0x00100000L /* Device can receive point size */ -// -// VertexProcessingCaps -// +/* VertexProcessingCaps */ #define D3DVTXPCAPS_TEXGEN 0x00000001L /* device can do texgen */ #define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L /* device can do DX7-level colormaterialsource ops */ #define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L /* device can do directional lights */ diff --git a/gfx/include/d3d8/d3d8types.h b/gfx/include/d3d8/d3d8types.h index 0e713a2f51..0fc0b33279 100644 --- a/gfx/include/d3d8/d3d8types.h +++ b/gfx/include/d3d8/d3d8types.h @@ -12,9 +12,9 @@ #ifndef DIRECT3D_VERSION #define DIRECT3D_VERSION 0x0800 -#endif //DIRECT3D_VERSION +#endif /* DIRECT3D_VERSION */ -// include this file content only if compiling for DX8 interfaces +/* include this file content only if compiling for DX8 interfaces */ #if(DIRECT3D_VERSION >= 0x0800) #include @@ -22,24 +22,24 @@ #if _MSC_VER >= 1200 #pragma warning(push) #endif -#pragma warning(disable:4201) // anonymous unions warning +#pragma warning(disable:4201) /* anonymous unions warning */ #if defined(_X86_) || defined(_IA64_) #pragma pack(4) #endif -// D3DCOLOR is equivalent to D3DFMT_A8R8G8B8 +/* D3DCOLOR is equivalent to D3DFMT_A8R8G8B8 */ #ifndef D3DCOLOR_DEFINED typedef DWORD D3DCOLOR; #define D3DCOLOR_DEFINED #endif -// maps unsigned 8 bits/channel to D3DCOLOR +/* maps unsigned 8 bits/channel to D3DCOLOR */ #define D3DCOLOR_ARGB(a,r,g,b) \ ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff))) #define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b) #define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b) -// maps floating point channels (0.f to 1.f range) to D3DCOLOR +/* maps floating point channels (0.f to 1.f range) to D3DCOLOR */ #define D3DCOLOR_COLORVALUE(r,g,b,a) \ D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f)) @@ -102,11 +102,10 @@ typedef struct _D3DVIEWPORT8 { * Values for clip fields. */ -// Max number of user clipping planes, supported in D3D. +/* Max number of user clipping planes, supported in D3D. */ #define D3DMAXUSERCLIPPLANES 32 -// These bits could be ORed together to use with D3DRS_CLIPPLANEENABLE -// +/* These bits could be ORed together to use with D3DRS_CLIPPLANEENABLE */ #define D3DCLIPPLANE0 (1 << 0) #define D3DCLIPPLANE1 (1 << 1) #define D3DCLIPPLANE2 (1 << 2) @@ -114,9 +113,9 @@ typedef struct _D3DVIEWPORT8 { #define D3DCLIPPLANE4 (1 << 4) #define D3DCLIPPLANE5 (1 << 5) -// The following bits are used in the ClipUnion and ClipIntersection -// members of the D3DCLIPSTATUS8 -// +/* The following bits are used in the ClipUnion and ClipIntersection + * members of the D3DCLIPSTATUS8 + */ #define D3DCS_LEFT 0x00000001L #define D3DCS_RIGHT 0x00000002L @@ -161,7 +160,7 @@ typedef enum _D3DLIGHTTYPE { D3DLIGHT_POINT = 1, D3DLIGHT_SPOT = 2, D3DLIGHT_DIRECTIONAL = 3, - D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DLIGHT_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DLIGHTTYPE; typedef struct _D3DLIGHT8 { @@ -195,14 +194,14 @@ typedef enum _D3DSHADEMODE { D3DSHADE_FLAT = 1, D3DSHADE_GOURAUD = 2, D3DSHADE_PHONG = 3, - D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DSHADE_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DSHADEMODE; typedef enum _D3DFILLMODE { D3DFILL_POINT = 1, D3DFILL_WIREFRAME = 2, D3DFILL_SOLID = 3, - D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DFILL_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DFILLMODE; typedef struct _D3DLINEPATTERN { @@ -224,7 +223,7 @@ typedef enum _D3DBLEND { D3DBLEND_SRCALPHASAT = 11, D3DBLEND_BOTHSRCALPHA = 12, D3DBLEND_BOTHINVSRCALPHA = 13, - D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DBLEND_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DBLEND; typedef enum _D3DBLENDOP { @@ -233,7 +232,7 @@ typedef enum _D3DBLENDOP { D3DBLENDOP_REVSUBTRACT = 3, D3DBLENDOP_MIN = 4, D3DBLENDOP_MAX = 5, - D3DBLENDOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DBLENDOP_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DBLENDOP; typedef enum _D3DTEXTUREADDRESS { @@ -242,14 +241,14 @@ typedef enum _D3DTEXTUREADDRESS { D3DTADDRESS_CLAMP = 3, D3DTADDRESS_BORDER = 4, D3DTADDRESS_MIRRORONCE = 5, - D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DTADDRESS_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DTEXTUREADDRESS; typedef enum _D3DCULL { D3DCULL_NONE = 1, D3DCULL_CW = 2, D3DCULL_CCW = 3, - D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DCULL_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DCULL; typedef enum _D3DCMPFUNC { @@ -261,7 +260,7 @@ typedef enum _D3DCMPFUNC { D3DCMP_NOTEQUAL = 6, D3DCMP_GREATEREQUAL = 7, D3DCMP_ALWAYS = 8, - D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DCMP_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DCMPFUNC; typedef enum _D3DSTENCILOP { @@ -273,7 +272,7 @@ typedef enum _D3DSTENCILOP { D3DSTENCILOP_INVERT = 6, D3DSTENCILOP_INCR = 7, D3DSTENCILOP_DECR = 8, - D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DSTENCILOP_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DSTENCILOP; typedef enum _D3DFOGMODE { @@ -281,17 +280,17 @@ typedef enum _D3DFOGMODE { D3DFOG_EXP = 1, D3DFOG_EXP2 = 2, D3DFOG_LINEAR = 3, - D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DFOG_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DFOGMODE; typedef enum _D3DZBUFFERTYPE { D3DZB_FALSE = 0, - D3DZB_TRUE = 1, // Z buffering - D3DZB_USEW = 2, // W buffering - D3DZB_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DZB_TRUE = 1, /* Z buffering */ + D3DZB_USEW = 2, /* W buffering */ + D3DZB_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DZBUFFERTYPE; -// Primitives supported by draw-primitive API +/* Primitives supported by draw-primitive API */ typedef enum _D3DPRIMITIVETYPE { D3DPT_POINTLIST = 1, D3DPT_LINELIST = 2, @@ -299,7 +298,7 @@ typedef enum _D3DPRIMITIVETYPE { D3DPT_TRIANGLELIST = 4, D3DPT_TRIANGLESTRIP = 5, D3DPT_TRIANGLEFAN = 6, - D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DPT_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DPRIMITIVETYPE; typedef enum _D3DTRANSFORMSTATETYPE { @@ -313,7 +312,7 @@ typedef enum _D3DTRANSFORMSTATETYPE { D3DTS_TEXTURE5 = 21, D3DTS_TEXTURE6 = 22, D3DTS_TEXTURE7 = 23, - D3DTS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DTS_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DTRANSFORMSTATETYPE; #define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256) @@ -387,32 +386,32 @@ typedef enum _D3DRENDERSTATETYPE { D3DRS_POINTSCALE_A = 158, /* float point attenuation A value */ D3DRS_POINTSCALE_B = 159, /* float point attenuation B value */ D3DRS_POINTSCALE_C = 160, /* float point attenuation C value */ - D3DRS_MULTISAMPLEANTIALIAS = 161, // BOOL - set to do FSAA with multisample buffer - D3DRS_MULTISAMPLEMASK = 162, // DWORD - per-sample enable/disable - D3DRS_PATCHEDGESTYLE = 163, // Sets whether patch edges will use float style tessellation - D3DRS_PATCHSEGMENTS = 164, // Number of segments per edge when drawing patches - D3DRS_DEBUGMONITORTOKEN = 165, // DEBUG ONLY - token to debug monitor + D3DRS_MULTISAMPLEANTIALIAS = 161, /* BOOL - set to do FSAA with multisample buffer */ + D3DRS_MULTISAMPLEMASK = 162, /* DWORD - per-sample enable/disable */ + D3DRS_PATCHEDGESTYLE = 163, /* Sets whether patch edges will use float style tessellation */ + D3DRS_PATCHSEGMENTS = 164, /* Number of segments per edge when drawing patches */ + D3DRS_DEBUGMONITORTOKEN = 165, /* DEBUG ONLY - token to debug monitor */ D3DRS_POINTSIZE_MAX = 166, /* float point size max threshold */ D3DRS_INDEXEDVERTEXBLENDENABLE = 167, - D3DRS_COLORWRITEENABLE = 168, // per-channel write enable - D3DRS_TWEENFACTOR = 170, // float tween factor - D3DRS_BLENDOP = 171, // D3DBLENDOP setting - D3DRS_POSITIONORDER = 172, // NPatch position interpolation order. D3DORDER_LINEAR or D3DORDER_CUBIC (default) - D3DRS_NORMALORDER = 173, // NPatch normal interpolation order. D3DORDER_LINEAR (default) or D3DORDER_QUADRATIC + D3DRS_COLORWRITEENABLE = 168, /* per-channel write enable */ + D3DRS_TWEENFACTOR = 170, /* float tween factor */ + D3DRS_BLENDOP = 171, /* D3DBLENDOP setting */ + D3DRS_POSITIONORDER = 172, /* NPatch position interpolation order. D3DORDER_LINEAR or D3DORDER_CUBIC (default) */ + D3DRS_NORMALORDER = 173, /* NPatch normal interpolation order. D3DORDER_LINEAR (default) or D3DORDER_QUADRATIC */ - D3DRS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ + D3DRS_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DRENDERSTATETYPE; -// Values for material source +/* Values for material source */ typedef enum _D3DMATERIALCOLORSOURCE { - D3DMCS_MATERIAL = 0, // Color from material is used - D3DMCS_COLOR1 = 1, // Diffuse vertex color is used - D3DMCS_COLOR2 = 2, // Specular vertex color is used - D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum + D3DMCS_MATERIAL = 0, /* Color from material is used */ + D3DMCS_COLOR1 = 1, /* Diffuse vertex color is used */ + D3DMCS_COLOR2 = 2, /* Specular vertex color is used */ + D3DMCS_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DMATERIALCOLORSOURCE; -// Bias to apply to the texture coordinate set to apply a wrap to. +/* Bias to apply to the texture coordinate set to apply a wrap to. */ #define D3DRENDERSTATE_WRAPBIAS 128UL /* Flags to construct the WRAP render states */ @@ -421,9 +420,9 @@ typedef enum _D3DMATERIALCOLORSOURCE #define D3DWRAP_W 0x00000004L /* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */ -#define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U -#define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V -#define D3DWRAPCOORD_2 0x00000004L // same as D3DWRAP_W +#define D3DWRAPCOORD_0 0x00000001L /* same as D3DWRAP_U */ +#define D3DWRAPCOORD_1 0x00000002L /* same as D3DWRAP_V */ +#define D3DWRAPCOORD_2 0x00000004L /* same as D3DWRAP_W */ #define D3DWRAPCOORD_3 0x00000008L /* Flags to construct D3DRS_COLORWRITEENABLE */ @@ -467,10 +466,10 @@ typedef enum _D3DTEXTURESTAGESTATETYPE D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ } D3DTEXTURESTAGESTATETYPE; -// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position -// and normal in the camera space) should be taken as texture coordinates -// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from -// +/* Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position + * and normal in the camera space) should be taken as texture coordinates + * Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from + */ #define D3DTSS_TCI_PASSTHRU 0x00000000 #define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000 #define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000 @@ -482,99 +481,97 @@ typedef enum _D3DTEXTURESTAGESTATETYPE */ typedef enum _D3DTEXTUREOP { - // Control - D3DTOP_DISABLE = 1, // disables stage - D3DTOP_SELECTARG1 = 2, // the default + /* Control */ + D3DTOP_DISABLE = 1, /* disables stage */ + D3DTOP_SELECTARG1 = 2, /* the default */ D3DTOP_SELECTARG2 = 3, - // Modulate - D3DTOP_MODULATE = 4, // multiply args together - D3DTOP_MODULATE2X = 5, // multiply and 1 bit - D3DTOP_MODULATE4X = 6, // multiply and 2 bits + /* Modulate */ + D3DTOP_MODULATE = 4, /* multiply args together */ + D3DTOP_MODULATE2X = 5, /* multiply and 1 bit */ + D3DTOP_MODULATE4X = 6, /* multiply and 2 bits */ - // Add - D3DTOP_ADD = 7, // add arguments together - D3DTOP_ADDSIGNED = 8, // add with -0.5 bias - D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit - D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation - D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product - // Arg1 + Arg2 - Arg1*Arg2 - // = Arg1 + (1-Arg1)*Arg2 + /* Add */ + D3DTOP_ADD = 7, /* add arguments together */ + D3DTOP_ADDSIGNED = 8, /* add with -0.5 bias */ + D3DTOP_ADDSIGNED2X = 9, /* as above but left 1 bit */ + D3DTOP_SUBTRACT = 10, /* Arg1 - Arg2, with no saturation */ + D3DTOP_ADDSMOOTH = 11, /* add 2 args, subtract product */ + /* Arg1 + Arg2 - Arg1*Arg2 */ + /* = Arg1 + (1-Arg1)*Arg2 */ - // Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha) - D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha - D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha - D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRS_TEXTUREFACTOR + /* Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha) */ + D3DTOP_BLENDDIFFUSEALPHA = 12, /* iterated alpha */ + D3DTOP_BLENDTEXTUREALPHA = 13, /* texture alpha */ + D3DTOP_BLENDFACTORALPHA = 14, /* alpha from D3DRS_TEXTUREFACTOR */ - // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha) - D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha - D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color + /* Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha) */ + D3DTOP_BLENDTEXTUREALPHAPM = 15, /* texture alpha */ + D3DTOP_BLENDCURRENTALPHA = 16, /* by alpha of current color */ - // Specular mapping - D3DTOP_PREMODULATE = 17, // modulate with next texture before use - D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB - // COLOROP only - D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A - // COLOROP only - D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB - // COLOROP only - D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A - // COLOROP only + /* Specular mapping */ + D3DTOP_PREMODULATE = 17, /* modulate with next texture before use */ + D3DTOP_MODULATEALPHA_ADDCOLOR = 18, /* Arg1.RGB + Arg1.A*Arg2.RGB */ + /* COLOROP only */ + D3DTOP_MODULATECOLOR_ADDALPHA = 19, /* Arg1.RGB*Arg2.RGB + Arg1.A */ + /* COLOROP only */ + D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, /* (1-Arg1.A)*Arg2.RGB + Arg1.RGB */ + /* COLOROP only */ + D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, /* (1-Arg1.RGB)*Arg2.RGB + Arg1.A */ + /* COLOROP only */ - // Bump mapping - D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation - D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel + /* Bump mapping */ + D3DTOP_BUMPENVMAP = 22, /* per pixel env map perturbation */ + D3DTOP_BUMPENVMAPLUMINANCE = 23, /* with luminance channel */ - // This can do either diffuse or specular bump mapping with correct input. - // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B) - // where each component has been scaled and offset to make it signed. - // The result is replicated into all four (including alpha) channels. - // This is a valid COLOROP only. + /* This can do either diffuse or specular bump mapping with correct input. + * Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B) + * where each component has been scaled and offset to make it signed. + * The result is replicated into all four (including alpha) channels. + * This is a valid COLOROP only. + */ D3DTOP_DOTPRODUCT3 = 24, - // Triadic ops - D3DTOP_MULTIPLYADD = 25, // Arg0 + Arg1*Arg2 - D3DTOP_LERP = 26, // (Arg0)*Arg1 + (1-Arg0)*Arg2 + /* Triadic ops */ + D3DTOP_MULTIPLYADD = 25, /* Arg0 + Arg1*Arg2 */ + D3DTOP_LERP = 26, /* (Arg0)*Arg1 + (1-Arg0)*Arg2 */ - D3DTOP_FORCE_DWORD = 0x7fffffff, + D3DTOP_FORCE_DWORD = 0x7fffffff } D3DTEXTUREOP; /* * Values for COLORARG0,1,2, ALPHAARG0,1,2, and RESULTARG texture blending * operations set in texture processing stage controls in D3DRENDERSTATE. */ -#define D3DTA_SELECTMASK 0x0000000f // mask for arg selector -#define D3DTA_DIFFUSE 0x00000000 // select diffuse color (read only) -#define D3DTA_CURRENT 0x00000001 // select stage destination register (read/write) -#define D3DTA_TEXTURE 0x00000002 // select texture color (read only) -#define D3DTA_TFACTOR 0x00000003 // select D3DRS_TEXTUREFACTOR (read only) -#define D3DTA_SPECULAR 0x00000004 // select specular color (read only) -#define D3DTA_TEMP 0x00000005 // select temporary register color (read/write) -#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x (read modifier) -#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components (read modifier) +#define D3DTA_SELECTMASK 0x0000000f /* mask for arg selector */ +#define D3DTA_DIFFUSE 0x00000000 /* select diffuse color (read only) */ +#define D3DTA_CURRENT 0x00000001 /* select stage destination register (read/write) */ +#define D3DTA_TEXTURE 0x00000002 /* select texture color (read only) */ +#define D3DTA_TFACTOR 0x00000003 /* select D3DRS_TEXTUREFACTOR (read only) */ +#define D3DTA_SPECULAR 0x00000004 /* select specular color (read only) */ +#define D3DTA_TEMP 0x00000005 /* select temporary register color (read/write) */ +#define D3DTA_COMPLEMENT 0x00000010 /* take 1.0 - x (read modifier) */ +#define D3DTA_ALPHAREPLICATE 0x00000020 /* replicate alpha to color components (read modifier) */ -// -// Values for D3DTSS_***FILTER texture stage states -// +/* Values for D3DTSS_***FILTER texture stage states */ typedef enum _D3DTEXTUREFILTERTYPE { - D3DTEXF_NONE = 0, // filtering disabled (valid for mip filter only) - D3DTEXF_POINT = 1, // nearest - D3DTEXF_LINEAR = 2, // linear interpolation - D3DTEXF_ANISOTROPIC = 3, // anisotropic - D3DTEXF_FLATCUBIC = 4, // cubic - D3DTEXF_GAUSSIANCUBIC = 5, // different cubic kernel - D3DTEXF_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum + D3DTEXF_NONE = 0, /* filtering disabled (valid for mip filter only) */ + D3DTEXF_POINT = 1, /* nearest */ + D3DTEXF_LINEAR = 2, /* linear interpolation */ + D3DTEXF_ANISOTROPIC = 3, /* anisotropic */ + D3DTEXF_FLATCUBIC = 4, /* cubic */ + D3DTEXF_GAUSSIANCUBIC = 5, /* different cubic kernel */ + D3DTEXF_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DTEXTUREFILTERTYPE; /* Bits for Flags in ProcessVertices call */ #define D3DPV_DONOTCOPYDATA (1 << 0) -//------------------------------------------------------------------- +/*------------------------------------------------------------------- */ -// Flexible vertex format bits -// +/* Flexible vertex format bits */ #define D3DFVF_RESERVED0 0x001 #define D3DFVF_POSITION_MASK 0x00E #define D3DFVF_XYZ 0x002 @@ -604,11 +601,11 @@ typedef enum _D3DTEXTUREFILTERTYPE #define D3DFVF_LASTBETA_UBYTE4 0x1000 -#define D3DFVF_RESERVED2 0xE000 // 4 reserved bits +#define D3DFVF_RESERVED2 0xE000 /* 4 reserved bits */ -//--------------------------------------------------------------------- -// Vertex Shaders -// +/*--------------------------------------------------------------------- + * Vertex Shaders + */ /* @@ -721,14 +718,14 @@ Placing of tokens other than NOPs between the Stream Selector and Stream Data De typedef enum _D3DVSD_TOKENTYPE { - D3DVSD_TOKEN_NOP = 0, // NOP or extension - D3DVSD_TOKEN_STREAM, // stream selector - D3DVSD_TOKEN_STREAMDATA, // stream data definition (map to vertex input memory) - D3DVSD_TOKEN_TESSELLATOR, // vertex input memory from tessellator - D3DVSD_TOKEN_CONSTMEM, // constant memory from shader - D3DVSD_TOKEN_EXT, // extension - D3DVSD_TOKEN_END = 7, // end-of-array (requires all DWORD bits to be 1) - D3DVSD_FORCE_DWORD = 0x7fffffff,// force 32-bit size enum + D3DVSD_TOKEN_NOP = 0, /* NOP or extension */ + D3DVSD_TOKEN_STREAM, /* stream selector */ + D3DVSD_TOKEN_STREAMDATA, /* stream data definition (map to vertex input memory) */ + D3DVSD_TOKEN_TESSELLATOR, /* vertex input memory from tessellator */ + D3DVSD_TOKEN_CONSTMEM, /* constant memory from shader */ + D3DVSD_TOKEN_EXT, /* extension */ + D3DVSD_TOKEN_END = 7, /* end-of-array (requires all DWORD bits to be 1) */ + D3DVSD_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DVSD_TOKENTYPE; #define D3DVSD_TOKENTYPESHIFT 29 @@ -769,85 +766,85 @@ typedef enum _D3DVSD_TOKENTYPE #define D3DVSD_MAKETOKENTYPE(tokenType) ((tokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK) -// macros for generation of CreateVertexShader Declaration token array +/* macros for generation of CreateVertexShader Declaration token array */ -// Set current stream -// _StreamNumber [0..(MaxStreams-1)] stream to get data from -// +/* Set current stream + * _StreamNumber [0..(MaxStreams-1)] stream to get data from + */ #define D3DVSD_STREAM( _StreamNumber ) \ (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (_StreamNumber)) -// Set tessellator stream -// +/* Set tessellator stream + */ #define D3DVSD_STREAMTESSSHIFT 28 #define D3DVSD_STREAMTESSMASK (1 << D3DVSD_STREAMTESSSHIFT) #define D3DVSD_STREAM_TESS( ) \ (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK)) -// bind single vertex register to vertex element from vertex stream -// -// _VertexRegister [0..15] address of the vertex register -// _Type [D3DVSDT_*] dimensionality and arithmetic data type +/* bind single vertex register to vertex element from vertex stream + * + * _VertexRegister [0..15] address of the vertex register + * _Type [D3DVSDT_*] dimensionality and arithmetic data type + */ #define D3DVSD_REG( _VertexRegister, _Type ) \ (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | \ ((_Type) << D3DVSD_DATATYPESHIFT) | (_VertexRegister)) -// Skip _DWORDCount DWORDs in vertex -// +/* Skip _DWORDCount DWORDs in vertex + */ #define D3DVSD_SKIP( _DWORDCount ) \ (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | \ ((_DWORDCount) << D3DVSD_SKIPCOUNTSHIFT)) -// load data into vertex shader constant memory -// -// _ConstantAddress [0..95] - address of constant array to begin filling data -// _Count [0..15] - number of constant vectors to load (4 DWORDs each) -// followed by 4*_Count DWORDS of data -// +/* load data into vertex shader constant memory + * + * _ConstantAddress [0..95] - address of constant array to begin filling data + * _Count [0..15] - number of constant vectors to load (4 DWORDs each) + * followed by 4*_Count DWORDS of data + */ #define D3DVSD_CONST( _ConstantAddress, _Count ) \ (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | \ ((_Count) << D3DVSD_CONSTCOUNTSHIFT) | (_ConstantAddress)) -// enable tessellator generated normals -// -// _VertexRegisterIn [0..15] address of vertex register whose input stream -// will be used in normal computation -// _VertexRegisterOut [0..15] address of vertex register to output the normal to -// +/* enable tessellator generated normals + * + * _VertexRegisterIn [0..15] address of vertex register whose input stream + * will be used in normal computation + * _VertexRegisterOut [0..15] address of vertex register to output the normal to + */ #define D3DVSD_TESSNORMAL( _VertexRegisterIn, _VertexRegisterOut ) \ (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | \ ((_VertexRegisterIn) << D3DVSD_VERTEXREGINSHIFT) | \ ((0x02) << D3DVSD_DATATYPESHIFT) | (_VertexRegisterOut)) -// enable tessellator generated surface parameters -// -// _VertexRegister [0..15] address of vertex register to output parameters -// +/* enable tessellator generated surface parameters + * + * _VertexRegister [0..15] address of vertex register to output parameters + */ #define D3DVSD_TESSUV( _VertexRegister ) \ (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | \ ((0x01) << D3DVSD_DATATYPESHIFT) | (_VertexRegister)) -// Generates END token -// +/* Generates END token + */ #define D3DVSD_END() 0xFFFFFFFF -// Generates NOP token +/* Generates NOP token */ #define D3DVSD_NOP() 0x00000000 -// bit declarations for _Type fields -#define D3DVSDT_FLOAT1 0x00 // 1D float expanded to (value, 0., 0., 1.) -#define D3DVSDT_FLOAT2 0x01 // 2D float expanded to (value, value, 0., 1.) -#define D3DVSDT_FLOAT3 0x02 // 3D float expanded to (value, value, value, 1.) -#define D3DVSDT_FLOAT4 0x03 // 4D float -#define D3DVSDT_D3DCOLOR 0x04 // 4D packed unsigned bytes mapped to 0. to 1. range - // Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A) -#define D3DVSDT_UBYTE4 0x05 // 4D unsigned byte -#define D3DVSDT_SHORT2 0x06 // 2D signed short expanded to (value, value, 0., 1.) -#define D3DVSDT_SHORT4 0x07 // 4D signed short +/* bit declarations for _Type fields */ +#define D3DVSDT_FLOAT1 0x00 /* 1D float expanded to (value, 0., 0., 1.) */ +#define D3DVSDT_FLOAT2 0x01 /* 2D float expanded to (value, value, 0., 1.) */ +#define D3DVSDT_FLOAT3 0x02 /* 3D float expanded to (value, value, value, 1.) */ +#define D3DVSDT_FLOAT4 0x03 /* 4D float */ +#define D3DVSDT_D3DCOLOR 0x04 /* 4D packed unsigned bytes mapped to 0. to 1. range + * Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A) */ +#define D3DVSDT_UBYTE4 0x05 /* 4D unsigned byte */ +#define D3DVSDT_SHORT2 0x06 /* 2D signed short expanded to (value, value, 0., 1.) */ +#define D3DVSDT_SHORT4 0x07 /* 4D signed short */ -// assignments of vertex input registers for fixed function vertex shader -// +/* assignments of vertex input registers for fixed function vertex shader */ #define D3DVSDE_POSITION 0 #define D3DVSDE_BLENDWEIGHT 1 #define D3DVSDE_BLENDINDICES 2 @@ -866,139 +863,132 @@ typedef enum _D3DVSD_TOKENTYPE #define D3DVSDE_POSITION2 15 #define D3DVSDE_NORMAL2 16 -// Maximum supported number of texture coordinate sets +/* Maximum supported number of texture coordinate sets */ #define D3DDP_MAXTEXCOORD 8 -// -// Instruction Token Bit Definitions -// +/* Instruction Token Bit Definitions */ #define D3DSI_OPCODE_MASK 0x0000FFFF typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE { - D3DSIO_NOP = 0, // PS/VS - D3DSIO_MOV , // PS/VS - D3DSIO_ADD , // PS/VS - D3DSIO_SUB , // PS - D3DSIO_MAD , // PS/VS - D3DSIO_MUL , // PS/VS - D3DSIO_RCP , // VS - D3DSIO_RSQ , // VS - D3DSIO_DP3 , // PS/VS - D3DSIO_DP4 , // PS/VS - D3DSIO_MIN , // VS - D3DSIO_MAX , // VS - D3DSIO_SLT , // VS - D3DSIO_SGE , // VS - D3DSIO_EXP , // VS - D3DSIO_LOG , // VS - D3DSIO_LIT , // VS - D3DSIO_DST , // VS - D3DSIO_LRP , // PS - D3DSIO_FRC , // VS - D3DSIO_M4x4 , // VS - D3DSIO_M4x3 , // VS - D3DSIO_M3x4 , // VS - D3DSIO_M3x3 , // VS - D3DSIO_M3x2 , // VS + D3DSIO_NOP = 0, /* PS/VS */ + D3DSIO_MOV , /* PS/VS */ + D3DSIO_ADD , /* PS/VS */ + D3DSIO_SUB , /* PS */ + D3DSIO_MAD , /* PS/VS */ + D3DSIO_MUL , /* PS/VS */ + D3DSIO_RCP , /* VS */ + D3DSIO_RSQ , /* VS */ + D3DSIO_DP3 , /* PS/VS */ + D3DSIO_DP4 , /* PS/VS */ + D3DSIO_MIN , /* VS */ + D3DSIO_MAX , /* VS */ + D3DSIO_SLT , /* VS */ + D3DSIO_SGE , /* VS */ + D3DSIO_EXP , /* VS */ + D3DSIO_LOG , /* VS */ + D3DSIO_LIT , /* VS */ + D3DSIO_DST , /* VS */ + D3DSIO_LRP , /* PS */ + D3DSIO_FRC , /* VS */ + D3DSIO_M4x4 , /* VS */ + D3DSIO_M4x3 , /* VS */ + D3DSIO_M3x4 , /* VS */ + D3DSIO_M3x3 , /* VS */ + D3DSIO_M3x2 , /* VS */ - D3DSIO_TEXCOORD = 64, // PS - D3DSIO_TEXKILL , // PS - D3DSIO_TEX , // PS - D3DSIO_TEXBEM , // PS - D3DSIO_TEXBEML , // PS - D3DSIO_TEXREG2AR , // PS - D3DSIO_TEXREG2GB , // PS - D3DSIO_TEXM3x2PAD , // PS - D3DSIO_TEXM3x2TEX , // PS - D3DSIO_TEXM3x3PAD , // PS - D3DSIO_TEXM3x3TEX , // PS - D3DSIO_TEXM3x3DIFF , // PS - D3DSIO_TEXM3x3SPEC , // PS - D3DSIO_TEXM3x3VSPEC , // PS - D3DSIO_EXPP , // VS - D3DSIO_LOGP , // VS - D3DSIO_CND , // PS - D3DSIO_DEF , // PS - D3DSIO_TEXREG2RGB , // PS - D3DSIO_TEXDP3TEX , // PS - D3DSIO_TEXM3x2DEPTH , // PS - D3DSIO_TEXDP3 , // PS - D3DSIO_TEXM3x3 , // PS - D3DSIO_TEXDEPTH , // PS - D3DSIO_CMP , // PS - D3DSIO_BEM , // PS + D3DSIO_TEXCOORD = 64, /* PS */ + D3DSIO_TEXKILL , /* PS */ + D3DSIO_TEX , /* PS */ + D3DSIO_TEXBEM , /* PS */ + D3DSIO_TEXBEML , /* PS */ + D3DSIO_TEXREG2AR , /* PS */ + D3DSIO_TEXREG2GB , /* PS */ + D3DSIO_TEXM3x2PAD , /* PS */ + D3DSIO_TEXM3x2TEX , /* PS */ + D3DSIO_TEXM3x3PAD , /* PS */ + D3DSIO_TEXM3x3TEX , /* PS */ + D3DSIO_TEXM3x3DIFF , /* PS */ + D3DSIO_TEXM3x3SPEC , /* PS */ + D3DSIO_TEXM3x3VSPEC , /* PS */ + D3DSIO_EXPP , /* VS */ + D3DSIO_LOGP , /* VS */ + D3DSIO_CND , /* PS */ + D3DSIO_DEF , /* PS */ + D3DSIO_TEXREG2RGB , /* PS */ + D3DSIO_TEXDP3TEX , /* PS */ + D3DSIO_TEXM3x2DEPTH , /* PS */ + D3DSIO_TEXDP3 , /* PS */ + D3DSIO_TEXM3x3 , /* PS */ + D3DSIO_TEXDEPTH , /* PS */ + D3DSIO_CMP , /* PS */ + D3DSIO_BEM , /* PS */ D3DSIO_PHASE = 0xFFFD, D3DSIO_COMMENT = 0xFFFE, D3DSIO_END = 0xFFFF, - D3DSIO_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum + D3DSIO_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */ } D3DSHADER_INSTRUCTION_OPCODE_TYPE; -// -// Co-Issue Instruction Modifier - if set then this instruction is to be -// issued in parallel with the previous instruction(s) for which this bit -// is not set. -// +/* Co-Issue Instruction Modifier - if set then this instruction is to be + * issued in parallel with the previous instruction(s) for which this bit + * is not set. */ #define D3DSI_COISSUE 0x40000000 -// -// Parameter Token Bit Definitions -// +/* Parameter Token Bit Definitions */ #define D3DSP_REGNUM_MASK 0x00001FFF -// destination parameter write mask -#define D3DSP_WRITEMASK_0 0x00010000 // Component 0 (X;Red) -#define D3DSP_WRITEMASK_1 0x00020000 // Component 1 (Y;Green) -#define D3DSP_WRITEMASK_2 0x00040000 // Component 2 (Z;Blue) -#define D3DSP_WRITEMASK_3 0x00080000 // Component 3 (W;Alpha) -#define D3DSP_WRITEMASK_ALL 0x000F0000 // All Components +/* destination parameter write mask */ +#define D3DSP_WRITEMASK_0 0x00010000 /* Component 0 (X;Red) */ +#define D3DSP_WRITEMASK_1 0x00020000 /* Component 1 (Y;Green) */ +#define D3DSP_WRITEMASK_2 0x00040000 /* Component 2 (Z;Blue) */ +#define D3DSP_WRITEMASK_3 0x00080000 /* Component 3 (W;Alpha) */ +#define D3DSP_WRITEMASK_ALL 0x000F0000 /* All Components */ -// destination parameter modifiers +/* destination parameter modifiers */ #define D3DSP_DSTMOD_SHIFT 20 #define D3DSP_DSTMOD_MASK 0x00F00000 typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE { - D3DSPDM_NONE = 0<>8)&0xFF) #define D3DSHADER_VERSION_MINOR(_Version) (((_Version)>>0)&0xFF) -// destination/source parameter register type +/* destination/source parameter register type */ #define D3DSI_COMMENTSIZE_SHIFT 16 #define D3DSI_COMMENTSIZE_MASK 0x7FFF0000 #define D3DSHADER_COMMENT(_DWordSize) \ ((((_DWordSize)<