mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 16:23:05 +00:00
shader: canonicalize out-of-range image formats
This commit is contained in:
1 parent
b77978fd1e
commit
a9166f8546
1 file changed
+2
-1
@@ -61,7 +61,8 @@ bool NullImageDescriptor(const DescriptorValue& descriptor) {
|
|||||||
bool ValidImageDescriptor(const DescriptorValue& descriptor, bool r128 = false) {
|
bool ValidImageDescriptor(const DescriptorValue& descriptor, bool r128 = false) {
|
||||||
const auto type = static_cast<Prospero::ImageType>((descriptor.dwords[3] >> 28u) & 0xfu);
|
const auto type = static_cast<Prospero::ImageType>((descriptor.dwords[3] >> 28u) & 0xfu);
|
||||||
const auto format = static_cast<Prospero::BufferFormat>((descriptor.dwords[1] >> 20u) & 0x1ffu);
|
const auto format = static_cast<Prospero::BufferFormat>((descriptor.dwords[1] >> 20u) & 0x1ffu);
|
||||||
if (type < Prospero::ImageType::kColor1D || format == Prospero::BufferFormat::kInvalid) {
|
if (type < Prospero::ImageType::kColor1D || format == Prospero::BufferFormat::kInvalid ||
|
||||||
|
format > Prospero::BufferFormat::kBc7Srgb) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (r128 && type != Prospero::ImageType::kColor1D && type != Prospero::ImageType::kColor2D &&
|
if (r128 && type != Prospero::ImageType::kColor1D && type != Prospero::ImageType::kColor2D &&
|
||||||
|
|||||||
Reference in new issue
Block a user