From fd637030e4859a676108115cc8bf34947cb8f71f Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Wed, 10 Jun 2015 16:09:23 +0200 Subject: [PATCH] GeometryShaderGen: Consistently use xfmem just as the vertex shader. There are very rare conditions in which xfmem can actually desync from bpmem. --- Source/Core/VideoCommon/GeometryShaderGen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/VideoCommon/GeometryShaderGen.cpp b/Source/Core/VideoCommon/GeometryShaderGen.cpp index 3dc745bf6a..5a590f1793 100644 --- a/Source/Core/VideoCommon/GeometryShaderGen.cpp +++ b/Source/Core/VideoCommon/GeometryShaderGen.cpp @@ -81,7 +81,7 @@ static inline void GenerateGeometryShader(T& out, u32 primitive_type, API_TYPE A "\tint4 " I_TEXOFFSET";\n" "};\n"); - uid_data->numTexGens = bpmem.genMode.numtexgens; + uid_data->numTexGens = xfmem.numTexGen.numTexGens; uid_data->pixel_lighting = g_ActiveConfig.bEnablePixelLighting; out.Write("struct VS_OUTPUT {\n"); @@ -233,7 +233,7 @@ static inline void GenerateGeometryShader(T& out, u32 primitive_type, API_TYPE A out.Write("\tif (" I_TEXOFFSET"[2] != 0) {\n"); out.Write("\tfloat texOffset = 1.0 / float(" I_TEXOFFSET"[2]);\n"); - for (unsigned int i = 0; i < bpmem.genMode.numtexgens; ++i) + for (unsigned int i = 0; i < xfmem.numTexGen.numTexGens; ++i) { out.Write("\tif (((" I_TEXOFFSET"[0] >> %d) & 0x1) != 0)\n", i); out.Write("\t\tr.tex%d.x += texOffset;\n", i); @@ -258,7 +258,7 @@ static inline void GenerateGeometryShader(T& out, u32 primitive_type, API_TYPE A out.Write("\tif (" I_TEXOFFSET"[3] != 0) {\n"); out.Write("\tfloat2 texOffset = float2(1.0 / float(" I_TEXOFFSET"[3]), 1.0 / float(" I_TEXOFFSET"[3]));\n"); - for (unsigned int i = 0; i < bpmem.genMode.numtexgens; ++i) + for (unsigned int i = 0; i < xfmem.numTexGen.numTexGens; ++i) { out.Write("\tif (((" I_TEXOFFSET"[1] >> %d) & 0x1) != 0) {\n", i); out.Write("\t\tll.tex%d.xy += float2(0,1) * texOffset;\n", i);