mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-27 23:47:03 +02:00
[shader_env] add termination detection for MESA nv50_ir like homebrews
This commit is contained in:
parent
8aff934778
commit
f9af788554
1 changed files with 6 additions and 0 deletions
|
|
@ -254,6 +254,9 @@ std::optional<u64> GenericEnvironment::TryFindSize() {
|
|||
static constexpr u64 SELF_BRANCH_A = 0xE2400FFFFF87000FULL;
|
||||
static constexpr u64 SELF_BRANCH_B = 0xE2400FFFFF07000FULL;
|
||||
|
||||
static constexpr u64 MESA_EXIT_MASK = 0xFFF00000000F001FULL;
|
||||
static constexpr u64 MESA_EXIT_VALUE = (0xE30ULL << 52) | (0x7ULL << 16) | 0xFULL;
|
||||
|
||||
GPUVAddr guest_addr{program_base + start_address};
|
||||
size_t offset{0};
|
||||
size_t size{BLOCK_SIZE};
|
||||
|
|
@ -266,6 +269,9 @@ std::optional<u64> GenericEnvironment::TryFindSize() {
|
|||
if (inst == SELF_BRANCH_A || inst == SELF_BRANCH_B) {
|
||||
return offset + index;
|
||||
}
|
||||
if ((inst & MESA_EXIT_MASK) == MESA_EXIT_VALUE) {
|
||||
return offset + index + INST_SIZE;
|
||||
}
|
||||
}
|
||||
guest_addr += BLOCK_SIZE;
|
||||
size += BLOCK_SIZE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue