From cfb3db1a32975583b94a0df5f3ff0020254208c0 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Tue, 25 Jun 2019 20:56:04 -0400 Subject: shader_ir: Correct max sizing --- src/video_core/shader/control_flow.cpp | 2 +- src/video_core/shader/decode.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/video_core/shader') diff --git a/src/video_core/shader/control_flow.cpp b/src/video_core/shader/control_flow.cpp index 6259ad594..a26de6795 100644 --- a/src/video_core/shader/control_flow.cpp +++ b/src/video_core/shader/control_flow.cpp @@ -163,7 +163,7 @@ enum class ParseResult : u32 { ParseResult ParseCode(CFGRebuildState& state, u32 address, ParseInfo& parse_info) { u32 offset = static_cast(address); - const u32 end_address = static_cast(state.program_size - 10U) * 8U; + const u32 end_address = static_cast(state.program_size / 8U); const auto insert_label = ([](CFGRebuildState& state, u32 address) { auto pair = state.labels.emplace(address); diff --git a/src/video_core/shader/decode.cpp b/src/video_core/shader/decode.cpp index 15cb33bbf..b0bd6630f 100644 --- a/src/video_core/shader/decode.cpp +++ b/src/video_core/shader/decode.cpp @@ -39,7 +39,7 @@ void ShaderIR::Decode() { std::memcpy(&header, program_code.data(), sizeof(Tegra::Shader::Header)); disable_flow_stack = false; - const auto info = ScanFlow(program_code, program_code.size(), main_offset); + const auto info = ScanFlow(program_code, program_size, main_offset); if (info) { const auto& shader_info = *info; coverage_begin = shader_info.start; -- cgit v1.2.3