mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 22:06:59 +01:00
Presenter: avoid lock
This commit is contained in:
@@ -171,6 +171,13 @@ void Presenter::Frame::Configure(GraphicContext& graphics, vk::Extent2D extent,
|
|||||||
EXIT("unsupported prepared frame, extent=%ux%u format=%d\n", extent.width, extent.height,
|
EXIT("unsupported prepared frame, extent=%ux%u format=%d\n", extent.width, extent.height,
|
||||||
static_cast<int>(format));
|
static_cast<int>(format));
|
||||||
}
|
}
|
||||||
|
auto& dst = image;
|
||||||
|
const bool compatible = dst.image != nullptr && dst.extent.width == extent.width &&
|
||||||
|
dst.extent.height == extent.height && dst.format == format;
|
||||||
|
if (compatible) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto features = graphics.GetFormatProperties(format).optimalTilingFeatures;
|
const auto features = graphics.GetFormatProperties(format).optimalTilingFeatures;
|
||||||
const auto required =
|
const auto required =
|
||||||
vk::FormatFeatureFlagBits::eBlitSrc | vk::FormatFeatureFlagBits::eSampledImageFilterLinear |
|
vk::FormatFeatureFlagBits::eBlitSrc | vk::FormatFeatureFlagBits::eSampledImageFilterLinear |
|
||||||
@@ -180,12 +187,6 @@ void Presenter::Frame::Configure(GraphicContext& graphics, vk::Extent2D extent,
|
|||||||
static_cast<int>(format), static_cast<vk::FormatFeatureFlags::MaskType>(features));
|
static_cast<int>(format), static_cast<vk::FormatFeatureFlags::MaskType>(features));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& dst = image;
|
|
||||||
const bool compatible = dst.image != nullptr && dst.extent.width == extent.width &&
|
|
||||||
dst.extent.height == extent.height && dst.format == format;
|
|
||||||
if (compatible) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (dst.image != nullptr) {
|
if (dst.image != nullptr) {
|
||||||
graphics.DeleteImage(dst);
|
graphics.DeleteImage(dst);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user