summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/GeometryShaderGen.cpp
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2014-10-27 00:29:37 +0100
committerJules Blok <jules.blok@gmail.com>2014-11-23 14:23:41 +0100
commitd9e280e338b9b05d3651a5fe53d933999310aa7c (patch)
tree7b3b653fbfde2624484809dbabf73851f8e94d10 /Source/Core/VideoCommon/GeometryShaderGen.cpp
parentf6ea293027e553cf89f780ec2a1b716cc026a4b5 (diff)
PixelShaderGen: Sample the correct texture layer.
Diffstat (limited to 'Source/Core/VideoCommon/GeometryShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/GeometryShaderGen.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/GeometryShaderGen.cpp b/Source/Core/VideoCommon/GeometryShaderGen.cpp
index 9f1b5b69b4..c8467b9f4c 100644
--- a/Source/Core/VideoCommon/GeometryShaderGen.cpp
+++ b/Source/Core/VideoCommon/GeometryShaderGen.cpp
@@ -77,12 +77,15 @@ 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("void main()\n{\n");
out.Write("\tfor (int i = 0; i < gl_in.length(); ++i) {\n");
out.Write("\t\to = v[i];\n");
- out.Write("\t\to.pos = float4(dot(" I_STEREOPROJECTION"[gl_InvocationID * 4 + 0], v[i].rawpos), dot(" I_STEREOPROJECTION"[gl_InvocationID * 4 + 1], v[i].rawpos), dot(" I_STEREOPROJECTION"[gl_InvocationID * 4 + 2], v[i].rawpos), dot(" I_STEREOPROJECTION"[gl_InvocationID * 4 + 3], v[i].rawpos)); \n");
+ out.Write("\t\teye = gl_InvocationID;\n");
+ 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\tgl_Position = o.pos;\n");
- out.Write("\t\tgl_Layer = gl_InvocationID;\n");
+ out.Write("\t\tgl_Layer = eye;\n");
out.Write("\t\tEmitVertex();\n");
out.Write("\t}\n");
out.Write("\tEndPrimitive();\n");