summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PixelShaderGen.cpp
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2014-12-15 21:09:25 +0100
committerJules Blok <jules.blok@gmail.com>2014-12-15 22:47:41 +0100
commit275af9c5e44129db8d039a0a0a7c1a721d6ab05a (patch)
treefdb997176b87e27376ebf1826213f28538acde92 /Source/Core/VideoCommon/PixelShaderGen.cpp
parent382e1c22db91d863b55d6223d4893cb629dab810 (diff)
VideoCommon: Assume we always use a geometry shader, not just for stereoscopy.
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/PixelShaderGen.cpp47
1 files changed, 13 insertions, 34 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index 48cd5b8fec..742f9c0a60 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -316,51 +316,30 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
// As a workaround, we interpolate at the centroid of the coveraged pixel, which
// is always inside the primitive.
// Without MSAA, this flag is defined to have no effect.
+ out.Write("centroid in VS_OUTPUT vs;\n");
+
uid_data->stereo = g_ActiveConfig.iStereoMode > 0;
if (g_ActiveConfig.iStereoMode > 0)
- {
- out.Write("centroid in VS_OUTPUT vs;\n");
out.Write("flat in int layer;\n");
- }
- else
- {
- out.Write("centroid in float4 colors_02;\n");
- out.Write("centroid in float4 colors_12;\n");
-
- // compute window position if needed because binding semantic WPOS is not widely supported
- // Let's set up attributes
- for (unsigned int i = 0; i < numTexgen; ++i)
- {
- out.Write("centroid in float3 uv%d;\n", i);
- }
- out.Write("centroid in float4 clipPos;\n");
- if (g_ActiveConfig.bEnablePixelLighting)
- {
- out.Write("centroid in float4 Normal;\n");
- }
- }
out.Write("void main()\n{\n");
- if (g_ActiveConfig.iStereoMode > 0)
+ // compute window position if needed because binding semantic WPOS is not widely supported
+ // Let's set up attributes
+ for (unsigned int i = 0; i < numTexgen; ++i)
{
- // compute window position if needed because binding semantic WPOS is not widely supported
- // Let's set up attributes
- for (unsigned int i = 0; i < numTexgen; ++i)
- {
- out.Write("\tfloat3 uv%d = vs.tex%d;\n", i, i);
- }
- out.Write("\tfloat4 clipPos = vs.clipPos;\n");
- if (g_ActiveConfig.bEnablePixelLighting)
- {
- out.Write("\tfloat4 Normal = vs.Normal;\n");
- }
+ out.Write("\tfloat3 uv%d = vs.tex%d;\n", i, i);
+ }
+ out.Write("\tfloat4 clipPos = vs.clipPos;\n");
+ if (g_ActiveConfig.bEnablePixelLighting)
+ {
+ out.Write("\tfloat4 Normal = vs.Normal;\n");
}
// On Mali, global variables must be initialized as constants.
// This is why we initialize these variables locally instead.
- out.Write("\tfloat4 colors_0 = %s;\n", (g_ActiveConfig.iStereoMode > 0) ? "vs.colors_0" : "colors_02");
- out.Write("\tfloat4 colors_1 = %s;\n", (g_ActiveConfig.iStereoMode > 0) ? "vs.colors_1" : "colors_12");
+ out.Write("\tfloat4 colors_0 = vs.colors_0;\n");
+ out.Write("\tfloat4 colors_1 = vs.colors_1;\n");
out.Write("\tfloat4 rawpos = gl_FragCoord;\n");
}