From 9165f8c07213a7b688de3e96335fdf4f1fab68a8 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 6 Feb 2019 22:28:48 +0100 Subject: [PATCH] [dxvk] Add type and context method to set barrier control flags --- src/dxvk/dxvk_context.cpp | 5 +++++ src/dxvk/dxvk_context.h | 23 +++++++++++++++++------ src/dxvk/dxvk_context_state.h | 13 +++++++++++++ 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 8ac14d2a..2c704d28 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -1737,6 +1737,11 @@ namespace dxvk { m_flags.set(DxvkContextFlag::GpDirtyPipelineState); } + + + void DxvkContext::setBarrierControl(DxvkBarrierControlFlags control) { + m_barrierControl = control; + } void DxvkContext::signalEvent(const DxvkEventRevision& event) { diff --git a/src/dxvk/dxvk_context.h b/src/dxvk/dxvk_context.h index 501ba7ac..0c00f113 100644 --- a/src/dxvk/dxvk_context.h +++ b/src/dxvk/dxvk_context.h @@ -754,6 +754,16 @@ namespace dxvk { uint32_t attachment, const DxvkBlendMode& blendMode); + /** + * \brief Sets barrier control flags + * + * Barrier control flags can be used to control + * implicit synchronization of compute shaders. + * \param [in] control New barrier control flags + */ + void setBarrierControl( + DxvkBarrierControlFlags control); + /** * \brief Signals an event * \param [in] event The event @@ -781,14 +791,15 @@ namespace dxvk { Rc m_cmd; Rc m_descPool; - DxvkContextFlags m_flags; - DxvkContextState m_state; + DxvkContextFlags m_flags; + DxvkContextState m_state; - DxvkBarrierSet m_barriers; - DxvkBarrierSet m_transitions; - - DxvkQueryManager m_queries; + DxvkBarrierSet m_barriers; + DxvkBarrierSet m_transitions; + DxvkBarrierControlFlags m_barrierControl; + DxvkQueryManager m_queries; + VkPipeline m_gpActivePipeline = VK_NULL_HANDLE; VkPipeline m_cpActivePipeline = VK_NULL_HANDLE; diff --git a/src/dxvk/dxvk_context_state.h b/src/dxvk/dxvk_context_state.h index 22a4ad06..0343f343 100644 --- a/src/dxvk/dxvk_context_state.h +++ b/src/dxvk/dxvk_context_state.h @@ -54,6 +54,19 @@ namespace dxvk { using DxvkContextFlags = Flags; + /** + * \brief Barrier control flags + * + * These flags specify what (not) to + * synchronize implicitly. + */ + enum class DxvkBarrierControl : uint32_t { + IgnoreWriteAfterWrite = 1, + }; + + using DxvkBarrierControlFlags = Flags; + + struct DxvkIndirectDrawState { DxvkBufferSlice argBuffer; };