mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-26 12:26:18 +00:00
Handle R128 bit in MIMG instructions (#3010)
This commit is contained in:
parent
8fffdc3918
commit
2091bc5651
5 changed files with 15 additions and 2 deletions
|
@ -84,6 +84,7 @@ struct ImageResource {
|
|||
bool is_atomic{};
|
||||
bool is_array{};
|
||||
bool is_written{};
|
||||
bool is_r128{};
|
||||
|
||||
[[nodiscard]] constexpr AmdGpu::Image GetSharp(const Info& info) const noexcept;
|
||||
};
|
||||
|
@ -293,7 +294,13 @@ constexpr AmdGpu::Buffer BufferResource::GetSharp(const Info& info) const noexce
|
|||
}
|
||||
|
||||
constexpr AmdGpu::Image ImageResource::GetSharp(const Info& info) const noexcept {
|
||||
const auto image = info.ReadUdSharp<AmdGpu::Image>(sharp_idx);
|
||||
AmdGpu::Image image{0};
|
||||
if (!is_r128) {
|
||||
image = info.ReadUdSharp<AmdGpu::Image>(sharp_idx);
|
||||
} else {
|
||||
AmdGpu::Buffer buf = info.ReadUdSharp<AmdGpu::Buffer>(sharp_idx);
|
||||
memcpy(&image, &buf, sizeof(buf));
|
||||
}
|
||||
if (!image.Valid()) {
|
||||
// Fall back to null image if unbound.
|
||||
return AmdGpu::Image::Null();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue