mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 15:58:05 +02:00
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 commitb80a5f9b7d) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41269>
This commit is contained in:
parent
2201b6ff96
commit
3591e2b4cd
2 changed files with 4 additions and 4 deletions
|
|
@ -844,7 +844,7 @@
|
|||
"description": "pco: fix clamping the array index when shaderImageGatherExtended is enabled",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "854563f0f82ff6d6a0570eee3ee4e24611b6196a",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -641,7 +641,7 @@ static nir_def *lower_tex(nir_builder *b, nir_instr *instr, void *cb_data)
|
|||
assert(array_index);
|
||||
|
||||
nir_def *array_max = usclib_tex_state_array_max(b, tex_state);
|
||||
array_index = nir_uclamp(b, array_index, nir_imm_int(b, 0), array_max);
|
||||
array_index = nir_iclamp(b, array_index, nir_imm_int(b, 0), array_max);
|
||||
if (is_cube_array)
|
||||
array_index = nir_imul_imm(b, array_index, 6);
|
||||
|
||||
|
|
@ -1244,7 +1244,7 @@ static nir_def *lower_image(nir_builder *b, nir_instr *instr, void *cb_data)
|
|||
if (is_array) {
|
||||
assert(array_index);
|
||||
nir_def *array_max = usclib_tex_state_array_max(b, tex_state);
|
||||
array_index = nir_uclamp(b, array_index, nir_imm_int(b, 0), array_max);
|
||||
array_index = nir_iclamp(b, array_index, nir_imm_int(b, 0), array_max);
|
||||
|
||||
nir_def *tex_meta = nir_load_tex_meta_pco(b,
|
||||
PCO_IMAGE_META_COUNT,
|
||||
|
|
@ -1415,7 +1415,7 @@ static nir_def *lower_image(nir_builder *b, nir_instr *instr, void *cb_data)
|
|||
assert(array_index);
|
||||
|
||||
nir_def *array_max = usclib_tex_state_array_max(b, tex_state);
|
||||
array_index = nir_uclamp(b, array_index, nir_imm_int(b, 0), array_max);
|
||||
array_index = nir_iclamp(b, array_index, nir_imm_int(b, 0), array_max);
|
||||
|
||||
nir_def *tex_meta = nir_load_tex_meta_pco(b,
|
||||
PCO_IMAGE_META_COUNT,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue