1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-02 04:29:14 +01:00

[dxvk] USe new barrier helpers in generateMipmaps

This commit is contained in:
Philip Rebohle 2024-10-12 01:25:34 +02:00 committed by Philip Rebohle
parent 03a716e308
commit 33b146467a

View File

@ -1238,8 +1238,7 @@ namespace dxvk {
return; return;
} }
if (m_execBarriers.isImageDirty(imageView->image(), imageView->imageSubresources(), DxvkAccess::Write)) flushPendingAccesses(*imageView->image(), imageView->imageSubresources(), DxvkAccess::Write);
m_execBarriers.recordCommands(m_cmd);
// Create image views, etc. // Create image views, etc.
DxvkMetaMipGenViews mipGenerator(imageView); DxvkMetaMipGenViews mipGenerator(imageView);
@ -1354,36 +1353,24 @@ namespace dxvk {
// Issue barriers to ensure we can safely access all mip // Issue barriers to ensure we can safely access all mip
// levels of the image in all ways the image can be used // levels of the image in all ways the image can be used
if (srcLayout == dstLayout) { if (srcLayout == dstLayout) {
m_execBarriers.accessImage(imageView->image(), accessImage(DxvkCmdBuffer::ExecBuffer,
imageView->imageSubresources(), *imageView->image(), imageView->imageSubresources(), srcLayout,
srcLayout, VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT |
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT |
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_2_SHADER_READ_BIT);
VK_ACCESS_SHADER_READ_BIT,
imageView->image()->info().layout,
imageView->image()->info().stages,
imageView->image()->info().access);
} else { } else {
m_execBarriers.accessImage(imageView->image(), accessImage(DxvkCmdBuffer::ExecBuffer,
mipGenerator.getAllSourceSubresources(), *imageView->image(), mipGenerator.getAllSourceSubresources(), srcLayout,
srcLayout, VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT |
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT |
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_2_SHADER_READ_BIT);
VK_ACCESS_SHADER_READ_BIT,
imageView->image()->info().layout,
imageView->image()->info().stages,
imageView->image()->info().access);
m_execBarriers.accessImage(imageView->image(), accessImage(DxvkCmdBuffer::ExecBuffer,
mipGenerator.getBottomSubresource(), *imageView->image(), mipGenerator.getBottomSubresource(), dstLayout,
dstLayout, VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT,
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT);
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
imageView->image()->info().layout,
imageView->image()->info().stages,
imageView->image()->info().access);
} }
m_cmd->trackResource<DxvkAccess::Write>(imageView->image()); m_cmd->trackResource<DxvkAccess::Write>(imageView->image());