mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
ac/llvm: fix 16bit varying llvm compile error
Found when 16bit vec3 varying with llvm14 (not found when llvm15), one 32bit vec4 slot is filled like this: vec3[0] | undef vec3[1] | undef vec3[2] | undef undef | undef LLVM error is for the elements with undef: %287 = insertelement float %280, half %279, i64 0 After this change, we get: %287 = insertelement <2 x half> %280, half %279, i64 0 Fixes:279eea5bda("amd/llvm: Transition to LLVM "opaque pointers"") Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19848> (cherry picked from commite3b1f26a2b)
This commit is contained in:
parent
cba4b07aa0
commit
9fdfe7751c
2 changed files with 10 additions and 1 deletions
|
|
@ -265,7 +265,7 @@
|
|||
"description": "ac/llvm: fix 16bit varying llvm compile error",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "279eea5bda2444fdce21744b972dad5016f0f366"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2410,7 +2410,16 @@ static void visit_store_output(struct ac_nir_context *ctx, nir_intrinsic_instr *
|
|||
* using read-modify-write.
|
||||
*/
|
||||
index = LLVMConstInt(ctx->ac.i32, nir_intrinsic_io_semantics(instr).high_16bits, 0);
|
||||
|
||||
#if LLVM_VERSION_MAJOR <= 14
|
||||
/* To work around old LLVM bug which won't change the output type to
|
||||
* LLVMBuildLoad2 type argument.
|
||||
*/
|
||||
output = LLVMBuildLoad2(ctx->ac.builder, ctx->ac.f32, output_addr, "");
|
||||
output = LLVMBuildBitCast(ctx->ac.builder, output, ctx->ac.v2f16, "");
|
||||
#else
|
||||
output = LLVMBuildLoad2(ctx->ac.builder, ctx->ac.v2f16, output_addr, "");
|
||||
#endif
|
||||
output = LLVMBuildInsertElement(ctx->ac.builder, output, value, index, "");
|
||||
value = LLVMBuildBitCast(ctx->ac.builder, output, ctx->ac.f32, "");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue