mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 08:13:05 +00:00
shader: share packed color component encoding
This commit is contained in:
1 parent
87d938139d
commit
fb213e8ae5
3 files changed
+21
-10
No files matched your search
@@ -642,19 +642,13 @@ uint32_t StoreTexel(ValueEmitContext& ctx, const IR::MemoryInfo& mem, uint32_t d
|
||||
}
|
||||
if (converted) {
|
||||
if (!selected) continue;
|
||||
auto value = EncodeFormattedStoreComponent(ctx.state, info, component, raw, mem.data_bits);
|
||||
if (!packed) {
|
||||
values[component] = value;
|
||||
values[component] =
|
||||
EncodeFormattedStoreComponent(ctx.state, info, component, raw, mem.data_bits);
|
||||
continue;
|
||||
}
|
||||
if (info.type == Format::ComponentType::Uint) {
|
||||
value = EmitUMin32(ctx.state, value,
|
||||
ConstantU32(ctx.state, (1u << info.component_bits[component]) - 1u));
|
||||
}
|
||||
if (info.component_bit_offset[component] != 0u) {
|
||||
value = Binary(ctx.state, spv::OpShiftLeftLogical, TypeU32(ctx.state), value,
|
||||
ConstantU32(ctx.state, info.component_bit_offset[component]));
|
||||
}
|
||||
const auto value =
|
||||
EncodePackedColorComponent(ctx.state, info, component, raw, mem.data_bits);
|
||||
packed_value = packed_value == zero ? value
|
||||
: Binary(ctx.state, spv::OpBitwiseOr, TypeU32(ctx.state), packed_value, value);
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user