mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-07 01:26:20 +00:00
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:
parent
028be3ba5d
commit
722a0e36be
6 changed files with 66 additions and 49 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue