Use shader blend for min/max when unsupported.

This commit is contained in:
Unknown W. Brackets 2014-06-16 23:52:08 -07:00
parent 640c58a892
commit 6e751f8092
2 changed files with 11 additions and 6 deletions

View file

@ -311,8 +311,17 @@ bool ShouldUseShaderBlending() {
GEBlendDstFactor funcB = gstate.getBlendFuncB();
GEBlendMode eq = gstate.getBlendEq();
if (eq == GE_BLENDMODE_ABSDIFF) {
switch (eq) {
case GE_BLENDMODE_ABSDIFF:
return true;
case GE_BLENDMODE_MIN:
case GE_BLENDMODE_MAX:
// These don't use the factors.
return !gl_extensions.EXT_blend_minmax && !gl_extensions.GLES3;
default:
break;
}
// This normally involves a blit, so try to skip it.

View file

@ -387,11 +387,7 @@ void TransformDrawEngine::ApplyBlendState() {
glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, GL_ZERO, GL_ONE);
}
if (blendFuncEq == GE_BLENDMODE_ABSDIFF) {
WARN_LOG_REPORT_ONCE(blendAbsdiff, G3D, "Unsupported absdiff blend mode");
}
if (((blendFuncEq >= GE_BLENDMODE_MIN) && gl_extensions.EXT_blend_minmax) || gl_extensions.GLES3) {
if (gl_extensions.EXT_blend_minmax || gl_extensions.GLES3) {
glstate.blendEquation.set(eqLookup[blendFuncEq]);
} else {
glstate.blendEquation.set(eqLookupNoMinMax[blendFuncEq]);