mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-02 11:52:10 +01:00
[dxvk] Use out-of-order transfer helper in clearImageViewCs
Covers image-related ClearUAV use cases.
This commit is contained in:
parent
a68b2653aa
commit
8a79699ae3
@ -3447,15 +3447,21 @@ namespace dxvk {
|
|||||||
VkOffset3D offset,
|
VkOffset3D offset,
|
||||||
VkExtent3D extent,
|
VkExtent3D extent,
|
||||||
VkClearValue value) {
|
VkClearValue value) {
|
||||||
this->spillRenderPass(false);
|
DxvkCmdBuffer cmdBuffer = DxvkCmdBuffer::InitBuffer;
|
||||||
this->invalidateState();
|
|
||||||
|
|
||||||
flushPendingAccesses(*imageView->image(), imageView->imageSubresources(), DxvkAccess::Write);
|
if (!prepareOutOfOrderTransfer(imageView->image(), DxvkAccess::Write)) {
|
||||||
|
spillRenderPass(false);
|
||||||
|
invalidateState();
|
||||||
|
|
||||||
|
flushPendingAccesses(*imageView->image(), imageView->imageSubresources(), DxvkAccess::Write);
|
||||||
|
|
||||||
|
cmdBuffer = DxvkCmdBuffer::ExecBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
addImageLayoutTransition(*imageView->image(), imageView->imageSubresources(),
|
addImageLayoutTransition(*imageView->image(), imageView->imageSubresources(),
|
||||||
VK_IMAGE_LAYOUT_GENERAL, VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, VK_ACCESS_2_SHADER_WRITE_BIT,
|
VK_IMAGE_LAYOUT_GENERAL, VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, VK_ACCESS_2_SHADER_WRITE_BIT,
|
||||||
imageView->image()->isFullSubresource(vk::pickSubresourceLayers(imageView->imageSubresources(), 0), extent));
|
imageView->image()->isFullSubresource(vk::pickSubresourceLayers(imageView->imageSubresources(), 0), extent));
|
||||||
flushImageLayoutTransitions(DxvkCmdBuffer::ExecBuffer);
|
flushImageLayoutTransitions(cmdBuffer);
|
||||||
|
|
||||||
// Query pipeline objects to use for this clear operation
|
// Query pipeline objects to use for this clear operation
|
||||||
DxvkMetaClearPipeline pipeInfo = m_common->metaClear().getClearImagePipeline(
|
DxvkMetaClearPipeline pipeInfo = m_common->metaClear().getClearImagePipeline(
|
||||||
@ -3492,18 +3498,18 @@ namespace dxvk {
|
|||||||
else if (imageView->type() == VK_IMAGE_VIEW_TYPE_2D_ARRAY)
|
else if (imageView->type() == VK_IMAGE_VIEW_TYPE_2D_ARRAY)
|
||||||
workgroups.depth = imageView->subresources().layerCount;
|
workgroups.depth = imageView->subresources().layerCount;
|
||||||
|
|
||||||
m_cmd->cmdBindPipeline(DxvkCmdBuffer::ExecBuffer,
|
m_cmd->cmdBindPipeline(cmdBuffer,
|
||||||
VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeline);
|
VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeline);
|
||||||
m_cmd->cmdBindDescriptorSet(DxvkCmdBuffer::ExecBuffer,
|
m_cmd->cmdBindDescriptorSet(cmdBuffer,
|
||||||
VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeLayout,
|
VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeLayout,
|
||||||
descriptorSet, 0, nullptr);
|
descriptorSet, 0, nullptr);
|
||||||
m_cmd->cmdPushConstants(DxvkCmdBuffer::ExecBuffer,
|
m_cmd->cmdPushConstants(cmdBuffer,
|
||||||
pipeInfo.pipeLayout, VK_SHADER_STAGE_COMPUTE_BIT,
|
pipeInfo.pipeLayout, VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
0, sizeof(pushArgs), &pushArgs);
|
0, sizeof(pushArgs), &pushArgs);
|
||||||
m_cmd->cmdDispatch(DxvkCmdBuffer::ExecBuffer,
|
m_cmd->cmdDispatch(cmdBuffer,
|
||||||
workgroups.width, workgroups.height, workgroups.depth);
|
workgroups.width, workgroups.height, workgroups.depth);
|
||||||
|
|
||||||
accessImage(DxvkCmdBuffer::ExecBuffer,
|
accessImage(cmdBuffer,
|
||||||
*imageView->image(), imageView->imageSubresources(),
|
*imageView->image(), imageView->imageSubresources(),
|
||||||
VK_IMAGE_LAYOUT_GENERAL, VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT,
|
VK_IMAGE_LAYOUT_GENERAL, VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT,
|
||||||
VK_ACCESS_2_SHADER_WRITE_BIT);
|
VK_ACCESS_2_SHADER_WRITE_BIT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user