mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 19:07:01 +02:00
renderer: keep color image aliases storage-capable
Create single-sample color backings with storage usage under extended usage so compatible storage views remain legal. This fixes alternating black frames when an A2R video-out image is later reused through an A2B storage view.
This commit is contained in:
@@ -59,16 +59,8 @@ namespace {
|
|||||||
if (HasFormatFeature(properties, vk::FormatFeatureFlagBits::eColorAttachment)) {
|
if (HasFormatFeature(properties, vk::FormatFeatureFlagBits::eColorAttachment)) {
|
||||||
usage |= vk::ImageUsageFlagBits::eColorAttachment;
|
usage |= vk::ImageUsageFlagBits::eColorAttachment;
|
||||||
}
|
}
|
||||||
if (info.samples == 1 &&
|
if (info.samples == 1) {
|
||||||
HasFormatFeature(properties, vk::FormatFeatureFlagBits::eStorageImage)) {
|
|
||||||
usage |= vk::ImageUsageFlagBits::eStorage;
|
usage |= vk::ImageUsageFlagBits::eStorage;
|
||||||
} else if (info.samples == 1) {
|
|
||||||
const auto compatible = SrgbStorageViewFormat(info.pixel_format);
|
|
||||||
if (compatible != vk::Format::eUndefined &&
|
|
||||||
HasFormatFeature(graphics.GetFormatProperties(compatible),
|
|
||||||
vk::FormatFeatureFlagBits::eStorageImage)) {
|
|
||||||
usage |= vk::ImageUsageFlagBits::eStorage;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return usage;
|
return usage;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2950,6 +2950,28 @@ public:
|
|||||||
"dynamic view identity omitted mapping, format, mip, layer, type, "
|
"dynamic view identity omitted mapping, format, mip, layer, type, "
|
||||||
"or storage usage");
|
"or storage usage");
|
||||||
|
|
||||||
|
auto video_out_info = color_info;
|
||||||
|
video_out_info.pixel_format = vk::Format::eA2R10G10B10UnormPack32;
|
||||||
|
video_out_info.guest_format = Prospero::BufferFormat::k10_10_10_2UNorm;
|
||||||
|
Libs::Graphics::Image video_out(m_runtime_context, scheduler,
|
||||||
|
video_out_info);
|
||||||
|
auto video_out_view_info = sampled;
|
||||||
|
video_out_view_info.format = video_out_info.pixel_format;
|
||||||
|
video_out_view_info.usage = vk::ImageUsageFlagBits::eTransferSrc;
|
||||||
|
const auto video_out_view = video_out.FindView(video_out_view_info);
|
||||||
|
auto storage_alias_info = video_out_view_info;
|
||||||
|
storage_alias_info.format = vk::Format::eA2B10G10R10UnormPack32;
|
||||||
|
storage_alias_info.usage = vk::ImageUsageFlagBits::eStorage;
|
||||||
|
const auto storage_alias_view = video_out.FindView(storage_alias_info);
|
||||||
|
Require(
|
||||||
|
name, "video-out storage alias usage",
|
||||||
|
ImageViewOps::FormatsCompatible(video_out_info.pixel_format,
|
||||||
|
storage_alias_info.format) &&
|
||||||
|
static_cast<bool>(video_out.backing.usage &
|
||||||
|
vk::ImageUsageFlagBits::eStorage) &&
|
||||||
|
video_out_view != nullptr && storage_alias_view != nullptr,
|
||||||
|
"compatible video-out backing was created without storage usage");
|
||||||
|
|
||||||
ImageInfo depth_info{};
|
ImageInfo depth_info{};
|
||||||
depth_info.pixel_format = vk::Format::eD32Sfloat;
|
depth_info.pixel_format = vk::Format::eD32Sfloat;
|
||||||
depth_info.guest_format = Prospero::BufferFormat::k32Float;
|
depth_info.guest_format = Prospero::BufferFormat::k32Float;
|
||||||
|
|||||||
Reference in New Issue
Block a user