Fix #104918: EEVEE: Resolve cache warming assertion.
Erroneous cache warming case where the generated material is identical to default material and cached shader is re-used, resulting in case where the parent shader is identical to the source. Authored by Apple: Michael Parkin-White Ref #96261
This commit is contained in:
@@ -951,14 +951,16 @@ void GPU_material_compile(GPUMaterial *mat)
|
||||
* As PSOs do not always match for default shaders, we limit warming for PSO
|
||||
* configurations to ensure compile time remains fast, as these first
|
||||
* entries will be the most commonly used PSOs. As not all PSOs are necessarily
|
||||
* required immediately, this limit should remain low (1-3 at most).
|
||||
* */
|
||||
* required immediately, this limit should remain low (1-3 at most). */
|
||||
if (mat->default_mat != NULL && mat->default_mat != mat) {
|
||||
if (mat->default_mat->pass != NULL) {
|
||||
GPUShader *parent_sh = GPU_pass_shader_get(mat->default_mat->pass);
|
||||
if (parent_sh) {
|
||||
GPU_shader_set_parent(sh, parent_sh);
|
||||
GPU_shader_warm_cache(sh, 1);
|
||||
/* Skip warming if cached pass is identical to the default material. */
|
||||
if (mat->default_mat->pass != mat->pass && parent_sh != sh) {
|
||||
GPU_shader_set_parent(sh, parent_sh);
|
||||
GPU_shader_warm_cache(sh, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user