summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/decode.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-09-25 04:34:18 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-10-25 15:01:31 +0200
commit7b81ba4d8a9805f808fcc60a0905ac74d293b2ee (patch)
tree7bf80df3851e7d0e25746d241cbb0e09ba5c6b33 /src/video_core/shader/decode.cpp
parentShader_IR: Implement Fast BRX and allow multi-branches in the CFG. (diff)
downloadyuzu-7b81ba4d8a9805f808fcc60a0905ac74d293b2ee.tar
yuzu-7b81ba4d8a9805f808fcc60a0905ac74d293b2ee.tar.gz
yuzu-7b81ba4d8a9805f808fcc60a0905ac74d293b2ee.tar.bz2
yuzu-7b81ba4d8a9805f808fcc60a0905ac74d293b2ee.tar.lz
yuzu-7b81ba4d8a9805f808fcc60a0905ac74d293b2ee.tar.xz
yuzu-7b81ba4d8a9805f808fcc60a0905ac74d293b2ee.tar.zst
yuzu-7b81ba4d8a9805f808fcc60a0905ac74d293b2ee.zip
Diffstat (limited to 'src/video_core/shader/decode.cpp')
-rw-r--r--src/video_core/shader/decode.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/video_core/shader/decode.cpp b/src/video_core/shader/decode.cpp
index 053241128..e1afa4582 100644
--- a/src/video_core/shader/decode.cpp
+++ b/src/video_core/shader/decode.cpp
@@ -33,7 +33,7 @@ constexpr bool IsSchedInstruction(u32 offset, u32 main_offset) {
return (absolute_offset % SchedPeriod) == 0;
}
-} // namespace
+} // Anonymous namespace
class ASTDecoder {
public:
@@ -102,7 +102,7 @@ void ShaderIR::Decode() {
std::memcpy(&header, program_code.data(), sizeof(Tegra::Shader::Header));
decompiled = false;
- auto info = ScanFlow(program_code, program_size, main_offset, settings, locker);
+ auto info = ScanFlow(program_code, main_offset, settings, locker);
auto& shader_info = *info;
coverage_begin = shader_info.start;
coverage_end = shader_info.end;
@@ -155,7 +155,7 @@ void ShaderIR::Decode() {
[[fallthrough]];
case CompileDepth::BruteForce: {
coverage_begin = main_offset;
- const u32 shader_end = static_cast<u32>(program_size / sizeof(u64));
+ const u32 shader_end = program_code.size();
coverage_end = shader_end;
for (u32 label = main_offset; label < shader_end; label++) {
basic_blocks.insert({label, DecodeRange(label, label + 1)});
@@ -225,7 +225,8 @@ void ShaderIR::InsertControlFlow(NodeBlock& bb, const ShaderBlock& block) {
for (auto& branch_case : multi_branch->branches) {
Node n = Operation(OperationCode::Branch, Immediate(branch_case.address));
Node op_b = Immediate(branch_case.cmp_value);
- Node condition = GetPredicateComparisonInteger(Tegra::Shader::PredCondition::Equal, false, op_a, op_b);
+ Node condition =
+ GetPredicateComparisonInteger(Tegra::Shader::PredCondition::Equal, false, op_a, op_b);
auto result = Conditional(condition, {n});
bb.push_back(result);
global_code.push_back(result);