From 61c327ba8b2e09e67acbcd7d1c807910fc0c1a68 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Wed, 3 Apr 2013 18:53:49 +0200 Subject: [PATCH] D3D11: Fix glitched polygon edges when MSAA is enabled. --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 10 +++++----- Source/Core/VideoCommon/Src/VertexShaderGen.cpp | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 26391be4dd..31a80076d4 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -668,17 +668,17 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType per_pixel_depth ? "\n out float depth : SV_Depth," : ""); } - WRITE(p, " in float4 colors_0 : COLOR0,\n"); - WRITE(p, " in float4 colors_1 : COLOR1"); + WRITE(p, " in centroid float4 colors_0 : COLOR0,\n"); + WRITE(p, " in centroid float4 colors_1 : COLOR1"); // compute window position if needed because binding semantic WPOS is not widely supported if (numTexgen < 7) { for (int i = 0; i < numTexgen; ++i) - WRITE(p, ",\n in float3 uv%d : TEXCOORD%d", i, i); - WRITE(p, ",\n in float4 clipPos : TEXCOORD%d", numTexgen); + WRITE(p, ",\n in centroid float3 uv%d : TEXCOORD%d", i, i); + WRITE(p, ",\n in centroid float4 clipPos : TEXCOORD%d", numTexgen); 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"); } else diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp index 2c0f5676ed..a8149932bf 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp @@ -136,27 +136,27 @@ char* GenerateVSOutputStruct(char* p, u32 components, API_TYPE ApiType) // GLSL makes this ugly // TODO: Make pretty WRITE(p, "struct VS_OUTPUT {\n"); - WRITE(p, " float4 pos %s POSITION;\n", ApiType == API_OPENGL ? ";//" : ":"); - WRITE(p, " float4 colors_0 %s COLOR0;\n", ApiType == API_OPENGL ? ";//" : ":"); - WRITE(p, " float4 colors_1 %s COLOR1;\n", ApiType == API_OPENGL ? ";//" : ":"); + WRITE(p, " centroid float4 pos %s POSITION;\n", ApiType == API_OPENGL ? ";//" : ":"); + WRITE(p, " centroid float4 colors_0 %s COLOR0;\n", ApiType == API_OPENGL ? ";//" : ":"); + WRITE(p, " centroid float4 colors_1 %s COLOR1;\n", ApiType == API_OPENGL ? ";//" : ":"); if (xfregs.numTexGen.numTexGens < 7) { 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, " float4 clipPos %s TEXCOORD%d;\n", ApiType == API_OPENGL ? ";//" : ":", xfregs.numTexGen.numTexGens); + WRITE(p, " centroid float3 tex%d %s TEXCOORD%d;\n", i, ApiType == API_OPENGL ? ";//" : ":", i); + WRITE(p, " centroid float4 clipPos %s TEXCOORD%d;\n", ApiType == API_OPENGL ? ";//" : ":", xfregs.numTexGen.numTexGens); 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 { // clip position is in w of first 4 texcoords if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting) { 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 { 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");