Must reset lastShader after swtiching shaders outside the "framework".

This commit is contained in:
Henrik Rydgård 2013-10-10 20:11:20 +02:00
parent 51a3e16295
commit ae94e5c078
4 changed files with 9 additions and 6 deletions

View File

@ -395,7 +395,7 @@ void FramebufferManager::DrawActiveTexture(float x, float y, float w, float h, f
const float pos[12] = {x,y,0, x+w,y,0, x+w,y+h,0, x,y+h,0};
const float texCoords[8] = {0,v1, u2,v1, u2,v2, 0,v2};
const GLubyte indices[4] = {0,1,3,2};
if (!draw2dprogram_) {
CompileDraw2DProgram();
}
@ -418,7 +418,10 @@ void FramebufferManager::DrawActiveTexture(float x, float y, float w, float h, f
glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_BYTE, indices);
glDisableVertexAttribArray(program->a_position);
glDisableVertexAttribArray(program->a_texcoord0);
glsl_unbind();
shaderManager_->DirtyLastShader(); // dirty lastShader_
}
VirtualFramebuffer *FramebufferManager::GetVFBAt(u32 addr) {
@ -901,7 +904,7 @@ void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool s
case GE_FORMAT_5551:
nvfb->colorDepth = FBO_5551;
break;
case GE_FORMAT_565:
case GE_FORMAT_565:
nvfb->colorDepth = FBO_565;
break;
case GE_FORMAT_8888:
@ -918,7 +921,7 @@ void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool s
nvfb->last_frame_render = gpuStats.numFlips;
bvfbs_.push_back(nvfb);
fbo_bind_as_render_target(nvfb->fbo);
fbo_bind_as_render_target(nvfb->fbo);
ClearBuffer();
glEnable(GL_DITHER);
} else {

View File

@ -605,7 +605,7 @@ void GLES_GPU::CopyDisplayToOutputInternal() {
framebufferManager_.CopyDisplayToOutput();
framebufferManager_.EndFrame();
shaderManager_->EndFrame();
shaderManager_->DirtyLastShader();
// If buffered, discard the depth buffer of the backbuffer. Don't even know if we need one.
#if 0

View File

@ -518,7 +518,7 @@ void ShaderManager::DirtyShader() {
shaderSwitchDirty_ = 0;
}
void ShaderManager::EndFrame() { // disables vertex arrays
void ShaderManager::DirtyLastShader() { // disables vertex arrays
if (lastShader_)
lastShader_->stop();
lastShader_ = 0;

View File

@ -165,7 +165,7 @@ public:
void DirtyUniform(u32 what) {
globalDirty_ |= what;
}
void EndFrame(); // disables vertex arrays
void DirtyLastShader(); // disables vertex arrays
int NumVertexShaders() const { return (int)vsCache_.size(); }
int NumFragmentShaders() const { return (int)fsCache_.size(); }