summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PixelShaderGen.cpp
diff options
context:
space:
mode:
authorJonathan Hamilton <jtrhamilton@gmail.com>2017-11-09 17:39:09 -0800
committerJonathan Hamilton <jtrhamilton@gmail.com>2018-01-05 09:56:46 -0800
commit8d68adcaf3442122fff5bb0988c2f06b0128f021 (patch)
tree2919afee5b82ebbd80fd8e2663000ad244b582db /Source/Core/VideoCommon/PixelShaderGen.cpp
parent29a9ed043bd0946497edf7c4d392ce46041b9817 (diff)
Workaround qualcomm driver bug
It seems it doesn't like modifying inout variables in place - so instead use a temporary for ocol0/ocol1 and only write them once at the end of the shader
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/PixelShaderGen.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index 1a427b70d0..f8c79af91e 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -556,13 +556,17 @@ ShaderCode GeneratePixelShaderCode(APIType ApiType, const ShaderHostConfig& host
}
else if (use_shader_blend)
{
+ // QComm's Adreno driver doesn't seem to like using the framebuffer_fetch value as an
+ // intermediate value with multiple reads & modifications, so pull out the "real" output value
+ // and use a temporary for calculations, then set the output value once at the end of the
+ // shader
if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_FRAGMENT_SHADER_INDEX_DECORATION))
{
- out.Write("FRAGMENT_OUTPUT_LOCATION(0) FRAGMENT_INOUT vec4 ocol0;\n");
+ out.Write("FRAGMENT_OUTPUT_LOCATION(0) FRAGMENT_INOUT vec4 real_ocol0;\n");
}
else
{
- out.Write("FRAGMENT_OUTPUT_LOCATION_INDEXED(0, 0) FRAGMENT_INOUT vec4 ocol0;\n");
+ out.Write("FRAGMENT_OUTPUT_LOCATION_INDEXED(0, 0) FRAGMENT_INOUT vec4 real_ocol0;\n");
}
}
else
@@ -609,6 +613,8 @@ ShaderCode GeneratePixelShaderCode(APIType ApiType, const ShaderHostConfig& host
{
// Store off a copy of the initial fb value for blending
out.Write("\tfloat4 initial_ocol0 = FB_FETCH_VALUE;\n");
+ out.Write("\tfloat4 ocol0;\n");
+ out.Write("\tfloat4 ocol1;\n");
}
}
else // D3D
@@ -1472,5 +1478,5 @@ static void WriteBlend(ShaderCode& out, const pixel_shader_uid_data* uid_data)
out.Write("\tfloat4 blend_result = ocol0;\n");
}
- out.Write("\tocol0 = blend_result;\n");
+ out.Write("\treal_ocol0 = blend_result;\n");
}