150 lines
6.7 KiB
C
150 lines
6.7 KiB
C
|
|
/*
|
|
* The following macro invocations define the ITF handled shader parameters.
|
|
* Include this file after having defined what's behind ITF_DECLARE_PS_ATTRIB_REG
|
|
*
|
|
* The macro have the form :
|
|
*
|
|
* ITF_DECLARE_PS_ATTRIB_REG(attribType, attribName, attribFirstReg)
|
|
*
|
|
* attribType : The type as declared in the shader (float4, float3x4, etc.)
|
|
* attribName : The name of the attribute in the shaders.
|
|
* attribFirstReg : The first register the attribute is mapped on.
|
|
*
|
|
* ITF_DECLARE_PS_ATTRIB_ARRAY_REG(attribType, attribName, arraySize, attribFirstReg)
|
|
* attribType : The type as declared in the shader
|
|
* attribName : The name of the attribute in the shaders.
|
|
* arraySize : Size of the array (what's in [] in a declaration)
|
|
* attribFirstReg : The first register the attribute is mapped on.
|
|
*
|
|
* ITF_DECLARE_PS_ATTRIB_STRUCT_REG(structType, attribName, structSize, attribFirstReg)
|
|
* structType : The type as declared in the shader (be sure to declare your struct first)
|
|
* attribName : The name of the attribute in the shaders.
|
|
* structSize : Size of the array (what's in [] in a declaration)
|
|
* attribFirstReg : The first register the attribute is mapped on.
|
|
*
|
|
*/
|
|
|
|
BEGIN_CONSTANT_BUFFER(Global_PS, 0, 0)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, viewportDimensions, 209) // TODO -> set it back to first regs
|
|
END_CONSTANT_BUFFER
|
|
|
|
BEGIN_CONSTANT_BUFFER(Common_PS, 1, 1)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, alphaTest, 218)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, debugBorder, 217) //xy:pixel size, z:use border/border size
|
|
END_CONSTANT_BUFFER
|
|
|
|
#if defined( CB_RENDERPCT )
|
|
BEGIN_CONSTANT_BUFFER(RenderPCT_PS, 2, 3)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, frontLightColor, 1)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, backLightColor, 2)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, BrightContrast, 3)
|
|
ITF_DECLARE_PS_ATTRIB_STRUCT_REG(PS_DynFogParam, fog1Param, 2, 17) // 1 -> sizeof(PS_DynFogParam) (in reg count)
|
|
ITF_DECLARE_PS_ATTRIB_STRUCT_REG(PS_DynFogParam, fog2Param, 2, 19)
|
|
ITF_DECLARE_PS_ATTRIB_STRUCT_REG(PS_OmniLightParam, light3DParam1, 3, 21)
|
|
ITF_DECLARE_PS_ATTRIB_STRUCT_REG(PS_OmniLightParam, light3DParam2, 3, 24)
|
|
ITF_DECLARE_PS_ATTRIB_STRUCT_REG(PS_OmniLightParam, light3DParam3, 3, 27)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, staticFog, 16)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, refractionParam, 14)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, reflectionParam, 15)
|
|
END_CONSTANT_BUFFER
|
|
#endif // defined( CB_RENDERPCT )
|
|
|
|
#if defined( CB_MOVIE )
|
|
BEGIN_CONSTANT_BUFFER(Movie_PS, 3, 2)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, movieAlpha, 8)
|
|
END_CONSTANT_BUFFER
|
|
#endif // defined( CB_MOVIE )
|
|
|
|
// AFX Post Process
|
|
#if defined( CB_AFTERFX )
|
|
BEGIN_CONSTANT_BUFFER(AfterFX_PS, 4, 2)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, AFXParam, 0) //x:0, y:0, z:blur factor, w:0
|
|
END_CONSTANT_BUFFER
|
|
#endif // defined( CB_AFTERFX )
|
|
|
|
// Font
|
|
#if defined( CB_FONT )
|
|
BEGIN_CONSTANT_BUFFER(Font_PS, 5, 2)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, FontParam, 0) //x:gradientScale
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, FontColorGradient, 1)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, FontProgressiveColor, 2)
|
|
END_CONSTANT_BUFFER
|
|
#endif // defined( CB_FONT )
|
|
|
|
//MultiTex
|
|
#if defined( CB_MULTITEXTURE )
|
|
BEGIN_CONSTANT_BUFFER(MultiTexture_PS, 6, 2)
|
|
ITF_DECLARE_PS_ATTRIB_ARRAY_REG(float4, multiTexColors, 4, 4) //start register at 4 to avoid collision with "BrightContrast"
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, multiTexTextureUsageColorSaturator, 8) // [0.0 | 1.0] to keep the color or saturating it
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, multiTexTextureUsageAlphaSaturator, 9) // [0.0 | 1.0] to keep the alpha or saturating it
|
|
ITF_DECLARE_PS_ATTRIB_ARRAY_REG(float4, multiTexTextureUsageAlphaSelector, 4, 10) // r:layer1, g:layer2, b:layer3, a:layer4
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, multiTexTextureAlphaThreshold, 14) // r: > 0.0 enables colour gradient
|
|
END_CONSTANT_BUFFER
|
|
#endif // defined( CB_MULTITEXTURE )
|
|
|
|
// Constants for the Autodance feature
|
|
#if defined( CB_AUTODANCE )
|
|
BEGIN_CONSTANT_BUFFER(AutoDance_PS, 7, 2)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, samp0Size, 4)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, samp1Size, 5)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, samp2Size, 6)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, samp3Size, 7)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, samp4Size, 8)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, reg0, 9)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, reg1, 10)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, reg2, 11)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, reg3, 12)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, reg4, 13)
|
|
END_CONSTANT_BUFFER
|
|
#endif // defined( CB_AUTODANCE )
|
|
|
|
// Constants for the Music motion feature
|
|
#if defined( CB_MUSICMOTION )
|
|
BEGIN_CONSTANT_BUFFER(MusicMotion_PS, 8, 2)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, mumo_samp0Size, 4)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, mumo_samp1Size, 5)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, mumo_samp2Size, 6)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, mumo_samp3Size, 7)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, mumo_samp4Size, 8)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, mumo_reg0, 9)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, mumo_reg1, 10)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, mumo_reg2, 11)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, mumo_reg3, 12)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, mumo_reg4, 13)
|
|
END_CONSTANT_BUFFER
|
|
#endif // defined( CB_MUSICMOTION )
|
|
|
|
// PiP shader
|
|
#if defined( CB_PIP )
|
|
BEGIN_CONSTANT_BUFFER(PiP_PS, 9, 2)
|
|
ITF_DECLARE_PS_ATTRIB_STRUCT_REG(PS_PiPParam, pipParam, 9, 4)
|
|
END_CONSTANT_BUFFER
|
|
#endif // defined( CB_PIP )
|
|
|
|
// Mumomat shader
|
|
#if defined( CB_MUMOMAT )
|
|
BEGIN_CONSTANT_BUFFER(mumomat_PS, 10, 2)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, mumomat_reg0, 119)
|
|
ITF_DECLARE_PS_ATTRIB_ARRAY_REG(float4, mumomat_bars, 20, 120)
|
|
END_CONSTANT_BUFFER
|
|
#endif // defined( CB_MUMOMAT )
|
|
|
|
#if defined( CB_RENDERPCT )
|
|
BEGIN_CONSTANT_BUFFER(RenderPCT_Fluid_PS, 11, 4)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, fluidParam, 9)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, fluidColor1, 10)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, fluidColor2, 11)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, fluidColor3, 12)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, fluidColor4, 13)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, fluidColor5, 14)
|
|
END_CONSTANT_BUFFER
|
|
#endif
|
|
|
|
#if defined ( CB_OUTLINEDMASK )
|
|
BEGIN_CONSTANT_BUFFER(outlinedMask, 12, 2)
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, om_maskColor, 0) // alpha included
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, om_outlineColor, 1) // alpha included
|
|
ITF_DECLARE_PS_ATTRIB_REG(float4, om_params, 2) // XY = 1 / (scale * texture_size) * thickness
|
|
END_CONSTANT_BUFFER
|
|
#endif // defined ( CB_OUTLINEDMASK )
|