mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-15 22:54:00 +00:00
gl_shader_decompiler: Implement merges with bitfieldInsert
This also fixes Turing issues but it avoids doing more bitcasts. This should improve the generated code while also avoiding more points where compilers can flush floats.
This commit is contained in:
parent
75eb953575
commit
05cf270836
1 changed files with 2 additions and 4 deletions
|
@ -1821,15 +1821,13 @@ private:
|
||||||
Expression HMergeH0(Operation operation) {
|
Expression HMergeH0(Operation operation) {
|
||||||
const std::string dest = VisitOperand(operation, 0).AsUint();
|
const std::string dest = VisitOperand(operation, 0).AsUint();
|
||||||
const std::string src = VisitOperand(operation, 1).AsUint();
|
const std::string src = VisitOperand(operation, 1).AsUint();
|
||||||
return {fmt::format("vec2(unpackHalf2x16({}).x, unpackHalf2x16({}).y)", src, dest),
|
return {fmt::format("bitfieldInsert({}, {}, 0, 16)", dest, src), Type::Uint};
|
||||||
Type::HalfFloat};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Expression HMergeH1(Operation operation) {
|
Expression HMergeH1(Operation operation) {
|
||||||
const std::string dest = VisitOperand(operation, 0).AsUint();
|
const std::string dest = VisitOperand(operation, 0).AsUint();
|
||||||
const std::string src = VisitOperand(operation, 1).AsUint();
|
const std::string src = VisitOperand(operation, 1).AsUint();
|
||||||
return {fmt::format("vec2(unpackHalf2x16({}).x, unpackHalf2x16({}).y)", dest, src),
|
return {fmt::format("bitfieldInsert({}, {}, 16, 16)", dest, src), Type::Uint};
|
||||||
Type::HalfFloat};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Expression HPack2(Operation operation) {
|
Expression HPack2(Operation operation) {
|
||||||
|
|
Loading…
Reference in a new issue