1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-11 10:24:10 +01:00

[dxvk] Ensure image compatibility for packed depth-stencil copies

This commit is contained in:
Philip Rebohle 2024-09-28 22:45:15 +02:00 committed by Philip Rebohle
parent 56a07b5bd0
commit fd439c3e54

View File

@ -723,6 +723,14 @@ namespace dxvk {
this->invalidateState();
DxvkImageUsageInfo usageInfo = { };
usageInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT;
if (!ensureImageCompatibility(srcImage, usageInfo)) {
Logger::err(str::format("DxvkContext: copyDepthStencilImageToPackedBuffer: Unsupported image:"
"\n src format: ", srcImage->info().format));
}
// Retrieve compute pipeline for the given format
auto pipeInfo = m_common->metaPack().getPackPipeline(format);
@ -1005,6 +1013,15 @@ namespace dxvk {
this->prepareImage(dstImage, vk::makeSubresourceRange(dstSubresource));
DxvkImageUsageInfo usageInfo = { };
usageInfo.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
if (!ensureImageCompatibility(dstImage, usageInfo)) {
Logger::err(str::format("DxvkCOntext: copyPackedBufferToDepthStencilImage: Unsupported image:"
"\n dst format: ", dstImage->info().format));
return;
}
if (m_execBarriers.isBufferDirty(srcBuffer->getSliceHandle(), DxvkAccess::Read)
|| m_execBarriers.isImageDirty(dstImage, vk::makeSubresourceRange(dstSubresource), DxvkAccess::Write))
m_execBarriers.recordCommands(m_cmd);