GeometryShaderGen: Consistently use xfmem just as the vertex shader.

There are very rare conditions in which xfmem can actually desync from bpmem.
This commit is contained in:
Jules Blok 2015-06-10 16:09:23 +02:00
parent 4cbaddb7ad
commit fd637030e4
1 changed files with 3 additions and 3 deletions

View File

@ -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);