diff options
| author | degasus <wickmarkus@web.de> | 2014-03-17 10:29:32 +0100 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2014-05-05 17:06:37 +0200 |
| commit | c82991df5ba360986f18cfee32c34405f65df09f (patch) | |
| tree | 57df5cc8c0081714a206b48a876731d76de70164 /Source/Core/VideoCommon/PixelShaderGen.cpp | |
| parent | b0878c54b2a2ee1e0fd45f037562a9a6a61d919c (diff) | |
ShaderGen: inline constant shaders
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index ec58c606f1..3ce0403f6c 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -223,24 +223,23 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T out.Write("layout(std140%s) uniform PSBlock {\n", g_ActiveConfig.backend_info.bSupportsBindingLayout ? ", binding = 1" : ""); else out.Write("cbuffer PSBlock {\n"); - - DeclareUniform(out, ApiType, C_COLORS, "int4", I_COLORS"[4]"); - DeclareUniform(out, ApiType, C_KCOLORS, "int4", I_KCOLORS"[4]"); - DeclareUniform(out, ApiType, C_ALPHA, "int4", I_ALPHA); - DeclareUniform(out, ApiType, C_TEXDIMS, "float4", I_TEXDIMS"[8]"); - DeclareUniform(out, ApiType, C_ZBIAS, "int4", I_ZBIAS"[2]"); - DeclareUniform(out, ApiType, C_INDTEXSCALE, "int4", I_INDTEXSCALE"[2]"); - DeclareUniform(out, ApiType, C_INDTEXMTX, "int4", I_INDTEXMTX"[6]"); - DeclareUniform(out, ApiType, C_FOGCOLOR, "int4", I_FOGCOLOR); - DeclareUniform(out, ApiType, C_FOGI, "int4", I_FOGI); - DeclareUniform(out, ApiType, C_FOGF, "float4", I_FOGF"[2]"); - - // For pixel lighting - TODO: Should only be defined when per pixel lighting is enabled! - DeclareUniform(out, ApiType, C_PLIGHT_COLORS, "int4", I_PLIGHT_COLORS"[8]"); - DeclareUniform(out, ApiType, C_PLIGHTS, "float4", I_PLIGHTS"[32]"); - DeclareUniform(out, ApiType, C_PMATERIALS, "int4", I_PMATERIALS"[4]"); - - out.Write("};\n"); + out.Write( + "\tint4 " I_COLORS"[4];\n" + "\tint4 " I_KCOLORS"[4];\n" + "\tint4 " I_ALPHA";\n" + "\tfloat4 " I_TEXDIMS"[8];\n" + "\tint4 " I_ZBIAS"[2];\n" + "\tint4 " I_INDTEXSCALE"[2];\n" + "\tint4 " I_INDTEXMTX"[6];\n" + "\tint4 " I_FOGCOLOR";\n" + "\tint4 " I_FOGI";\n" + "\tfloat4 " I_FOGF"[2];\n" + + // For pixel lighting - TODO: Should only be defined when per pixel lighting is enabled! + "\tint4 " I_PLIGHT_COLORS"[8];\n" + "\tfloat4 " I_PLIGHTS"[32];\n" + "\tint4 " I_PMATERIALS"[4];\n" + "};\n"); const bool forced_early_z = g_ActiveConfig.backend_info.bSupportsEarlyZ && bpmem.UseEarlyDepthTest() && (g_ActiveConfig.bFastDepthCalc || bpmem.alpha_test.TestResult() == AlphaTest::UNDETERMINED); const bool per_pixel_depth = (bpmem.ztex2.op != ZTEXTURE_DISABLE && bpmem.UseLateDepthTest()) || (!g_ActiveConfig.bFastDepthCalc && bpmem.zmode.testenable && !forced_early_z); |
