Merge pull request #2588 from Armada651/geom-centroid

GeometryShaderGen: Don't use `centroid in` for input variables.
This commit is contained in:
Jules Blok 2015-06-11 09:53:02 +02:00
commit dca19a71db
1 changed files with 4 additions and 4 deletions

View File

@ -81,7 +81,7 @@ static inline void GenerateGeometryShader(T& out, u32 primitive_type, API_TYPE A
"\tint4 " I_TEXOFFSET";\n" "\tint4 " I_TEXOFFSET";\n"
"};\n"); "};\n");
uid_data->numTexGens = bpmem.genMode.numtexgens; uid_data->numTexGens = xfmem.numTexGen.numTexGens;
uid_data->pixel_lighting = g_ActiveConfig.bEnablePixelLighting; uid_data->pixel_lighting = g_ActiveConfig.bEnablePixelLighting;
out.Write("struct VS_OUTPUT {\n"); out.Write("struct VS_OUTPUT {\n");
@ -94,7 +94,7 @@ static inline void GenerateGeometryShader(T& out, u32 primitive_type, API_TYPE A
out.Write("#define InstanceID gl_InvocationID\n"); out.Write("#define InstanceID gl_InvocationID\n");
out.Write("in VertexData {\n"); out.Write("in VertexData {\n");
GenerateVSOutputMembers<T>(out, ApiType, g_ActiveConfig.backend_info.bSupportsBindingLayout ? "centroid" : "centroid in"); GenerateVSOutputMembers<T>(out, ApiType);
out.Write("} vs[%d];\n", vertex_in); out.Write("} vs[%d];\n", vertex_in);
out.Write("out VertexData {\n"); out.Write("out VertexData {\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("\tif (" I_TEXOFFSET"[2] != 0) {\n");
out.Write("\tfloat texOffset = 1.0 / float(" I_TEXOFFSET"[2]);\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("\tif (((" I_TEXOFFSET"[0] >> %d) & 0x1) != 0)\n", i);
out.Write("\t\tr.tex%d.x += texOffset;\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("\tif (" I_TEXOFFSET"[3] != 0) {\n");
out.Write("\tfloat2 texOffset = float2(1.0 / float(" I_TEXOFFSET"[3]), 1.0 / float(" I_TEXOFFSET"[3]));\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("\tif (((" I_TEXOFFSET"[1] >> %d) & 0x1) != 0) {\n", i);
out.Write("\t\tll.tex%d.xy += float2(0,1) * texOffset;\n", i); out.Write("\t\tll.tex%d.xy += float2(0,1) * texOffset;\n", i);