mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
gallivm: Fix atomic_global types
Passes LLVM validation on the test_mesh_shader_rendering vkd3d-proton test. cc: mesa-stable Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23996>
This commit is contained in:
parent
791785c2b4
commit
f281290005
1 changed files with 4 additions and 16 deletions
|
|
@ -1113,6 +1113,7 @@ static void emit_atomic_global(struct lp_build_nir_context *bld_base,
|
||||||
|
|
||||||
LLVMValueRef value_ptr = LLVMBuildExtractElement(gallivm->builder, val,
|
LLVMValueRef value_ptr = LLVMBuildExtractElement(gallivm->builder, val,
|
||||||
loop_state.counter, "");
|
loop_state.counter, "");
|
||||||
|
value_ptr = LLVMBuildBitCast(gallivm->builder, value_ptr, atom_bld->elem_type, "");
|
||||||
|
|
||||||
LLVMValueRef addr_ptr = LLVMBuildExtractElement(gallivm->builder, addr,
|
LLVMValueRef addr_ptr = LLVMBuildExtractElement(gallivm->builder, addr,
|
||||||
loop_state.counter, "");
|
loop_state.counter, "");
|
||||||
|
|
@ -1141,25 +1142,12 @@ static void emit_atomic_global(struct lp_build_nir_context *bld_base,
|
||||||
LLVMAtomicOrderingSequentiallyConsistent,
|
LLVMAtomicOrderingSequentiallyConsistent,
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
temp_res = LLVMBuildLoad2(builder, LLVMTypeOf(val), atom_res, "");
|
temp_res = LLVMBuildLoad2(builder, atom_bld->vec_type, atom_res, "");
|
||||||
temp_res = LLVMBuildInsertElement(builder, temp_res, scalar, loop_state.counter, "");
|
temp_res = LLVMBuildInsertElement(builder, temp_res, scalar, loop_state.counter, "");
|
||||||
LLVMBuildStore(builder, temp_res, atom_res);
|
LLVMBuildStore(builder, temp_res, atom_res);
|
||||||
lp_build_else(&ifthen);
|
lp_build_else(&ifthen);
|
||||||
temp_res = LLVMBuildLoad2(builder, LLVMTypeOf(val), atom_res, "");
|
temp_res = LLVMBuildLoad2(builder, atom_bld->vec_type, atom_res, "");
|
||||||
bool is_float = LLVMTypeOf(val) == bld_base->base.vec_type;
|
LLVMValueRef zero_val = lp_build_zero_bits(gallivm, val_bit_size, is_flt);
|
||||||
LLVMValueRef zero_val;
|
|
||||||
if (is_float) {
|
|
||||||
if (val_bit_size == 64)
|
|
||||||
zero_val = lp_build_const_double(gallivm, 0);
|
|
||||||
else
|
|
||||||
zero_val = lp_build_const_float(gallivm, 0);
|
|
||||||
} else {
|
|
||||||
if (val_bit_size == 64)
|
|
||||||
zero_val = lp_build_const_int64(gallivm, 0);
|
|
||||||
else
|
|
||||||
zero_val = lp_build_const_int32(gallivm, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
temp_res = LLVMBuildInsertElement(builder, temp_res, zero_val, loop_state.counter, "");
|
temp_res = LLVMBuildInsertElement(builder, temp_res, zero_val, loop_state.counter, "");
|
||||||
LLVMBuildStore(builder, temp_res, atom_res);
|
LLVMBuildStore(builder, temp_res, atom_res);
|
||||||
lp_build_endif(&ifthen);
|
lp_build_endif(&ifthen);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue