graphics: Improve handling of color buffer and storage image swizzles (#1763)

* liverpool_to_vk: Remove wrong component swap formats

* shader_recompiler: Handle storage and buffer format swizzles

* shader_recompiler: Skip unsupported depth export

* image_view: Remove image format swizzle

* Platform support is not always guaranteed
This commit is contained in:
TheTurtle 2024-12-13 21:49:37 +02:00 committed by GitHub
parent 028be3ba5d
commit 722a0e36be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 66 additions and 49 deletions

View file

@ -31,6 +31,7 @@ struct BufferSpecialization {
struct TextureBufferSpecialization {
bool is_integer = false;
u32 dst_select = 0;
auto operator<=>(const TextureBufferSpecialization&) const = default;
};
@ -38,8 +39,12 @@ struct TextureBufferSpecialization {
struct ImageSpecialization {
AmdGpu::ImageType type = AmdGpu::ImageType::Color2D;
bool is_integer = false;
u32 dst_select = 0;
auto operator<=>(const ImageSpecialization&) const = default;
bool operator==(const ImageSpecialization& other) const {
return type == other.type && is_integer == other.is_integer &&
(dst_select != 0 ? dst_select == other.dst_select : true);
}
};
struct FMaskSpecialization {
@ -103,11 +108,15 @@ struct StageSpecialization {
ForEachSharp(binding, tex_buffers, info->texture_buffers,
[](auto& spec, const auto& desc, AmdGpu::Buffer sharp) {
spec.is_integer = AmdGpu::IsInteger(sharp.GetNumberFmt());
spec.dst_select = sharp.DstSelect();
});
ForEachSharp(binding, images, info->images,
[](auto& spec, const auto& desc, AmdGpu::Image sharp) {
spec.type = sharp.GetBoundType();
spec.is_integer = AmdGpu::IsInteger(sharp.GetNumberFmt());
if (desc.is_storage) {
spec.dst_select = sharp.DstSelect();
}
});
ForEachSharp(binding, fmasks, info->fmasks,
[](auto& spec, const auto& desc, AmdGpu::Image sharp) {