video_core/amdgpu: heuristic for shader binary info

Games can strip the first shader instruction (meant for debugging) which we rely on for obtaining shader information (e.g. LittleBigPlanet 3). For this reason, we start a search through the code start until we arrive at the shader binary info.
This commit is contained in:
Daniel R. 2024-11-21 19:24:13 +01:00
parent 2a0629477b
commit e968b1c23f
No known key found for this signature in database
GPG key ID: B8ADC8F57BA18DBA
3 changed files with 37 additions and 13 deletions

View file

@ -32,7 +32,9 @@ IR::Program TranslateProgram(std::span<const u32> code, Pools& pools, Info& info
const RuntimeInfo& runtime_info, const Profile& profile) {
// Ensure first instruction is expected.
constexpr u32 token_mov_vcchi = 0xBEEB03FF;
ASSERT_MSG(code[0] == token_mov_vcchi, "First instruction is not s_mov_b32 vcc_hi, #imm");
if (code[0] != token_mov_vcchi) {
LOG_WARNING(Render_Recompiler, "First instruction is not s_mov_b32 vcc_hi, #imm");
}
Gcn::GcnCodeSlice slice(code.data(), code.data() + code.size());
Gcn::GcnDecodeContext decoder;