mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2024-11-27 03:44:23 +01:00
gl_shader_decompiler: Improve generated code in HMergeH*
Avoiding bitwise expressions, this fixes Turing issues in shaders using half float merges that affected several games.
This commit is contained in:
parent
75e39f7f88
commit
75eb953575
@ -1819,15 +1819,17 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Expression HMergeH0(Operation operation) {
|
Expression HMergeH0(Operation operation) {
|
||||||
std::string dest = VisitOperand(operation, 0).AsUint();
|
const std::string dest = VisitOperand(operation, 0).AsUint();
|
||||||
std::string src = VisitOperand(operation, 1).AsUint();
|
const std::string src = VisitOperand(operation, 1).AsUint();
|
||||||
return {fmt::format("(({} & 0x0000FFFFU) | ({} & 0xFFFF0000U))", src, dest), Type::Uint};
|
return {fmt::format("vec2(unpackHalf2x16({}).x, unpackHalf2x16({}).y)", src, dest),
|
||||||
|
Type::HalfFloat};
|
||||||
}
|
}
|
||||||
|
|
||||||
Expression HMergeH1(Operation operation) {
|
Expression HMergeH1(Operation operation) {
|
||||||
std::string dest = VisitOperand(operation, 0).AsUint();
|
const std::string dest = VisitOperand(operation, 0).AsUint();
|
||||||
std::string src = VisitOperand(operation, 1).AsUint();
|
const std::string src = VisitOperand(operation, 1).AsUint();
|
||||||
return {fmt::format("(({} & 0x0000FFFFU) | ({} & 0xFFFF0000U))", dest, src), Type::Uint};
|
return {fmt::format("vec2(unpackHalf2x16({}).x, unpackHalf2x16({}).y)", dest, src),
|
||||||
|
Type::HalfFloat};
|
||||||
}
|
}
|
||||||
|
|
||||||
Expression HPack2(Operation operation) {
|
Expression HPack2(Operation operation) {
|
||||||
|
Loading…
Reference in New Issue
Block a user