mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-29 23:41:19 -06:00
Recompiler: Use num_records to check if an inline buffer exists (#4323)
* Change buffer check to use num_records instead * Fix the address fixup check Since base_address == 0 is possible, this should specifically check against 1 (which we reserve for null buffers). Kinda shocked TLOU/Uncharted worked at all without setting this.
This commit is contained in:
parent
a762f70df3
commit
e33a185423
@ -506,7 +506,7 @@ void PatchBufferSharp(IR::Block& block, IR::Inst& inst, Info& info, Descriptors&
|
||||
// is used to define an inline buffer resource
|
||||
std::array<u64, 2> raw;
|
||||
// Keep relative address, we'll do fixup of the address at buffer fetch later
|
||||
raw[0] = (handle->Arg(0).U32() | u64(handle->Arg(1).U32()) << 32);
|
||||
raw[0] = handle->Arg(0).U32() | u64(handle->Arg(1).U32()) << 32;
|
||||
raw[1] = handle->Arg(2).U32() | u64(handle->Arg(3).U32()) << 32;
|
||||
const auto buffer = std::bit_cast<AmdGpu::Buffer>(raw);
|
||||
buffer_binding = descriptors.Add(BufferResource{
|
||||
|
||||
@ -56,7 +56,7 @@ struct BufferResource {
|
||||
AmdGpu::Buffer buffer{};
|
||||
if (inline_cbuf) {
|
||||
buffer = inline_cbuf;
|
||||
if (inline_cbuf.base_address > 1) {
|
||||
if (inline_cbuf.base_address != 1) {
|
||||
buffer.base_address += info.pgm_base; // address fixup
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -49,7 +49,7 @@ struct Buffer {
|
||||
}
|
||||
|
||||
operator bool() const noexcept {
|
||||
return base_address != 0;
|
||||
return num_records != 0;
|
||||
}
|
||||
|
||||
bool operator==(const Buffer& other) const noexcept {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user