mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 19:24:10 +01:00
[dxvk] Use self-dependency to synchronize SSBO writes
While this doesn't support vertex stages yet, it should be faster when the pipeline writes to storage resources from the fragment shader. We should analyze the vertex stage shaders for SSBO writes in order to determine whether to spill the render pass.
This commit is contained in:
parent
43ed820be9
commit
76b63efedb
@ -3032,11 +3032,14 @@ namespace dxvk {
|
||||
|
||||
|
||||
void DxvkContext::commitGraphicsPostBarriers() {
|
||||
// Render pass dependencies always act as a full memory barrier. We
|
||||
// have to do this because writes from the vertex shader in one draw
|
||||
// need to be visible to the fragment shader in the next draw, etc.
|
||||
if (m_state.gp.flags.test(DxvkGraphicsPipelineFlag::HasStorageDescriptors))
|
||||
this->spillRenderPass();
|
||||
if (m_state.gp.flags.test(DxvkGraphicsPipelineFlag::HasStorageDescriptors)) {
|
||||
// FIXME support vertex stage SSBO synchronization
|
||||
this->emitMemoryBarrier(
|
||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
||||
VK_ACCESS_SHADER_WRITE_BIT,
|
||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
||||
VK_ACCESS_SHADER_READ_BIT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -121,7 +121,7 @@ namespace dxvk {
|
||||
if (m_format.depth.format == VK_FORMAT_UNDEFINED)
|
||||
subpass.pDepthStencilAttachment = nullptr;
|
||||
|
||||
const std::array<VkSubpassDependency, 3> subpassDeps = {{
|
||||
const std::array<VkSubpassDependency, 4> subpassDeps = {{
|
||||
{ VK_SUBPASS_EXTERNAL, 0,
|
||||
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
|
||||
VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
|
||||
@ -132,9 +132,14 @@ namespace dxvk {
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, 0 },
|
||||
{ 0, 0,
|
||||
VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT,
|
||||
VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT,
|
||||
VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT, /* XXX */
|
||||
VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT,
|
||||
VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT, 0 },
|
||||
{ 0, 0,
|
||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
||||
VK_ACCESS_SHADER_WRITE_BIT,
|
||||
VK_ACCESS_SHADER_READ_BIT, 0 },
|
||||
{ 0, VK_SUBPASS_EXTERNAL,
|
||||
VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
|
||||
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
|
||||
|
Loading…
Reference in New Issue
Block a user