mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 09:39:33 +01:00
GL render manager: Fix bug when setting texture sampler if the wrong GL texture slot is active. Will likely help #10583
This commit is contained in:
1 parent
b7dfc743f9
commit
ce16547854
7 files changed
+30
-14
No files matched your search
@@ -816,7 +816,12 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step) {
|
||||
break;
|
||||
case GLRRenderCommand::TEXTURESAMPLER:
|
||||
{
|
||||
GLRTexture *tex = curTex[activeSlot];
|
||||
GLint slot = c.textureSampler.slot;
|
||||
if (slot != activeSlot) {
|
||||
glActiveTexture(GL_TEXTURE0 + slot);
|
||||
activeSlot = slot;
|
||||
}
|
||||
GLRTexture *tex = curTex[slot];
|
||||
if (!tex) {
|
||||
break;
|
||||
}
|
||||
@@ -846,7 +851,12 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step) {
|
||||
}
|
||||
case GLRRenderCommand::TEXTURELOD:
|
||||
{
|
||||
GLRTexture *tex = curTex[activeSlot];
|
||||
GLint slot = c.textureSampler.slot;
|
||||
if (slot != activeSlot) {
|
||||
glActiveTexture(GL_TEXTURE0 + slot);
|
||||
activeSlot = slot;
|
||||
}
|
||||
GLRTexture *tex = curTex[slot];
|
||||
if (!tex) {
|
||||
break;
|
||||
}
|
||||
@@ -900,8 +910,10 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step) {
|
||||
}
|
||||
}
|
||||
|
||||
if (activeSlot != 0)
|
||||
if (activeSlot != 0) {
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
activeSlot = 0; // doesn't matter, just nice.
|
||||
}
|
||||
|
||||
// Wipe out the current state.
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
|
||||
Reference in new issue
Block a user