spirv: add workaround for Metro Exodus in spirv_to_nir

This is commit 4397c166c0 for spirv_to_nir, otherwise we hit
the same assert with anv driver.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21281>
This commit is contained in:
Tapani Pälli 2023-02-13 10:23:37 +02:00 committed by Marge Bot
parent 888492ecd3
commit effee24951

View file

@ -6797,6 +6797,15 @@ spirv_to_nir(const uint32_t *words, size_t word_count,
}
}
/* Work around applications that declare shader_call_data variables inside
* ray generation shaders.
*
* https://gitlab.freedesktop.org/mesa/mesa/-/issues/5326
*/
if (stage == MESA_SHADER_RAYGEN)
NIR_PASS(_, b->shader, nir_remove_dead_variables, nir_var_shader_call_data,
NULL);
/* Unparent the shader from the vtn_builder before we delete the builder */
ralloc_steal(NULL, b->shader);