diff --git a/GPU/Directx9/PixelShaderGeneratorDX9.cpp b/GPU/Directx9/PixelShaderGeneratorDX9.cpp index 73bd6165e4..7539dfa4e9 100644 --- a/GPU/Directx9/PixelShaderGeneratorDX9.cpp +++ b/GPU/Directx9/PixelShaderGeneratorDX9.cpp @@ -135,7 +135,8 @@ bool GenerateFragmentShaderHLSL(const FShaderID &id, char *buffer, ShaderLanguag if (doTexture) { WRITE(p, " float3 v_texcoord: TEXCOORD0;\n"); } - WRITE(p, " float4 v_color0: COLOR0;\n"); + const char *colorInterpolation = doFlatShading && lang == HLSL_D3D11 ? "nointerpolation " : ""; + WRITE(p, " %sfloat4 v_color0: COLOR0;\n", colorInterpolation); if (lmode) { WRITE(p, " float3 v_color1: COLOR1;\n"); } diff --git a/GPU/Directx9/VertexShaderGeneratorDX9.cpp b/GPU/Directx9/VertexShaderGeneratorDX9.cpp index 7b1b542558..227c51223c 100644 --- a/GPU/Directx9/VertexShaderGeneratorDX9.cpp +++ b/GPU/Directx9/VertexShaderGeneratorDX9.cpp @@ -231,7 +231,8 @@ void GenerateVertexShaderHLSL(const VShaderID &id, char *buffer, ShaderLanguage if (doTexture) { WRITE(p, " float3 v_texcoord : TEXCOORD0;\n"); } - WRITE(p, " float4 v_color0 : COLOR0;\n"); + const char *colorInterpolation = doFlatShading && lang == HLSL_D3D11 ? "nointerpolation " : ""; + WRITE(p, " %sfloat4 v_color0 : COLOR0;\n", colorInterpolation); if (lmode) WRITE(p, " float3 v_color1 : COLOR1;\n");