mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 05:46:56 +01:00
graphics: share signed storage conversion and support R16 image writes
Co-authored-by: fxpw <fxpw@outlook.com>
This commit is contained in:
@@ -169,6 +169,17 @@ struct ImageResource {
|
||||
bool operator==(const ImageResource& other) const = default;
|
||||
};
|
||||
|
||||
[[nodiscard]] constexpr Prospero::BufferFormat
|
||||
RawSignedStorageFormat(const ImageResource& image, Prospero::BufferFormat format) {
|
||||
if (image.resource_class != ImageResourceClass::Storage || !image.written)
|
||||
return Prospero::BufferFormat::kInvalid;
|
||||
if (format == Prospero::BufferFormat::k32SInt && (image.atomic ? !image.atomic64 : !image.read))
|
||||
return Prospero::BufferFormat::k32UInt;
|
||||
if (format == Prospero::BufferFormat::k16SInt && !image.read && !image.atomic)
|
||||
return Prospero::BufferFormat::k16UInt;
|
||||
return Prospero::BufferFormat::kInvalid;
|
||||
}
|
||||
|
||||
struct SamplerResource {
|
||||
uint32_t source = 0;
|
||||
uint32_t first_use_pc = 0;
|
||||
|
||||
Reference in New Issue
Block a user