mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-22 10:19:01 +00:00
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.
This commit is contained in:
parent
fbbea9bb9b
commit
8a48b42e4c
7 changed files with 53 additions and 27 deletions
|
@ -568,6 +568,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");
|
||||
|
@ -693,13 +695,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
|
||||
{
|
||||
|
|
|
@ -170,6 +170,7 @@ struct VideoConfig
|
|||
|
||||
bool bSupportsGLSL;
|
||||
bool bSupportsGLSLBinding;
|
||||
bool bSupportsGLSLBlend;
|
||||
bool bSupportsGLSLUBO;
|
||||
bool bSupportsGLSLATTRBind;
|
||||
bool bSupportsGLSLCache;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue