mesa/src/imagination/pco
Nick Hamilton 3591e2b4cd pco: fix clamping the array index when shaderImageGatherExtended is enabled
The array index value is a signed integer but the compiler was using
the unsigned version of the clamp helper function meaning the value
was not been clamped to 0 when its value was < 0.

Fix the following deqp test cases when shaderImageGatherExtended is enabled
dEQP-VK.glsl.texture_gather.basic.2d_array.*
dEQP-VK.glsl.texture_gather.offset.*.2d_array.*
dEQP-VK.glsl.texture_gather.offset_dynamic.*.2d_array.*
dEQP-VK.glsl.texture_gather.offsets.*.2d_array.*

Fixes: 854563f0f8 ("pco: fully switch over to common smp emission code")
Signed-off-by: Nick Hamilton <nick.hamilton@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
(cherry picked from commit b80a5f9b7d)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41269>
2026-04-29 17:54:43 +02:00
..
uscgen pvr: split idep_pco_uscgen_programs_h in two 2025-11-17 16:04:30 +00:00
usclib nir: add ACCESS_ATOMIC 2025-10-07 17:41:30 +00:00
meson.build pvr, pco: add primitive support for VK_KHR_robustness2.nullDescriptor 2025-09-30 12:15:54 +00:00
pco.c pco: store additional metadata for precompiled shaders 2025-09-22 14:52:03 +01:00
pco.h pvr, pco: add multiview compiler support, advertise extension 2025-09-30 12:15:46 +00:00
pco_binary.c util/dynarray: infer type in append 2025-10-24 18:32:07 +00:00
pco_bool.c pco: update virtual register support for bools and nir reg translation 2025-09-16 18:26:09 +00:00
pco_builder.h pco: Switch back to util/list 2025-09-16 18:26:44 +00:00
pco_builder_ops.h.py pco: remove modifiers from instructions with variable src/dests 2025-09-16 18:26:11 +00:00
pco_cf.c util/dynarray: infer type in append 2025-10-24 18:32:07 +00:00
pco_common.h.py pvr, pco: enable pre-generated header string functions to work with clc 2025-09-22 14:52:03 +01:00
pco_const_imms.c pco, pygen: differentiate between int and float ref mods 2025-09-16 18:26:08 +00:00
pco_data.h pvr, pco: add primitive support for VK_KHR_robustness2.nullDescriptor 2025-09-30 12:15:54 +00:00
pco_debug.c pco: add support for loops and ifs using predicated execution 2025-09-16 18:26:09 +00:00
pco_end.c pco: add support for loops and ifs using predicated execution 2025-09-16 18:26:09 +00:00
pco_group_instrs.c pco: Switch back to util/list 2025-09-16 18:26:44 +00:00
pco_index.c pco: initial control-flow support 2025-09-16 18:26:08 +00:00
pco_info.c.py pco, pygen: validate phases and io allocations for ops 2025-07-08 23:10:50 +00:00
pco_internal.h pco: Fix pco_last_igrp returning the first element instead of the last 2026-04-29 17:54:43 +02:00
pco_ir.c pco: add pass to expand out vecs only used by comps 2025-09-16 18:26:11 +00:00
pco_isa.h.py build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
pco_isa.py pco: initial image write support 2025-09-16 18:26:09 +00:00
pco_legalize.c pco: support accessing shareds/coeffs >= 256 2025-09-16 18:26:12 +00:00
pco_map.h.py pco: amend index register mapping 2025-09-16 18:26:08 +00:00
pco_map.py pco: fix encoding of fred's s0abs bit 2026-04-01 11:45:33 +02:00
pco_nir.c pco: amend tg4 lowering 2026-04-29 17:54:43 +02:00
pco_nir_algebraic.py pco: improve early and late algebraic pass ordering 2025-10-11 20:28:16 +01:00
pco_nir_compute.c pco: use nir_cf_{extract,reinsert} instead of inlining compute instance check 2025-09-16 18:26:40 +00:00
pco_nir_io.c pco: use nir_unlower_io_to_vars 2025-09-27 23:45:54 +01:00
pco_nir_lower_null_descriptors.c treewide: add & use parent instr helpers 2025-11-12 21:22:13 +00:00
pco_nir_pvfio.c pvr: Fix missing sample mask test instructions 2026-01-06 12:37:20 +00:00
pco_nir_sync.c pco: add NIR global_atomic lowering 2026-01-20 15:37:34 +00:00
pco_nir_tex.c pco: fix clamping the array index when shaderImageGatherExtended is enabled 2026-04-29 17:54:43 +02:00
pco_nir_vk.c treewide: add & use parent instr helpers 2025-11-12 21:22:13 +00:00
pco_ops.h.py pco, pygen: add better exception messages 2024-11-29 15:14:12 +00:00
pco_ops.py pvr, pco: switch to clc load/store sr and idfwdf shaders 2025-09-22 14:52:05 +01:00
pco_opt.c treewide: use UTIL_DYNARRAY_INIT 2025-11-04 13:39:48 +00:00
pco_print.c pco: Switch back to util/list 2025-09-16 18:26:44 +00:00
pco_pygen_common.py pco, pygen: amend translation of srcs/dests with no mods 2025-07-08 23:10:45 +00:00
pco_ra.c treewide: use UTIL_DYNARRAY_INIT 2025-11-04 13:39:48 +00:00
pco_schedule.c pvr, pco: switch to clc load/store sr and idfwdf shaders 2025-09-22 14:52:05 +01:00
pco_trans_nir.c pco: reserve additional outputs for trilinear sampled coeffs 2026-04-29 17:54:43 +02:00
pco_validate.c pco, pygen: expose enhanced logical ops with optional mask 2025-09-16 18:26:08 +00:00