Unify ApplyShaderBlending

This commit is contained in:
Henrik Rydgard committed 2017-02-17 12:21:27 +01:00
1 parent 4538edad14
commit 08d173ceee
10 files changed
+34 -88

No files matched your search

-28
View File
@@ -120,34 +120,6 @@ static const GLushort logicOps[] = {
};
#endif
bool DrawEngineGLES::ApplyShaderBlending() {
if (gstate_c.featureFlags & GPU_SUPPORTS_ANY_FRAMEBUFFER_FETCH) {
return true;
}
static const int MAX_REASONABLE_BLITS_PER_FRAME = 24;
static int lastFrameBlit = -1;
static int blitsThisFrame = 0;
if (lastFrameBlit != gpuStats.numFlips) {
if (blitsThisFrame > MAX_REASONABLE_BLITS_PER_FRAME) {
WARN_LOG_REPORT_ONCE(blendingBlit, G3D, "Lots of blits needed for obscure blending: %d per frame, blend %d/%d/%d", blitsThisFrame, gstate.getBlendFuncA(), gstate.getBlendFuncB(), gstate.getBlendEq());
}
blitsThisFrame = 0;
lastFrameBlit = gpuStats.numFlips;
}
++blitsThisFrame;
if (blitsThisFrame > MAX_REASONABLE_BLITS_PER_FRAME * 2) {
WARN_LOG_ONCE(blendingBlit2, G3D, "Skipping additional blits needed for obscure blending: %d per frame, blend %d/%d/%d", blitsThisFrame, gstate.getBlendFuncA(), gstate.getBlendFuncB(), gstate.getBlendEq());
return false;
}
fboTexNeedBind_ = true;
gstate_c.Dirty(DIRTY_SHADERBLEND);
return true;
}
inline void DrawEngineGLES::ResetShaderBlending() {
if (fboTexBound_) {
glActiveTexture(GL_TEXTURE1);