mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 05:10:11 +01:00
nir: Ignore ray query ranges that don't start with rq_initialize
Handles is a rare edge case where the ray query is used "before" there is a rq_initialize. cc: mesa-stable Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38850>
This commit is contained in:
parent
5e03d09eb5
commit
034f58c7e3
1 changed files with 13 additions and 0 deletions
|
|
@ -300,6 +300,19 @@ nir_opt_ray_query_ranges(nir_shader *shader)
|
|||
|
||||
struct hash_entry *index_entry =
|
||||
_mesa_hash_table_search(range_indices, ray_query_deref->var);
|
||||
if (!index_entry) {
|
||||
/* The range doesn't exist yet which means that the first instruction
|
||||
* isn't the initialize. Ignore it.
|
||||
*/
|
||||
for (uint32_t i = 0; i < ray_query_count; i++) {
|
||||
if (ray_queries[i] == ray_query_deref->var) {
|
||||
ray_queries[i] = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
struct rq_range *range = ranges + (uintptr_t)index_entry->data;
|
||||
|
||||
if (intrinsic->intrinsic != nir_intrinsic_rq_initialize) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue