mesa/src/freedreno/ir3
Danylo Piliaiev cbfb7e930d 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)
2023-09-12 14:26:47 +01:00
..
tests ir3: Add cat7 sleep instruction 2023-02-21 19:59:14 +00:00
.dir-locals.el ir3: Update .editorconfig and .dir-locals.el 2021-07-12 20:57:21 +00:00
.editorconfig ir3: Update .editorconfig and .dir-locals.el 2021-07-12 20:57:21 +00:00
disasm-a3xx.c freedreno/ir3: Don't use negative opc for meta instructions 2023-03-13 17:31:22 +00:00
instr-a3xx.h freedreno/ir3: c++-proof the headers 2023-03-13 17:31:22 +00:00
ir3.c freedreno/ir3+tu: Calculate subgroup size in ir3 2023-03-13 17:31:22 +00:00
ir3.h freedreno/ir3+tu: Calculate subgroup size in ir3 2023-03-13 17:31:22 +00:00
ir3_a4xx.c Change all debug_assert calls to assert 2022-07-10 00:50:35 +00:00
ir3_a6xx.c ir3/a6xx: Fix immediate offset stg/ldg path 2022-12-12 17:38:19 +00:00
ir3_array_to_ssa.c ir3: Reformat source with clang-format 2021-07-12 20:57:21 +00:00
ir3_assembler.c ir3: Remove ir3_shader_variant::shader 2022-05-13 17:07:05 +00:00
ir3_assembler.h freedreno: C++ fixes for computerator to compile 2023-03-30 23:40:48 +00:00
ir3_cf.c ir3: prohibit folding of half->full conversion into mul.s24/u24 2021-08-20 11:46:14 +00:00
ir3_compiler.c freedreno/a3-5xx: Don't try to emit ISAM for SSBO loads. 2023-08-18 12:08:46 +01:00
ir3_compiler.h freedreno/a3-5xx: Don't try to emit ISAM for SSBO loads. 2023-08-18 12:08:46 +01:00
ir3_compiler_nir.c freedreno/a3-5xx: Don't try to emit ISAM for SSBO loads. 2023-08-18 12:08:46 +01:00
ir3_context.c ir3: Re-fuse ffmas after nir_lower_imul cleanup breaks them. 2022-11-10 19:37:50 +00:00
ir3_context.h tree-wide: Fixes multi-line macro width after replace to __func__ 2022-11-22 06:53:47 +00:00
ir3_cp.c Change all debug_assert calls to assert 2022-07-10 00:50:35 +00:00
ir3_cse.c util: normalize include files under src/util/*.h with util/ prefix in mesa code base 2022-11-10 06:27:25 +00:00
ir3_dce.c freedreno,tu,ir3: DCE ij_pix 2022-11-22 11:56:21 +00:00
ir3_delay.c ir3: Use (ss) for instructions writing shared regs 2022-01-07 14:26:08 +00:00
ir3_disk_cache.c freedreno/ir3: Stop copying options 2023-01-18 06:10:10 +00:00
ir3_dominance.c util: normalize include files under src/util/*.h with util/ prefix in mesa code base 2022-11-10 06:27:25 +00:00
ir3_image.c freedreno/ir3: Fold 16-bit conversions into image load/store src/dsts. 2022-06-01 22:19:44 +00:00
ir3_image.h ir3: Reformat source with clang-format 2021-07-12 20:57:21 +00:00
ir3_legalize.c ir3: Fix FS quad ops returning wrong values from helper invocations 2023-07-21 18:08:06 +01:00
ir3_legalize_relative.c ir3: set UL flag before ir3_lower_subgroups 2022-07-27 17:08:03 +00:00
ir3_lexer.l ir3: Add cat7 sleep instruction 2023-02-21 19:59:14 +00:00
ir3_liveness.c util: normalize include files under src/util/*.h with util/ prefix in mesa code base 2022-11-10 06:27:25 +00:00
ir3_lower_parallelcopy.c ir3: Add ir3_shader_variant::compiler 2022-05-13 17:07:05 +00:00
ir3_lower_spill.c ir3/lower_spill: Fix corner case with oob offsets 2022-03-15 21:36:38 +00:00
ir3_lower_subgroups.c ir3: Add support for subgroup arithmetic 2022-03-10 17:15:29 +00:00
ir3_merge_regs.c util: normalize include files under src/util/*.h with util/ prefix in mesa code base 2022-11-10 06:27:25 +00:00
ir3_nir.c freedreno/a3-5xx: Don't try to emit ISAM for SSBO loads. 2023-08-18 12:08:46 +01:00
ir3_nir.h ir3: C++-proofing 2023-03-24 15:49:25 +00:00
ir3_nir_analyze_ubo_ranges.c freedreno/ir3: Stop copying options 2023-01-18 06:10:10 +00:00
ir3_nir_imul.py python: drop python2 support 2021-08-14 21:44:32 +00:00
ir3_nir_lower_64b.c freedreno/ir3: handle global atomics 2021-11-23 18:26:37 +00:00
ir3_nir_lower_io_offsets.c Change all debug_assert calls to assert 2022-07-10 00:50:35 +00:00
ir3_nir_lower_layer_id.c freedreno, nir, ir3: implement GL_EXT_shader_framebuffer_fetch 2023-03-23 16:59:56 +00:00
ir3_nir_lower_load_barycentric_at_offset.c ir3: Use non-persp interpolation when appropriate for interpolateAtOffset. 2022-07-11 16:56:05 +00:00
ir3_nir_lower_load_barycentric_at_sample.c ir3: Make sure to pass the interp_mode through in our load_bary lowering. 2022-07-11 16:56:05 +00:00
ir3_nir_lower_tess.c ir3: Suppress disasm of internal shaders unless IR3_SHADER_DEBUG=internal. 2022-08-17 00:04:08 +00:00
ir3_nir_lower_tex_prefetch.c ir3/lower_tex_prefetch: Fix crash with lowered load_barycentric_at_offset 2023-09-12 14:26:47 +01:00
ir3_nir_lower_wide_load_store.c freedreno/ir3: Add wide load/store lowering 2021-10-21 18:59:57 +00:00
ir3_nir_move_varying_inputs.c Change all debug_assert calls to assert 2022-07-10 00:50:35 +00:00
ir3_nir_opt_preamble.c nir: Combine if_uses with instruction uses 2023-04-07 23:48:03 +00:00
ir3_nir_trig.py ir3: Make trig replacement expression exact 2021-09-17 15:45:29 +00:00
ir3_parser.y ir3: Add cat7 sleep instruction 2023-02-21 19:59:14 +00:00
ir3_postsched.c freedreno/ir3: Validate our scheduling DAGs after construction. 2022-09-29 23:40:18 +00:00
ir3_print.c ir3: Implement and document ldc.k 2022-03-17 12:15:45 +00:00
ir3_ra.c ir3/ra: Make sure we don't pick a preferred reg overflowing the file. 2022-11-10 19:37:50 +00:00
ir3_ra.h ir3/ra: Fix ra_foreach_dst_n 2022-03-10 17:15:29 +00:00
ir3_ra_validate.c ir3: Reformat source with clang-format 2021-07-12 20:57:21 +00:00
ir3_remove_unreachable.c util/list: rename LIST_ENTRY() to list_entry() 2022-07-28 10:10:44 +00:00
ir3_sched.c freedreno/ir3: Validate our scheduling DAGs after construction. 2022-09-29 23:40:18 +00:00
ir3_shader.c freedreno, nir, ir3: implement GL_EXT_shader_framebuffer_fetch 2023-03-23 16:59:56 +00:00
ir3_shader.h ir3: Fix FS quad ops returning wrong values from helper invocations 2023-07-21 18:08:06 +01:00
ir3_spill.c ir3/spill: Fix extracting from a vector at the end of a block 2022-08-22 20:48:05 +00:00
ir3_validate.c freedreno/ir3: Fix validation of half-precision image store values. 2022-06-01 22:19:44 +00:00
meson.build freedreno, nir, ir3: implement GL_EXT_shader_framebuffer_fetch 2023-03-23 16:59:56 +00:00