mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-22 02:57:52 -05:00
shader_ir/decode: Fix half float pre-operations and remove MetaHalfArithmetic
Operations done before the main half float operation (like HAdd) were managing a packed value instead of the unpacked one. Adding an unpacked operation allows us to drop the per-operand MetaHalfArithmetic entry, simplifying the code overall.
This commit is contained in:
@ -76,14 +76,10 @@ constexpr u32 GetGenericAttributeLocation(Attribute::Index attribute) {
|
||||
|
||||
/// Returns true if an object has to be treated as precise
|
||||
bool IsPrecise(Operation operand) {
|
||||
const auto& meta = operand.GetMeta();
|
||||
|
||||
const auto& meta{operand.GetMeta()};
|
||||
if (std::holds_alternative<MetaArithmetic>(meta)) {
|
||||
return std::get<MetaArithmetic>(meta).precise;
|
||||
}
|
||||
if (std::holds_alternative<MetaHalfArithmetic>(meta)) {
|
||||
return std::get<MetaHalfArithmetic>(meta).precise;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -749,6 +745,11 @@ private:
|
||||
return {};
|
||||
}
|
||||
|
||||
Id HUnpack(Operation operation) {
|
||||
UNIMPLEMENTED();
|
||||
return {};
|
||||
}
|
||||
|
||||
Id HMergeF32(Operation operation) {
|
||||
UNIMPLEMENTED();
|
||||
return {};
|
||||
@ -1222,6 +1223,7 @@ private:
|
||||
&SPIRVDecompiler::Unary<&Module::OpFAbs, Type::HalfFloat>,
|
||||
&SPIRVDecompiler::HNegate,
|
||||
&SPIRVDecompiler::HClamp,
|
||||
&SPIRVDecompiler::HUnpack,
|
||||
&SPIRVDecompiler::HMergeF32,
|
||||
&SPIRVDecompiler::HMergeH0,
|
||||
&SPIRVDecompiler::HMergeH1,
|
||||
|
Reference in New Issue
Block a user