mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
GLES: Update shader uniforms after apply state.
We may set shaderblend, projmatrix, or depthrange dirty in ApplyDrawState(). These need to update shader uniforms to apply correctly, but we were checking beforehand.
This commit is contained in:
parent
2405157009
commit
b57ba89b45
1 changed files with 9 additions and 9 deletions
|
@ -646,14 +646,6 @@ Shader *ShaderManagerGLES::CompileVertexShader(VShaderID VSID) {
|
|||
}
|
||||
|
||||
Shader *ShaderManagerGLES::ApplyVertexShader(bool useHWTransform, bool useHWTessellation, u32 vertType, VShaderID *VSID) {
|
||||
uint64_t dirty = gstate_c.GetDirtyUniforms();
|
||||
if (dirty) {
|
||||
if (lastShader_)
|
||||
lastShader_->dirtyUniforms |= dirty;
|
||||
shaderSwitchDirtyUniforms_ |= dirty;
|
||||
gstate_c.CleanUniforms();
|
||||
}
|
||||
|
||||
if (gstate_c.IsDirty(DIRTY_VERTEXSHADER_STATE)) {
|
||||
gstate_c.Clean(DIRTY_VERTEXSHADER_STATE);
|
||||
ComputeVertexShaderID(VSID, vertType, useHWTransform, useHWTessellation);
|
||||
|
@ -661,7 +653,7 @@ Shader *ShaderManagerGLES::ApplyVertexShader(bool useHWTransform, bool useHWTess
|
|||
*VSID = lastVSID_;
|
||||
}
|
||||
|
||||
if (lastShader_ != 0 && *VSID == lastVSID_) {
|
||||
if (lastShader_ != nullptr && *VSID == lastVSID_) {
|
||||
lastVShaderSame_ = true;
|
||||
return lastShader_->vs_; // Already all set.
|
||||
} else {
|
||||
|
@ -698,6 +690,14 @@ Shader *ShaderManagerGLES::ApplyVertexShader(bool useHWTransform, bool useHWTess
|
|||
}
|
||||
|
||||
LinkedShader *ShaderManagerGLES::ApplyFragmentShader(VShaderID VSID, Shader *vs, u32 vertType, bool useBufferedRendering) {
|
||||
uint64_t dirty = gstate_c.GetDirtyUniforms();
|
||||
if (dirty) {
|
||||
if (lastShader_)
|
||||
lastShader_->dirtyUniforms |= dirty;
|
||||
shaderSwitchDirtyUniforms_ |= dirty;
|
||||
gstate_c.CleanUniforms();
|
||||
}
|
||||
|
||||
FShaderID FSID;
|
||||
if (gstate_c.IsDirty(DIRTY_FRAGMENTSHADER_STATE)) {
|
||||
gstate_c.Clean(DIRTY_FRAGMENTSHADER_STATE);
|
||||
|
|
Loading…
Add table
Reference in a new issue