From 63b37e29d1c5ea6ecb2342ef9ba01b165aac602e Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Wed, 29 Oct 2014 14:57:49 +0100 Subject: [PATCH] ShaderGen: Rename "eye" to "layer". Keeping things generic. --- Source/Core/VideoCommon/GeometryShaderGen.cpp | 10 +++++----- Source/Core/VideoCommon/PixelShaderGen.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Core/VideoCommon/GeometryShaderGen.cpp b/Source/Core/VideoCommon/GeometryShaderGen.cpp index a6307fe722..f016acd6f4 100644 --- a/Source/Core/VideoCommon/GeometryShaderGen.cpp +++ b/Source/Core/VideoCommon/GeometryShaderGen.cpp @@ -67,19 +67,19 @@ static inline void GenerateGeometryShader(T& out, u32 components, API_TYPE ApiTy out.Write("centroid in VS_OUTPUT v[];\n"); out.Write("centroid out VS_OUTPUT o;\n"); - out.Write("flat out int eye;\n"); + out.Write("flat out int layer;\n"); out.Write("void main()\n{\n"); if (!g_ActiveConfig.backend_info.bSupportsGSInstancing) - out.Write("\tfor (eye = 0; eye < %d; ++eye) {\n", g_ActiveConfig.bStereo ? 2 : 1); + out.Write("\tfor (layer = 0; layer < %d; ++layer) {\n", g_ActiveConfig.bStereo ? 2 : 1); out.Write("\tfor (int i = 0; i < gl_in.length(); ++i) {\n"); out.Write("\t\to = v[i];\n"); if (g_ActiveConfig.backend_info.bSupportsGSInstancing) - out.Write("\t\teye = gl_InvocationID;\n"); + out.Write("\t\tlayer = gl_InvocationID;\n"); if (g_ActiveConfig.bStereo) - out.Write("\t\to.pos = float4(dot(" I_STEREOPROJECTION"[eye * 4 + 0], v[i].rawpos), dot(" I_STEREOPROJECTION"[eye * 4 + 1], v[i].rawpos), dot(" I_STEREOPROJECTION"[eye * 4 + 2], v[i].rawpos), dot(" I_STEREOPROJECTION"[eye * 4 + 3], v[i].rawpos)); \n"); + out.Write("\t\to.pos = float4(dot(" I_STEREOPROJECTION"[layer * 4 + 0], v[i].rawpos), dot(" I_STEREOPROJECTION"[layer * 4 + 1], v[i].rawpos), dot(" I_STEREOPROJECTION"[layer * 4 + 2], v[i].rawpos), dot(" I_STEREOPROJECTION"[layer * 4 + 3], v[i].rawpos)); \n"); out.Write("\t\tgl_Position = o.pos;\n"); - out.Write("\t\tgl_Layer = eye;\n"); + out.Write("\t\tgl_Layer = layer;\n"); out.Write("\t\tEmitVertex();\n"); out.Write("\t}\n"); out.Write("\tEndPrimitive();\n"); diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 8e1adaae95..4f0c7ea5e1 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -323,7 +323,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T uid_data->stereo = g_ActiveConfig.bStereo; if (g_ActiveConfig.bStereo) - out.Write("flat in int eye;\n"); + out.Write("flat in int layer;\n"); out.Write("void main()\n{\n"); @@ -926,7 +926,7 @@ static inline void SampleTexture(T& out, const char *texcoords, const char *texs if (ApiType == API_D3D) out.Write("iround(255.0 * Tex%d.Sample(samp%d,%s.xy * " I_TEXDIMS"[%d].xy)).%s;\n", texmap,texmap, texcoords, texmap, texswap); else - out.Write("iround(255.0 * texture(samp%d, float3(%s.xy * " I_TEXDIMS"[%d].xy, %s))).%s;\n", texmap, texcoords, texmap, g_ActiveConfig.bStereo ? "eye" : "0.0", texswap); + out.Write("iround(255.0 * texture(samp%d, float3(%s.xy * " I_TEXDIMS"[%d].xy, %s))).%s;\n", texmap, texcoords, texmap, g_ActiveConfig.bStereo ? "layer" : "0.0", texswap); } static const char *tevAlphaFuncsTable[] =