mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
zink: Fix NIR validation error in cubemap-to-array lowering
The cubemap-to-array pass was changing variable types from samplerCubeArray to sampler2DArray but leaving the corresponding deref instruction types unchanged. This caused NIR validation to fail with "instr->type == instr->var->type" assertion. Fix by updating both the variable type and the deref instruction type to maintain consistency required by NIR validation. Cc: mesa-stable Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35117>
This commit is contained in:
parent
b0eb715b50
commit
86f7ce06be
1 changed files with 3 additions and 1 deletions
|
|
@ -388,9 +388,11 @@ lower_cube_coords(nir_builder *b, nir_def *coord, bool is_array)
|
|||
static void
|
||||
rewrite_cube_var_type(nir_builder *b, nir_tex_instr *tex)
|
||||
{
|
||||
nir_variable *sampler = nir_deref_instr_get_variable(nir_instr_as_deref(tex->src[nir_tex_instr_src_index(tex, nir_tex_src_texture_deref)].src.ssa->parent_instr));
|
||||
nir_deref_instr *texture_deref = nir_instr_as_deref(tex->src[nir_tex_instr_src_index(tex, nir_tex_src_texture_deref)].src.ssa->parent_instr);
|
||||
nir_variable *sampler = nir_deref_instr_get_variable(texture_deref);
|
||||
assert(sampler);
|
||||
sampler->type = make_2darray_from_cubemap_with_array(sampler->type);
|
||||
texture_deref->type = sampler->type;
|
||||
}
|
||||
|
||||
/* txb(s, coord, bias) = txl(s, coord, lod(s, coord).y + bias) */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue