mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
dirtyunfirom when shader is changed
This commit is contained in:
parent
923bee1332
commit
35619ed7f9
2 changed files with 13 additions and 7 deletions
|
@ -633,6 +633,11 @@ LinkedShader *ShaderManager::ApplyShader(int prim) {
|
|||
const LinkedShaderCacheEntry entry(vs, fs, ls);
|
||||
linkedShaderCache_.push_back(entry);
|
||||
} else {
|
||||
// If shader changed we need to update all uniforms
|
||||
if (lastShader_ != ls) {
|
||||
ls->dirtyUniforms = DIRTY_ALL;
|
||||
}
|
||||
|
||||
ls->use();
|
||||
}
|
||||
|
||||
|
|
|
@ -149,17 +149,18 @@ void GenerateVertexShader(int prim, char *buffer, bool useHWTransform) {
|
|||
doLight[i] = LIGHT_FULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (gstate.isModeThrough()) {
|
||||
WRITE(p, "float4x4 u_proj_through;\n");
|
||||
} else {
|
||||
WRITE(p, "float4x4 u_proj;\n");
|
||||
// Add all the uniforms we'll need to transform properly.
|
||||
}
|
||||
|
||||
if (enableFog) {
|
||||
WRITE(p, "float2 u_fogcoef;\n");
|
||||
}
|
||||
|
||||
if (gstate.isModeThrough()) {
|
||||
WRITE(p, "float4x4 u_proj_through:register(c0);\n");
|
||||
} else {
|
||||
WRITE(p, "float4x4 u_proj:register(c8);\n");
|
||||
// Add all the uniforms we'll need to transform properly.
|
||||
}
|
||||
if (useHWTransform || !hasColor)
|
||||
WRITE(p, "float4 u_matambientalpha;\n"); // matambient + matalpha
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue