Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

256 lines
12 KiB

dnl ---------------------------------------------------------------------------
dnl
dnl This file contains bead structure creating macros and produces
dnl the structures themselves.
dnl
dnl Copyright (C) Microsoft Corporation, 1997.
dnl
dnl ---------------------------------------------------------------------------
dnl
include(`m4hdr.mh')dnl
dnl
dnl
define(`d_RenderSpansBeads', `d_RepStr(`$1', `$2', RenderSpansAny)')dnl
dnl
define(`d_BeginBeads', `d_RepStr(`$1', `$2', LoopAny)')dnl
dnl
define(`d_TestBeads', `d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`$1', `$2', Test_AAAA_BBBB_CCCC_DDDD_EEEE)',
AAAA, 16, 32)',
BBBB, NoZWrite, ZWrite)',
CCCC, NoZDeferred, ZDeferred)',
DDDD, ifelse(eval(d_index(EEEE, `Stencil') == 0), `1',
`ZAll, ZAll, ZAll, ZAll',
`ZNeverAlways, ZLessGreaterEqual, ZEqualNotEqual, ZGreaterLessEqual'))',
EEEE, NoStencil, Stencil)')dnl
dnl
define(`d_TestFailBeads', `d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`$1', `$2', TestFail_AAAA_BBBB_CCCC)',
AAAA, Flat, Gouraud)',
BBBB, NoTex, Tex1, PerspTex1, Tex2, PerspTex2)',
CCCC, NoSpecularFog, SpecularFog)')dnl
dnl
define(`d_Tex1AddrBeads', `d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`$1', `$2', TexAddr_AAAA_BBBB_CCCC_DDDD)',
AAAA, TexAddrWrapMirror, TexAddrAll)',
BBBB, NoPersp, Persp)',
CCCC, ifelse(DDDD, NoLOD,
`Point, Bilinear, Bilinear',
`Point, Bilinear, MaybeBilinear'))',
DDDD, NoLOD, LOD)')dnl
dnl
define(`d_Tex1AddrMipBeads', `d_RepStr(`$1', `$2', TexAddr_Filt_All_Mip)')dnl
dnl
define(`d_TexAddrWrapperBeads', `d_RepStr(`$1', `$2', TexAddr_Wrapper)')dnl
dnl
define(`d_Tex2AddrBeads', `d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`$1', `$2', TexAddr_AAAA_BBBB_CCCC_NoLOD)',
AAAA, TexAddrWrapMirror, TexAddrAll)',
BBBB, NoPersp, Persp)',
CCCC, Point, Bilinear, Bilinear)')dnl
define(`d_TexReadBeads', `d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`$1', `$2', TexRead_AAAA_BBBB_CCCC)',
AAAA, B8G8R8, B8G8R8A8, B5G6R5, B5G5R5, Palette4, Palette8,
B5G5R5A1, B4G4R4A4, L8, L8A8, Palette4A, Palette8A)',
BBBB, NoBorder, Border)',
CCCC, NoColorKey, ColorKey)')dnl
dnl
define(`d_TexBlendBeads', `d_RepStr(`d_RepStr(`$1', `$2', TexBlend_AAAA)',
AAAA, Tex1_None, Tex1_Decal, Tex1_Modulate, Tex1_ModulateAlphaOVR, Tex1_Gen, TexM_Gen)')dnl
dnl
define(`d_TexBlendGetColorBeads', `d_RepStr(`d_RepStr(`d_RepStr(`$1', `$2', TexBlend_Get_Color_AAAA_BBBB)',
AAAA, Texture, InvTexture, TextureAlpha, InvTextureAlpha)',
BBBB, Diffuse, Input, Factor, InvDiffuse, InvInput, InvFactor,
DiffuseAlpha, InputAlpha, FactorAlpha, InvDiffuseAlpha, InvInputAlpha, InvFactorAlpha,
Specular, InvSpecular, SpecularAlpha, InvSpecularAlpha)')dnl
dnl
define(`d_TexBlendGetAlphaBeads', `d_RepStr(`d_RepStr(`d_RepStr(`$1', `$2', TexBlend_Get_Alpha_AAAA_BBBB)',
AAAA, TextureAlpha, InvTextureAlpha)',
BBBB, DiffuseAlpha, InputAlpha, FactorAlpha, InvDiffuseAlpha,
InvInputAlpha, InvFactorAlpha, SpecularAlpha, InvSpecularAlpha)')dnl
dnl
define(`d_TexBlendOpColorBeads', `d_RepStr(`d_RepStr(`$1', `$2', TexBlend_Op_Color_AAAA)',
AAAA, None, CopyArg1, CopyArg2, Modulate, Modulate2, Modulate4, Add, AddSigned,
BlendDiffuseAlpha, BlendTextureAlpha, BlendFactorAlpha, BlendTextureAlphaPM,
AddSigned2, Subtract, AddSmooth, ModulateAlphaAddColor, ModulateColorAddAlpha)')dnl
dnl
define(`d_TexBlendOpAlphaBeads', `d_RepStr(`d_RepStr(`$1', `$2', TexBlend_Op_Alpha_AAAA)',
AAAA, None, CopyArg1, CopyArg2, Modulate, Modulate2, Modulate4, Add, AddSigned,
BlendDiffuseAlpha, BlendTextureAlpha, BlendFactorAlpha, BlendTextureAlphaPM,
AddSigned2, Subtract, AddSmooth)')dnl
dnl
define(`d_ColorGenBeads', `d_RepStr(`d_RepStr(`$1', `$2', AAAA)',
AAAA, NULL, ColorGen_Gouraud_NoSpecular_NoFog_NoMonochrome,
ColorGen_Flat_Specular_NoFog_NoMonochrome, ColorGen_Gouraud_Specular_NoFog_NoMonochrome,
ColorGen_Flat_NoSpecular_VertexFog_NoMonochrome, ColorGen_Gouraud_NoSpecular_VertexFog_NoMonochrome,
ColorGen_Flat_Specular_VertexFog_NoMonochrome, ColorGen_Gouraud_Specular_VertexFog_NoMonochrome,
ColorGen_All_Monochrome, ColorGen_All_Monochrome, ColorGen_All_Monochrome, ColorGen_All_Monochrome, ColorGen_All_Monochrome, ColorGen_All_Monochrome, ColorGen_All_Monochrome, ColorGen_All_Monochrome)')dnl
dnl
define(`d_AlphaTestBeads', `d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`$1', `$2', AlphaTest_AAAA_BBBB_CCCC_DDDD_EEEE)',
AAAA, NoAlpha, Alpha)',
BBBB, NoAlphaDither, AlphaDither)',
CCCC, NoZWrite, ZWrite)',
DDDD, 16, 32)',
EEEE, NoStencil, Stencil)')dnl
dnl
define(`d_ColorBlendBeads', `d_RepStr(`d_RepStr(`$1', `$2', AAAA)',
AAAA, NULL, ColorBlend_AllBlend_SrcCopy,
ColorBlend_SrcOne_DestZero_AllROP, ColorBlend_AllBlend_AllROP)')dnl
dnl
define(`d_SrcBlendBeads', `d_RepStr(`d_RepStr(`$1', `$2', SrcBlend_AAAA)',
AAAA, Zero, One, SrcColor, InvSrcColor, SrcAlpha, InvSrcAlpha,
DestAlpha, InvDestAlpha, DestColor, InvDestColor, SrcAlphaSat)')dnl
dnl
define(`d_DestBlendBeads', `d_RepStr(`d_RepStr(`$1', `$2', DestBlend_AAAA)',
AAAA, Zero, One, SrcColor, InvSrcColor, SrcAlpha, InvSrcAlpha,
DestAlpha, InvDestAlpha, DestColor, InvDestColor, SrcAlphaSat)')dnl
dnl
define(`d_BufReadBeads', `d_RepStr(`d_RepStr(`$1', `$2', BufRead_AAAA)',
AAAA, B8G8R8X8, B8G8R8A8, B5G6R5, B5G5R5, B5G5R5A1, B8G8R8, Palette8)')dnl
dnl
define(`d_BufWriteBeads', `d_RepStr(`d_RepStr(`$1', `$2', BufWrite_AAAA)',
AAAA, B8G8R8X8_NoDither, B8G8R8A8_NoDither, B5G6R5_NoDither, B5G5R5_NoDither, B5G5R5A1_NoDither, B8G8R8_NoDither, Palette8_NoDither,
B8G8R8X8_NoDither, B8G8R8A8_NoDither, B5G6R5_Dither, B5G5R5_Dither, B5G5R5A1_Dither, B8G8R8_NoDither, Palette8_NoDither)')dnl
dnl
define(`d_PixelEndBeads', `d_RepStr(`$1', `$2', PixelEndAny)')dnl
dnl
define(`d_SpanEndBeads', `d_RepStr(`$1', `$2', SpanEndAny)')dnl
dnl
dnl
ifelse(`d_BeadMacrosOnly', d_BeadMacrosOnly, `
// indices used to access elements of Test bead table
#define ZFORMAT_NUM 2
#define ZWRITE_NUM 2
#define ZFUNC_NUM 4
#define ZDEFERRED_NUM 2
#define STENCIL_NUM 2
#define ALPHATEST_NUM 2
// indices used to access elements of TestFail bead table
#define SHADEMODE_NUM 2
#define TEXTURE_NUM 5
#define SPECULARFOG_NUM 2
// TexAddr
#define TEXTUREADDRESS_NUM 2
#define TEXTUREPERSPECTIVE_NUM 2
#define TEXTUREFILTER_NUM 3
#define TEXTURELOD_NUM 2
// TexRead
#define TEXTUREFORMAT_NUM 12
#define TEXTUREBORDER_NUM 2
#define COLORKEY_NUM 2
// TexBlend
#define TEXTUREBLEND_NUM 6
#define TEXTUREBLEND_GETALPHA_ARG1_NUM 2
#define TEXTUREBLEND_GETALPHA_ARG2_NUM 8
#define TEXTUREBLEND_OPALPHA_NUM 15
#define TEXTUREBLEND_GETCOLOR_ARG1_NUM 4
#define TEXTUREBLEND_GETCOLOR_ARG2_NUM 16
#define TEXTUREBLEND_OPCOLOR_NUM 17
// ColorGen
#define SPECULAR_NUM 2
#define VERTEXFOG_NUM 2
#define MONO_NUM 2
// SrcBlend
#define SRCBLEND_NUM 11
// DestBlend
#define DESTBLEND_NUM 11
// ColorBlend
#define BLEND_NUM 2
#define BLEND_SRCONEDESTZERO 0
#define BLEND_ALLBLEND 1
#define ROP_NUM 2
#define ROP_SRCCOPY 0
#define ROP_ALLROP 1
// indices used to access elements of Write bead table
#define TARGETPIXELFORMAT_NUM 7
#define DITHERING_NUM 2
dnl
// structures for bead organization
dnl
define(`d_MakeBeadStruct', `
typedef struct tag`'d_UpCase(`$1')`'BEADS
{
$3 pfn`'$1`'$2;
} d_UpCase(`$1')`'BEADS, *P`'d_UpCase(`$1')`'BEADS;')dnl
dnl
d_MakeBeadStruct(RenderSpans, [1],
PFNRENDERSPANS)
d_MakeBeadStruct(Begin, [1],
PFNSPANLAYER)
d_MakeBeadStruct(Test, [STENCIL_NUM][ZFUNC_NUM][ZDEFERRED_NUM][ZWRITE_NUM][ZFORMAT_NUM],
PFNSPANLAYER)
d_MakeBeadStruct(TestFail, [SPECULARFOG_NUM][TEXTURE_NUM][SHADEMODE_NUM],
PFNSPANLAYER)
d_MakeBeadStruct(Tex1Addr, [TEXTURELOD_NUM][TEXTUREFILTER_NUM][TEXTUREPERSPECTIVE_NUM][TEXTUREADDRESS_NUM],
PFNTEXADDRESS)
d_MakeBeadStruct(Tex1AddrMip, [1],
PFNTEXADDRESS)
d_MakeBeadStruct(Tex2Addr, [TEXTUREFILTER_NUM][TEXTUREPERSPECTIVE_NUM][TEXTUREADDRESS_NUM],
PFNTEXADDRESS)
d_MakeBeadStruct(TexAddrWrapper, [1],
PFNSPANLAYER)
d_MakeBeadStruct(TexRead, [COLORKEY_NUM][TEXTUREBORDER_NUM][TEXTUREFORMAT_NUM],
PFNTEXREAD)
d_MakeBeadStruct(TexBlend, [TEXTUREBLEND_NUM],
PFNSPANLAYER)
d_MakeBeadStruct(TexBlendGetColor, [TEXTUREBLEND_GETCOLOR_ARG2_NUM][TEXTUREBLEND_GETCOLOR_ARG1_NUM],
PFNTEXBLENDGET)
d_MakeBeadStruct(TexBlendGetAlpha, [TEXTUREBLEND_GETALPHA_ARG2_NUM][TEXTUREBLEND_GETALPHA_ARG1_NUM],
PFNTEXBLENDGET)
d_MakeBeadStruct(TexBlendOpColor, [TEXTUREBLEND_OPCOLOR_NUM],
PFNTEXBLENDOP)
d_MakeBeadStruct(TexBlendOpAlpha, [TEXTUREBLEND_OPALPHA_NUM],
PFNTEXBLENDOP)
d_MakeBeadStruct(ColorGen, [MONO_NUM][VERTEXFOG_NUM][SPECULAR_NUM][SHADEMODE_NUM],
PFNSPANLAYER)
d_MakeBeadStruct(AlphaTest, [STENCIL_NUM][ZFORMAT_NUM][ZWRITE_NUM][COLORKEY_NUM][ALPHATEST_NUM],
PFNSPANLAYER)
d_MakeBeadStruct(ColorBlend, [ROP_NUM][BLEND_NUM],
PFNSPANLAYER)
d_MakeBeadStruct(SrcBlend, [SRCBLEND_NUM],
PFNBLENDFUNC)
d_MakeBeadStruct(DestBlend, [DESTBLEND_NUM],
PFNBLENDFUNC)
d_MakeBeadStruct(BufRead, [TARGETPIXELFORMAT_NUM],
PFNBUFREAD)
d_MakeBeadStruct(BufWrite, [DITHERING_NUM][TARGETPIXELFORMAT_NUM],
PFNSPANLAYER)
d_MakeBeadStruct(PixelEnd, [1],
PFNSPANLAYER)
d_MakeBeadStruct(SpanEnd, [1],
PFNSPANLAYER)
// Root structure needed for state validation. Contains pointers to function pointer
// tables
typedef struct tagBEADTABLE
{
PRENDERSPANSBEADS pRenderSpansBeads;
PBEGINBEADS pBeginBeads;
PTESTBEADS pTestBeads;
PTESTFAILBEADS pTestFailBeads;
PTEX1ADDRBEADS pTex1AddrBeads;
PTEX1ADDRMIPBEADS pTex1AddrMipBeads;
PTEXADDRWRAPPERBEADS pTexAddrWrapperBeads;
PTEXREADBEADS pTexReadBeads;
PTEX2ADDRBEADS pTex2AddrBeads;
PTEXBLENDBEADS pTexBlendBeads;
PTEXBLENDGETCOLORBEADS pTexBlendGetColorBeads;
PTEXBLENDGETALPHABEADS pTexBlendGetAlphaBeads;
PTEXBLENDOPCOLORBEADS pTexBlendOpColorBeads;
PTEXBLENDOPALPHABEADS pTexBlendOpAlphaBeads;
PCOLORGENBEADS pColorGenBeads;
PALPHATESTBEADS pAlphaTestBeads;
PCOLORBLENDBEADS pColorBlendBeads;
PSRCBLENDBEADS pSrcBlendBeads;
PDESTBLENDBEADS pDestBlendBeads;
PBUFREADBEADS pBufReadBeads;
PBUFWRITEBEADS pBufWriteBeads;
PPIXELENDBEADS pPixelEndBeads;
PSPANENDBEADS pSpanEndBeads;
} BEADTABLE, *PBEADTABLE;
')