Unbind the fbo texture when it's not used.

Just in case there are problems with decimating it or etc.
This commit is contained in:
Unknown W. Brackets committed 2014-05-27 01:45:20 -07:00
1 parent 0eae30dddb
commit 8f9a2b9882
3 files changed
+11 -2

No files matched your search

+7 -1
View File
@@ -171,7 +171,7 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
gstate_c.textureChanged = TEXCHANGE_UNCHANGED;
}
// Set blend
// Set blend - unless we need to do it in the shader.
bool wantBlend = !gstate.isModeClear() && gstate.isAlphaBlendEnabled();
if (wantBlend && ShouldUseShaderBlending()) {
if (!gl_extensions.NV_shader_framebuffer_fetch) {
@@ -191,10 +191,16 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
glActiveTexture(GL_TEXTURE1);
framebufferManager_->BindFramebufferColor(NULL);
glActiveTexture(GL_TEXTURE0);
fboTexBound_ = true;
}
// None of the below logic is interesting, we're gonna do it entirely in the shader.
wantBlend = false;
} else if (fboTexBound_) {
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, 0);
glActiveTexture(GL_TEXTURE0);
}
glstate.blend.set(wantBlend);
if (wantBlend) {
// This can't be done exactly as there are several PSP blend modes that are impossible to do on OpenGL ES 2.0, and some even on regular OpenGL for desktop.
+2 -1
View File
@@ -126,7 +126,8 @@ TransformDrawEngine::TransformDrawEngine()
numDrawCalls(0),
vertexCountInDrawCalls(0),
decodeCounter_(0),
uvScale(0) {
uvScale(0),
fboTexBound_(false) {
decimationCounter_ = VERTEXCACHE_DECIMATION_INTERVAL;
// Allocate nicely aligned memory. Maybe graphics drivers will
// appreciate it.
+2
View File
@@ -243,4 +243,6 @@ private:
u32 dcid_;
UVScale *uvScale;
bool fboTexBound_;
};