diff options
| author | TellowKrinkle <tellowkrinkle@gmail.com> | 2022-07-24 03:32:59 -0500 |
|---|---|---|
| committer | TellowKrinkle <tellowkrinkle@gmail.com> | 2022-10-22 20:13:24 -0500 |
| commit | 3a5901d12e1257001f983acdb55448db29befed2 (patch) | |
| tree | ecc8b974261149fb25356f9baf12337aed47effc /Source/Core/VideoBackends/Vulkan/StateTracker.cpp | |
| parent | 678ee48bfcc169e1d1833a19635153f544613ad5 (diff) | |
VideoBackends:Vulkan: Add support for vertex shader point and line expansion
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/StateTracker.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/StateTracker.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/StateTracker.cpp b/Source/Core/VideoBackends/Vulkan/StateTracker.cpp index d9b03940ce..8b01c66ca8 100644 --- a/Source/Core/VideoBackends/Vulkan/StateTracker.cpp +++ b/Source/Core/VideoBackends/Vulkan/StateTracker.cpp @@ -458,6 +458,9 @@ void StateTracker::UpdateGXDescriptorSet() std::array<VkWriteDescriptorSet, MAX_DESCRIPTOR_WRITES> writes; u32 num_writes = 0; + const bool needs_gs_ubo = g_ActiveConfig.backend_info.bSupportsGeometryShaders || + g_ActiveConfig.UseVSForLinePointExpand(); + if (m_dirty_flags & DIRTY_FLAG_GX_UBOS || m_gx_descriptor_sets[0] == VK_NULL_HANDLE) { m_gx_descriptor_sets[0] = g_command_buffer_mgr->AllocateDescriptorSet( @@ -465,8 +468,7 @@ void StateTracker::UpdateGXDescriptorSet() for (size_t i = 0; i < NUM_UBO_DESCRIPTOR_SET_BINDINGS; i++) { - if (i == UBO_DESCRIPTOR_SET_BINDING_GS && - !g_ActiveConfig.backend_info.bSupportsGeometryShaders) + if (i == UBO_DESCRIPTOR_SET_BINDING_GS && !needs_gs_ubo) { continue; } @@ -505,8 +507,9 @@ void StateTracker::UpdateGXDescriptorSet() } const bool needs_bbox_ssbo = g_ActiveConfig.backend_info.bSupportsBBox; - const bool needs_vertex_ssbo = g_ActiveConfig.backend_info.bSupportsDynamicVertexLoader && - m_pipeline->GetUsage() == AbstractPipelineUsage::GXUber; + const bool needs_vertex_ssbo = (g_ActiveConfig.backend_info.bSupportsDynamicVertexLoader && + m_pipeline->GetUsage() == AbstractPipelineUsage::GXUber) || + g_ActiveConfig.UseVSForLinePointExpand(); const bool needs_ssbo = needs_bbox_ssbo || needs_vertex_ssbo; if (needs_ssbo && @@ -520,7 +523,8 @@ void StateTracker::UpdateGXDescriptorSet() VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, nullptr, m_gx_descriptor_sets[2], 0, 0, 1, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, nullptr, &m_bindings.ssbo, nullptr}; - if (g_ActiveConfig.backend_info.bSupportsDynamicVertexLoader) + if (g_ActiveConfig.backend_info.bSupportsDynamicVertexLoader || + g_ActiveConfig.UseVSForLinePointExpand()) { writes[num_writes++] = {VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, nullptr, @@ -546,21 +550,18 @@ void StateTracker::UpdateGXDescriptorSet() VK_PIPELINE_BIND_POINT_GRAPHICS, m_pipeline->GetVkPipelineLayout(), 0, needs_ssbo ? NUM_GX_DESCRIPTOR_SETS : (NUM_GX_DESCRIPTOR_SETS - 1), m_gx_descriptor_sets.data(), - g_ActiveConfig.backend_info.bSupportsGeometryShaders ? - NUM_UBO_DESCRIPTOR_SET_BINDINGS : - (NUM_UBO_DESCRIPTOR_SET_BINDINGS - 1), + needs_gs_ubo ? NUM_UBO_DESCRIPTOR_SET_BINDINGS : + (NUM_UBO_DESCRIPTOR_SET_BINDINGS - 1), m_bindings.gx_ubo_offsets.data()); m_dirty_flags &= ~(DIRTY_FLAG_DESCRIPTOR_SETS | DIRTY_FLAG_GX_UBO_OFFSETS); } else if (m_dirty_flags & DIRTY_FLAG_GX_UBO_OFFSETS) { - vkCmdBindDescriptorSets(g_command_buffer_mgr->GetCurrentCommandBuffer(), - VK_PIPELINE_BIND_POINT_GRAPHICS, m_pipeline->GetVkPipelineLayout(), 0, - 1, m_gx_descriptor_sets.data(), - g_ActiveConfig.backend_info.bSupportsGeometryShaders ? - NUM_UBO_DESCRIPTOR_SET_BINDINGS : - (NUM_UBO_DESCRIPTOR_SET_BINDINGS - 1), - m_bindings.gx_ubo_offsets.data()); + vkCmdBindDescriptorSets( + g_command_buffer_mgr->GetCurrentCommandBuffer(), VK_PIPELINE_BIND_POINT_GRAPHICS, + m_pipeline->GetVkPipelineLayout(), 0, 1, m_gx_descriptor_sets.data(), + needs_gs_ubo ? NUM_UBO_DESCRIPTOR_SET_BINDINGS : (NUM_UBO_DESCRIPTOR_SET_BINDINGS - 1), + m_bindings.gx_ubo_offsets.data()); m_dirty_flags &= ~DIRTY_FLAG_GX_UBO_OFFSETS; } } |
