D3D11: Fix glitched polygon edges when MSAA is enabled.

This commit is contained in:
NeoBrainX 2013-04-03 18:53:49 +02:00
parent 181ac8c910
commit 61c327ba8b
2 changed files with 13 additions and 13 deletions

View File

@ -668,17 +668,17 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
per_pixel_depth ? "\n out float depth : SV_Depth," : ""); per_pixel_depth ? "\n out float depth : SV_Depth," : "");
} }
WRITE(p, " in float4 colors_0 : COLOR0,\n"); WRITE(p, " in centroid float4 colors_0 : COLOR0,\n");
WRITE(p, " in float4 colors_1 : COLOR1"); WRITE(p, " in centroid float4 colors_1 : COLOR1");
// compute window position if needed because binding semantic WPOS is not widely supported // compute window position if needed because binding semantic WPOS is not widely supported
if (numTexgen < 7) if (numTexgen < 7)
{ {
for (int i = 0; i < numTexgen; ++i) for (int i = 0; i < numTexgen; ++i)
WRITE(p, ",\n in float3 uv%d : TEXCOORD%d", i, i); WRITE(p, ",\n in centroid float3 uv%d : TEXCOORD%d", i, i);
WRITE(p, ",\n in float4 clipPos : TEXCOORD%d", numTexgen); WRITE(p, ",\n in centroid float4 clipPos : TEXCOORD%d", numTexgen);
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting) if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
WRITE(p, ",\n in float4 Normal : TEXCOORD%d", numTexgen + 1); WRITE(p, ",\n in centroid float4 Normal : TEXCOORD%d", numTexgen + 1);
WRITE(p, " ) {\n"); WRITE(p, " ) {\n");
} }
else else

View File

@ -136,27 +136,27 @@ char* GenerateVSOutputStruct(char* p, u32 components, API_TYPE ApiType)
// GLSL makes this ugly // GLSL makes this ugly
// TODO: Make pretty // TODO: Make pretty
WRITE(p, "struct VS_OUTPUT {\n"); WRITE(p, "struct VS_OUTPUT {\n");
WRITE(p, " float4 pos %s POSITION;\n", ApiType == API_OPENGL ? ";//" : ":"); WRITE(p, " centroid float4 pos %s POSITION;\n", ApiType == API_OPENGL ? ";//" : ":");
WRITE(p, " float4 colors_0 %s COLOR0;\n", ApiType == API_OPENGL ? ";//" : ":"); WRITE(p, " centroid float4 colors_0 %s COLOR0;\n", ApiType == API_OPENGL ? ";//" : ":");
WRITE(p, " float4 colors_1 %s COLOR1;\n", ApiType == API_OPENGL ? ";//" : ":"); WRITE(p, " centroid float4 colors_1 %s COLOR1;\n", ApiType == API_OPENGL ? ";//" : ":");
if (xfregs.numTexGen.numTexGens < 7) { if (xfregs.numTexGen.numTexGens < 7) {
for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i) for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
WRITE(p, " float3 tex%d %s TEXCOORD%d;\n", i, ApiType == API_OPENGL ? ";//" : ":", i); WRITE(p, " centroid float3 tex%d %s TEXCOORD%d;\n", i, ApiType == API_OPENGL ? ";//" : ":", i);
WRITE(p, " float4 clipPos %s TEXCOORD%d;\n", ApiType == API_OPENGL ? ";//" : ":", xfregs.numTexGen.numTexGens); WRITE(p, " centroid float4 clipPos %s TEXCOORD%d;\n", ApiType == API_OPENGL ? ";//" : ":", xfregs.numTexGen.numTexGens);
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting) if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
WRITE(p, " float4 Normal %s TEXCOORD%d;\n", ApiType == API_OPENGL ? ";//" : ":", xfregs.numTexGen.numTexGens + 1); WRITE(p, " centroid float4 Normal %s TEXCOORD%d;\n", ApiType == API_OPENGL ? ";//" : ":", xfregs.numTexGen.numTexGens + 1);
} else { } else {
// clip position is in w of first 4 texcoords // clip position is in w of first 4 texcoords
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting) if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
{ {
for (int i = 0; i < 8; ++i) for (int i = 0; i < 8; ++i)
WRITE(p, " float4 tex%d %s TEXCOORD%d;\n", i, ApiType == API_OPENGL? ";//" : ":", i); WRITE(p, " centroid float4 tex%d %s TEXCOORD%d;\n", i, ApiType == API_OPENGL? ";//" : ":", i);
} }
else else
{ {
for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i) for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
WRITE(p, " float%d tex%d %s TEXCOORD%d;\n", i < 4 ? 4 : 3 , i, ApiType == API_OPENGL ? ";//" : ":", i); WRITE(p, " centroid float%d tex%d %s TEXCOORD%d;\n", i < 4 ? 4 : 3 , i, ApiType == API_OPENGL ? ";//" : ":", i);
} }
} }
WRITE(p, "};\n"); WRITE(p, "};\n");