Make a note when we need to reset the shader.

Hmm, not sure this is the cleanest way.
This commit is contained in:
Unknown W. Brackets 2014-05-26 21:39:59 -07:00 committed by Henrik Rydgard
parent 14c081904c
commit 29a9ff369e
4 changed files with 6 additions and 2 deletions

View File

@ -739,7 +739,7 @@ int MediaEngine::writeVideoImageWithRange(u32 bufferPtr, int frameWidth, int vid
break;
default:
ERROR_LOG(ME, "Unsupported video pixel format %d", videoPixelMode);
ERROR_LOG_REPORT(ME, "Unsupported video pixel format %d", videoPixelMode);
break;
}
return videoImageSize;

View File

@ -684,10 +684,11 @@ Shader *ShaderManager::ApplyVertexShader(int prim, u32 vertType) {
LinkedShader *ShaderManager::ApplyFragmentShader(Shader *vs, int prim, u32 vertType) {
FragmentShaderID FSID;
ComputeFragmentShaderID(&FSID);
if (lastVShaderSame_ && FSID == lastFSID_) {
if (lastVShaderSame_ && FSID == lastFSID_ && !gstate_c.shaderChanged) {
lastShader_->UpdateUniforms(vertType);
return lastShader_;
}
gstate_c.shaderChanged = false;
lastFSID_ = FSID;

View File

@ -925,6 +925,7 @@ void TextureCache::SetTextureFramebuffer(TexCacheEntry *entry) {
static const GLubyte indices[4] = { 0, 1, 3, 2 };
glUseProgram(program);
gstate_c.shaderChanged = true;
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);

View File

@ -453,6 +453,8 @@ struct GPUStateCache
bool textureSimpleAlpha;
bool vertexFullAlpha;
bool framebufChanged;
// Doesn't need savestating.
bool shaderChanged;
int skipDrawReason;