diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-12-18 19:43:12 -0600 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-12-18 19:43:12 -0600 |
| commit | 02f22152bedc292101d15fb89856fa89b861bfde (patch) | |
| tree | 76e963ec8fb61c74c672f95cc6a4a2713211501a /Source/Core/VideoCommon/PixelShaderGen.cpp | |
| parent | c7b809d46b466cabac296d1891f3f5e96cf499a0 (diff) | |
| parent | e7e8a4f1cb3d1c7801c18f4d3ff5cae797d5f5b3 (diff) | |
Merge pull request #1706 from Armada651/line-width
VideoCommon: Merge LineGeometryShader into GeometryShaderGen.
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 48cd5b8fec..77f24d115c 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -317,16 +317,20 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T // is always inside the primitive. // Without MSAA, this flag is defined to have no effect. uid_data->stereo = g_ActiveConfig.iStereoMode > 0; - if (g_ActiveConfig.iStereoMode > 0) + if (g_ActiveConfig.backend_info.bSupportsGeometryShaders) { - out.Write("centroid in VS_OUTPUT vs;\n"); - out.Write("flat in int layer;\n"); + out.Write("in VertexData {\n"); + out.Write("\tcentroid VS_OUTPUT o;\n"); + + if (g_ActiveConfig.iStereoMode > 0) + out.Write("\tflat int layer;\n"); + + out.Write("};\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) @@ -342,25 +346,25 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T out.Write("void main()\n{\n"); - if (g_ActiveConfig.iStereoMode > 0) + if (g_ActiveConfig.backend_info.bSupportsGeometryShaders) { // 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("\tfloat3 uv%d = o.tex%d;\n", i, i); } - out.Write("\tfloat4 clipPos = vs.clipPos;\n"); + out.Write("\tfloat4 clipPos = o.clipPos;\n"); if (g_ActiveConfig.bEnablePixelLighting) { - out.Write("\tfloat4 Normal = vs.Normal;\n"); + out.Write("\tfloat4 Normal = o.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 = %s;\n", g_ActiveConfig.backend_info.bSupportsGeometryShaders ? "o.colors_0" : "colors_02"); + out.Write("\tfloat4 colors_1 = %s;\n", g_ActiveConfig.backend_info.bSupportsGeometryShaders ? "o.colors_1" : "colors_12"); out.Write("\tfloat4 rawpos = gl_FragCoord;\n"); } |
