nir: fix nir_tex_instr hash not count is_sparse field

This fixes nir_opt_cse miss replace a non-sparse tex instruction
with a sparse tex instruction and fail the nir_validate_shader().

Fixes: 3a7972f72a ("nir,spirv: add sparse texture fetches")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>
(cherry picked from commit 2cee73f0f7)
This commit is contained in:
Qiang Yu 2022-01-07 17:37:27 +08:00 committed by Eric Engestrom
parent 7a579039cc
commit 44bfdb08fb
2 changed files with 2 additions and 1 deletions

View file

@ -3721,7 +3721,7 @@
"description": "nir: fix nir_tex_instr hash not count is_sparse field",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "3a7972f72a530ebb1b8c1b1eb660f2506d841ae4"
},

View file

@ -272,6 +272,7 @@ hash_tex(uint32_t hash, const nir_tex_instr *instr)
hash = HASH(hash, instr->is_array);
hash = HASH(hash, instr->is_shadow);
hash = HASH(hash, instr->is_new_style_shadow);
hash = HASH(hash, instr->is_sparse);
unsigned component = instr->component;
hash = HASH(hash, component);
for (unsigned i = 0; i < 4; ++i)