diff --git a/Source/Core/VideoBackends/D3D12/D3D12Renderer.cpp b/Source/Core/VideoBackends/D3D12/D3D12Renderer.cpp index 80872086a9..fc76f8e6f2 100644 --- a/Source/Core/VideoBackends/D3D12/D3D12Renderer.cpp +++ b/Source/Core/VideoBackends/D3D12/D3D12Renderer.cpp @@ -19,6 +19,14 @@ namespace DX12 { +static bool UsesDynamicVertexLoader(const AbstractPipeline* pipeline) +{ + const AbstractPipelineUsage usage = static_cast(pipeline)->GetUsage(); + return (g_ActiveConfig.backend_info.bSupportsDynamicVertexLoader && + usage == AbstractPipelineUsage::GXUber) || + (g_ActiveConfig.UseVSForLinePointExpand() && usage != AbstractPipelineUsage::Utility); +} + Renderer::Renderer(std::unique_ptr swap_chain, float backbuffer_scale) : ::Renderer(swap_chain ? swap_chain->GetWidth() : 0, swap_chain ? swap_chain->GetHeight() : 0, backbuffer_scale, @@ -364,8 +372,7 @@ void Renderer::DrawIndexed(u32 base_index, u32 num_indices, u32 base_vertex) return; // DX12 is great and doesn't include the base vertex in SV_VertexID - if (static_cast(m_current_pipeline)->GetUsage() == - AbstractPipelineUsage::GXUber) + if (UsesDynamicVertexLoader(m_current_pipeline)) g_dx_context->GetCommandList()->SetGraphicsRoot32BitConstant( ROOT_PARAMETER_BASE_VERTEX_CONSTANT, base_vertex, 0); g_dx_context->GetCommandList()->DrawIndexedInstanced(num_indices, 1, base_index, base_vertex, 0); @@ -601,8 +608,7 @@ bool Renderer::ApplyState() } } - if (dirty_bits & DirtyState_VS_SRV_Descriptor && - pipeline->GetUsage() == AbstractPipelineUsage::GXUber) + if (dirty_bits & DirtyState_VS_SRV_Descriptor && UsesDynamicVertexLoader(pipeline)) { cmdlist->SetGraphicsRootDescriptorTable(ROOT_PARAMETER_VS_SRV, m_state.vertex_srv_descriptor_base); @@ -724,9 +730,7 @@ bool Renderer::UpdateUAVDescriptorTable() bool Renderer::UpdateVSSRVDescriptorTable() { - if (!g_ActiveConfig.backend_info.bSupportsDynamicVertexLoader || - static_cast(m_current_pipeline)->GetUsage() != - AbstractPipelineUsage::GXUber) + if (!UsesDynamicVertexLoader(m_current_pipeline)) { return true; } diff --git a/Source/Core/VideoBackends/D3D12/DX12Context.cpp b/Source/Core/VideoBackends/D3D12/DX12Context.cpp index 955f26413e..e0fd41e4f0 100644 --- a/Source/Core/VideoBackends/D3D12/DX12Context.cpp +++ b/Source/Core/VideoBackends/D3D12/DX12Context.cpp @@ -353,7 +353,10 @@ bool DXContext::CreateGXRootSignature() param_count++; SetRootParamCBV(¶ms[param_count], 1, D3D12_SHADER_VISIBILITY_VERTEX); param_count++; - SetRootParamCBV(¶ms[param_count], 0, D3D12_SHADER_VISIBILITY_GEOMETRY); + if (g_ActiveConfig.UseVSForLinePointExpand()) + SetRootParamCBV(¶ms[param_count], 2, D3D12_SHADER_VISIBILITY_VERTEX); + else + SetRootParamCBV(¶ms[param_count], 0, D3D12_SHADER_VISIBILITY_GEOMETRY); param_count++; SetRootParamTable(¶ms[param_count], &ranges[param_count], D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 3, 1, D3D12_SHADER_VISIBILITY_VERTEX); diff --git a/Source/Core/VideoBackends/D3D12/VideoBackend.cpp b/Source/Core/VideoBackends/D3D12/VideoBackend.cpp index 8426709b39..1e7483fd6a 100644 --- a/Source/Core/VideoBackends/D3D12/VideoBackend.cpp +++ b/Source/Core/VideoBackends/D3D12/VideoBackend.cpp @@ -88,6 +88,7 @@ void VideoBackend::FillBackendInfo() g_Config.backend_info.bSupportsSettingObjectNames = true; g_Config.backend_info.bSupportsPartialMultisampleResolve = true; g_Config.backend_info.bSupportsDynamicVertexLoader = true; + g_Config.backend_info.bSupportsVSLinePointExpand = true; // We can only check texture support once we have a device. if (g_dx_context)