From 27a41102562f13a413ea0677f6754c9354c49c37 Mon Sep 17 00:00:00 2001 From: "gregory.hainaut" Date: Mon, 18 Jun 2012 22:13:22 +0000 Subject: [PATCH] zzogl glsl: remove a bad optimization that lost track of some textures. Fix potential black-screen git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5308 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/zzogl-pg/opengl/ZZoglShaders.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/zzogl-pg/opengl/ZZoglShaders.h b/plugins/zzogl-pg/opengl/ZZoglShaders.h index d7c4912cb8..f6e8be6af9 100644 --- a/plugins/zzogl-pg/opengl/ZZoglShaders.h +++ b/plugins/zzogl-pg/opengl/ZZoglShaders.h @@ -353,11 +353,21 @@ struct SamplerParam { assert(unit >= 0); assert(unit < 11); if (texid) { + // Unfortunately there is a nastly corner case + // 1/ Attach a texture to the unit + // 2/ delete the texture + // 3/ recreate a texture (with same id) + // 4/ => texture need to be reattached again... +#if 0 if (g_current_texture_bind[unit] != texid) { glActiveTexture(GL_TEXTURE0 + unit); glBindTexture(target, texid); g_current_texture_bind[unit] = texid; } +#else + glActiveTexture(GL_TEXTURE0 + unit); + glBindTexture(target, texid); +#endif } }