summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2011-12-29 00:32:06 -0600
committerSonicadvance1 <sonicadvance1@RH-Live.(none)>2012-10-09 23:56:00 -0500
commit2e15440896f0267ef4b602ebfded277c95e0572f (patch)
treef5cc4a1ab36923650c8e9389dbfc47893b83ab07 /Source/Core/VideoCommon
parent5085cebaf381e5a56505b9535ecbfc633cc24c07 (diff)
Add support for Dual source blending to older ATI cards that don't support 420pack but do support GL_ARB_blend_func_extended. This is more proper as well anyways.
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/Src/PixelShaderGen.cpp15
-rw-r--r--Source/Core/VideoCommon/Src/VideoConfig.h1
2 files changed, 13 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
index a6e1995ad9..a4d3f3a397 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
@@ -577,6 +577,8 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
if (g_ActiveConfig.backend_info.bSupportsGLSLATTRBind)
WRITE(p, "#extension GL_ARB_explicit_attrib_location : enable\n");
+ if (g_ActiveConfig.backend_info.bSupportsGLSLBlend)
+ WRITE(p, "#extension GL_ARB_blend_func_extended : enable\n");
// Silly differences
WRITE(p, "#define float2 vec2\n");
WRITE(p, "#define float3 vec3\n");
@@ -702,13 +704,20 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
{
// GLSL doesn't do main arguments
// Once we switch to GLSL 1.3 we will bind a lot of these.
-
if (dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND)
{
// This won't get hit unless we support GL 3.3
- WRITE(p, " layout(location = 0) out float4 ocol0;\n");
- WRITE(p, " layout(location = 0, index = 1) out float4 ocol1;\n"); // Will be supported later
+ if (g_ActiveConfig.backend_info.bSupportsGLSLBinding)
+ {
+ WRITE(p, " layout(location = 0) out float4 ocol0;\n");
+ WRITE(p, " layout(location = 0, index = 1) out float4 ocol1;\n");
+ }
+ else
+ {
+ WRITE(p, " out float4 ocol0;\n");
+ WRITE(p, " out float4 ocol1;\n");
+ }
}
else
{
diff --git a/Source/Core/VideoCommon/Src/VideoConfig.h b/Source/Core/VideoCommon/Src/VideoConfig.h
index 6476317efc..92afaa313d 100644
--- a/Source/Core/VideoCommon/Src/VideoConfig.h
+++ b/Source/Core/VideoCommon/Src/VideoConfig.h
@@ -166,6 +166,7 @@ struct VideoConfig
bool bSupportsGLSL;
bool bSupportsGLSLBinding;
+ bool bSupportsGLSLBlend;
bool bSupportsGLSLUBO;
bool bSupportsGLSLATTRBind;
bool bSupportsGLSLCache;