mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 11:00:11 +01:00
ac/nir: fix left shift of 1 by 31 places detected by UBSAN
src/amd/common/ac_nir_lower_ngg.c:1135:62: runtime error: left shift of 1 by 31 places cannot be represented in type 'int src/amd/common/ac_nir_lower_ngg.c:622:20: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13951>
This commit is contained in:
parent
a46d155329
commit
8e3fbe7cc8
1 changed files with 2 additions and 2 deletions
|
|
@ -619,7 +619,7 @@ cleanup_culling_shader_after_dce(nir_shader *shader,
|
|||
break;
|
||||
case nir_intrinsic_load_input:
|
||||
if (state->instance_rate_inputs &
|
||||
(1 << (nir_intrinsic_base(intrin) - VERT_ATTRIB_GENERIC0)))
|
||||
(1u << (nir_intrinsic_base(intrin) - VERT_ATTRIB_GENERIC0)))
|
||||
uses_vs_instance_id = true;
|
||||
else
|
||||
uses_vs_vertex_id = true;
|
||||
|
|
@ -1132,7 +1132,7 @@ add_deferred_attribute_culling(nir_builder *b, nir_cf_list *original_extracted_c
|
|||
.memory_semantics=NIR_MEMORY_ACQ_REL, .memory_modes=nir_var_mem_shared);
|
||||
|
||||
nir_store_var(b, gs_accepted_var, nir_imm_bool(b, false), 0x1u);
|
||||
nir_store_var(b, prim_exp_arg_var, nir_imm_int(b, 1 << 31), 0x1u);
|
||||
nir_store_var(b, prim_exp_arg_var, nir_imm_int(b, 1u << 31), 0x1u);
|
||||
|
||||
/* GS invocations load the vertex data and perform the culling. */
|
||||
nir_if *if_gs_thread = nir_push_if(b, nir_build_has_input_primitive_amd(b));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue