mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-21 06:30:36 +01:00
ir3/lower_tex_prefetch: Fix crash with lowered load_barycentric_at_offset
ir3_nir_lower_tex_prefetch expects src0 of load_interpolated_input to
be intrinsic, however this assumption broke when src0 is
load_barycentric_at_offset and is lowered in series of alu instructions.
32x2 %1121 = @load_barycentric_at_offset (%1120) (interp_mode=0)
32x4 %1118 = @load_interpolated_input (%1121, %1116 (0x0)) ...
32x2 %32 = vec2 %1118.x, %1118.y
32x4 %37 = (float32)tex %36 (texture_handle), %34 (sampler_handle), %32 (coord), 0 (texture), 0 (sampler)
is lowered into:
[...]
32 %54 = ffma %46.y, %52, %50
32 %55 = ffma %46.y, %53, %51
32x2 %56 = vec2 %54, %55
32x4 %57 = @load_interpolated_input (%56, %25 (0x0))
[...]
Crash backtrace:
#5 in __GI___assert_fail (assertion=0x7ff6692328 "parent && parent->type == nir_instr_type_intrinsic",
file=0x7ff66921c8 "nir.h", line=2536, function=0x7ff6692630 <__PRETTY_FUNCTION__.13> "nir_instr_as_intrinsic")
at assert.c:101
#6 in nir_instr_as_intrinsic (parent=0x7fd4b648e8) at nir.h:2536
#7 in coord_offset (ssa=0x7fd4b649d0) at ir3_nir_lower_tex_prefetch.c:77
#8 in coord_offset (ssa=0x7fd4b64a90) at ir3_nir_lower_tex_prefetch.c:48
#9 in ir3_nir_coord_offset (ssa=0x7fd4b64a90) at ir3_nir_lower_tex_prefetch.c:104
#10 in lower_tex_prefetch_block (block=0x7fd482c100) at ir3_nir_lower_tex_prefetch.c:185
#11 in lower_tex_prefetch_func (impl=0x7fd4aa0890) at ir3_nir_lower_tex_prefetch.c:218
#12 in ir3_nir_lower_tex_prefetch (shader=0x7fd4942b10) at ir3_nir_lower_tex_prefetch.c:242
Cc: mesa-stable
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25096>
(cherry picked from commit b16472fc97)
This commit is contained in:
parent
e7cf3b3d3e
commit
cbfb7e930d
2 changed files with 5 additions and 1 deletions
|
|
@ -841,7 +841,7 @@
|
|||
"description": "ir3/lower_tex_prefetch: Fix crash with lowered load_barycentric_at_offset",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -85,6 +85,10 @@ coord_offset(nir_ssa_def *ssa)
|
|||
if (!input->src[0].is_ssa)
|
||||
return -1;
|
||||
|
||||
/* Happens with lowered load_barycentric_at_offset */
|
||||
if (input->src[0].ssa->parent_instr->type != nir_instr_type_intrinsic)
|
||||
return -1;
|
||||
|
||||
nir_intrinsic_instr *interp =
|
||||
nir_instr_as_intrinsic(input->src[0].ssa->parent_instr);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue