mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-27 18:48:14 +02:00
spirv: fixup infinite recursion with shader replacement
While trying to use that feature on RADV I ran into an infinite
recursion.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 97b4a6d0e3 ("compiler: SPIR-V shader replacement")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41751>
This commit is contained in:
parent
5b07e5e8e4
commit
88418718a9
2 changed files with 8 additions and 2 deletions
|
|
@ -145,6 +145,9 @@ struct spirv_to_nir_options {
|
|||
|
||||
/* If GroupNonUniform capability is used, set this api subgroup size. */
|
||||
uint8_t group_non_uniform_subgroup_size;
|
||||
|
||||
/* Don't look at MESA_SPIRV_READ_PATH for replacements */
|
||||
bool ignore_replacement;
|
||||
};
|
||||
|
||||
enum spirv_verify_result {
|
||||
|
|
|
|||
|
|
@ -7622,7 +7622,10 @@ spirv_to_nir(const uint32_t *words, size_t word_count,
|
|||
}
|
||||
|
||||
const char *read_path = os_get_option_secure("MESA_SPIRV_READ_PATH");
|
||||
if (read_path) {
|
||||
if (!options->ignore_replacement && read_path) {
|
||||
struct spirv_to_nir_options replace_options = *options;
|
||||
replace_options.ignore_replacement = true;
|
||||
|
||||
char blake3_str[BLAKE3_HEX_LEN];
|
||||
_mesa_blake3_format(blake3_str, b->shader->info.source_blake3);
|
||||
|
||||
|
|
@ -7675,7 +7678,7 @@ spirv_to_nir(const uint32_t *words, size_t word_count,
|
|||
ralloc_free(b->shader);
|
||||
ralloc_free(b);
|
||||
nir_shader* result = spirv_to_nir(replacement_words, replacement_size / sizeof(uint32_t),
|
||||
spec, stage, entry_point_name, options,
|
||||
spec, stage, entry_point_name, &replace_options,
|
||||
nir_options);
|
||||
|
||||
free((void *)replacement_words);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue