mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 10:56:58 +02:00
shader: fix constant types in converted image gathers
This commit is contained in:
@@ -471,9 +471,13 @@ uint32_t UnpackImageGather(ValueEmitContext& ctx, const IR::MemoryInfo& mem, uin
|
||||
const auto numeric_class = ctx.state.program.info.images[mem.resource].numeric_class;
|
||||
const auto vector_type = ImageVectorType(ctx.state, numeric_class, 4);
|
||||
if (selector < 4u) {
|
||||
const auto value = info.packed_bitfield
|
||||
? ConstantU32(ctx.state, selector == 1u ? 1u : 0u)
|
||||
: ConstantF32Value(ctx.state, selector == 1u ? 1.0f : 0.0f);
|
||||
uint32_t value;
|
||||
switch (info.type) {
|
||||
case Format::ComponentType::Uscaled:
|
||||
value = ConstantF32Value(ctx.state, selector == 1u ? 1.0f : 0.0f);
|
||||
break;
|
||||
default: value = ConstantU32(ctx.state, selector == 1u ? 1u : 0u); break;
|
||||
}
|
||||
return ctx.state.builder.Constant(spv::OpConstantComposite, vector_type, value, value,
|
||||
value, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user