mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-30 08:49:00 +02:00
[Revert] Adjusted Track function for bias handling and alignment checks for storage buffers
This commit is contained in:
parent
885fc2746c
commit
ca3fed6182
1 changed files with 7 additions and 12 deletions
|
|
@ -354,21 +354,16 @@ std::optional<StorageBufferAddr> Track(const IR::Value& value, const Bias* bias)
|
||||||
.index = index.U32(),
|
.index = index.U32(),
|
||||||
.offset = offset.U32(),
|
.offset = offset.U32(),
|
||||||
};
|
};
|
||||||
if (bias) {
|
const u32 alignment{bias ? bias->alignment : 16U};
|
||||||
if (!MeetsBias(storage_buffer, *bias)) {
|
if (!Common::IsAligned(storage_buffer.offset, alignment)) {
|
||||||
// We have to blacklist some addresses in case we wrongly
|
|
||||||
// point to them
|
|
||||||
return std::nullopt;
|
|
||||||
}
|
|
||||||
const u32 relative_offset{storage_buffer.offset - bias->offset_begin};
|
|
||||||
if (!Common::IsAligned(relative_offset, bias->alignment)) {
|
|
||||||
// NVN descriptors are tightly packed but the range base is biased
|
|
||||||
return std::nullopt;
|
|
||||||
}
|
|
||||||
} else if (!Common::IsAligned(storage_buffer.offset, 16U)) {
|
|
||||||
// The SSBO pointer has to be aligned
|
// The SSBO pointer has to be aligned
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
if (bias && !MeetsBias(storage_buffer, *bias)) {
|
||||||
|
// We have to blacklist some addresses in case we wrongly
|
||||||
|
// point to them
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
return storage_buffer;
|
return storage_buffer;
|
||||||
}};
|
}};
|
||||||
return BreadthFirstSearch(value, pred);
|
return BreadthFirstSearch(value, pred);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue