[shader_recompiler] fix CBuf get/set VUUID due to using composite for U32[1], F32[1] (#3790)
Some checks are pending
tx-src / sources (push) Waiting to run
Check Strings / check-strings (push) Waiting to run

Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3790
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie 2026-03-29 01:59:45 +01:00 committed by crueter
parent b473c18d6e
commit 9a3af3a6a3
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6

View file

@ -142,14 +142,12 @@ Id GetCbuf(EmitContext& ctx, Id result_type, Id UniformDefinitions::*member_ptr,
const auto is_float = UniformDefinitions::IsFloat(member_ptr); const auto is_float = UniformDefinitions::IsFloat(member_ptr);
const auto num_elements = UniformDefinitions::NumElements(member_ptr); const auto num_elements = UniformDefinitions::NumElements(member_ptr);
const std::array zero_vec{ auto const zero_const = is_float ? ctx.Const(0.0f) : ctx.Const(0u);
is_float ? ctx.Const(0.0f) : ctx.Const(0u), const std::array zero_vec{zero_const, zero_const, zero_const, zero_const};
is_float ? ctx.Const(0.0f) : ctx.Const(0u),
is_float ? ctx.Const(0.0f) : ctx.Const(0u),
is_float ? ctx.Const(0.0f) : ctx.Const(0u),
};
const Id cond = ctx.OpULessThanEqual(ctx.TypeBool(), buffer_offset, ctx.Const(0xFFFFu)); const Id cond = ctx.OpULessThanEqual(ctx.TypeBool(), buffer_offset, ctx.Const(0xFFFFu));
const Id zero = ctx.OpCompositeConstruct(result_type, std::span(zero_vec.data(), num_elements)); const Id zero = num_elements > 1
? ctx.OpCompositeConstruct(result_type, std::span(zero_vec.data(), num_elements))
: zero_const;
return ctx.OpSelect(result_type, cond, val, zero); return ctx.OpSelect(result_type, cond, val, zero);
} }