mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 05:28:56 +02:00
fix
This commit is contained in:
parent
3299e61653
commit
17b75e7a94
1 changed files with 3 additions and 7 deletions
|
|
@ -142,16 +142,12 @@ Id GetCbuf(EmitContext& ctx, Id result_type, Id UniformDefinitions::*member_ptr,
|
|||
|
||||
const auto is_float = UniformDefinitions::IsFloat(member_ptr);
|
||||
const auto num_elements = UniformDefinitions::NumElements(member_ptr);
|
||||
const std::array zero_vec{
|
||||
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),
|
||||
is_float ? ctx.Const(0.0f) : ctx.Const(0u),
|
||||
};
|
||||
auto const zero_const = is_float ? ctx.Const(0.0f) : ctx.Const(0u);
|
||||
const std::array zero_vec{zero_const, zero_const, zero_const, zero_const};
|
||||
const Id cond = ctx.OpULessThanEqual(ctx.TypeBool(), buffer_offset, ctx.Const(0xFFFFu));
|
||||
const Id zero = num_elements > 1
|
||||
? ctx.OpCompositeConstruct(result_type, std::span(zero_vec.data(), num_elements))
|
||||
: (is_float ? ctx.Const(0.0f) : ctx.Const(0u));
|
||||
: zero_const;
|
||||
return ctx.OpSelect(result_type, cond, val, zero);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue