From a40d8d49ea001cac87687e538c9f672a2eaa8c96 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 2 Mar 2019 19:44:03 +0100 Subject: [PATCH] [dxvk] Only enable xfb subpass barrier if feature is enabled Silences validation errors when running FL9_x applications, or a driver which does not support VK_EXT_transform_feedback. --- src/dxvk/dxvk_context.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 2dd68fad..f5a6d7d4 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -2532,20 +2532,34 @@ namespace dxvk { void DxvkContext::resetRenderPassOps( const DxvkRenderTargets& renderTargets, DxvkRenderPassOps& renderPassOps) { - renderPassOps.barrier.srcStages = VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT; + VkPipelineStageFlags shaderStages = m_device->getShaderPipelineStages() + & ~VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT; + + renderPassOps.barrier.srcStages = shaderStages + | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT + | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT + | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT + | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT + | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT + | VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT; renderPassOps.barrier.srcAccess = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT - | VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT - | VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT - | VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT | VK_ACCESS_INDIRECT_COMMAND_READ_BIT | VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT | VK_ACCESS_INDEX_READ_BIT | VK_ACCESS_UNIFORM_READ_BIT | VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT; + + if (m_device->features().extTransformFeedback.transformFeedback) { + renderPassOps.barrier.srcStages |= VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT; + renderPassOps.barrier.srcAccess |= VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT + | VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT + | VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT; + } + renderPassOps.barrier.dstStages = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; renderPassOps.barrier.dstAccess = renderPassOps.barrier.srcAccess | VK_ACCESS_TRANSFER_READ_BIT