summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-10-20 07:13:28 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-10-20 07:13:28 +0000
commit457e3c83ce5b08e95ae1cc07e9bc82296a003a28 (patch)
treed51f9435e91e96042fd38ec1b7629e50f126e1d6 /Graphics/GraphicsEngineVulkan
parentAdded HLSLVersion, GLSLVersion and GLESSLVersion to ShaderCreateInfo struct (... (diff)
downloadDiligentCore-457e3c83ce5b08e95ae1cc07e9bc82296a003a28.tar.gz
DiligentCore-457e3c83ce5b08e95ae1cc07e9bc82296a003a28.zip
Added DRAW_FLAG_RESOURCE_BUFFERS_INTACT flag (API Version 240036)
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/PipelineLayout.h24
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp7
-rw-r--r--Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp2
3 files changed, 22 insertions, 11 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/PipelineLayout.h b/Graphics/GraphicsEngineVulkan/include/PipelineLayout.h
index 902dcdd4..e34ee108 100644
--- a/Graphics/GraphicsEngineVulkan/include/PipelineLayout.h
+++ b/Graphics/GraphicsEngineVulkan/include/PipelineLayout.h
@@ -90,10 +90,11 @@ public:
{
std::vector<VkDescriptorSet> vkSets;
std::vector<uint32_t> DynamicOffsets;
- const ShaderResourceCacheVk* pResourceCache = nullptr;
- VkPipelineBindPoint BindPoint = VK_PIPELINE_BIND_POINT_MAX_ENUM;
- Uint32 SetCout = 0;
- Uint32 DynamicOffsetCount = 0;
+ const ShaderResourceCacheVk* pResourceCache = nullptr;
+ VkPipelineBindPoint BindPoint = VK_PIPELINE_BIND_POINT_MAX_ENUM;
+ Uint32 SetCout = 0;
+ Uint32 DynamicOffsetCount = 0;
+ bool DynamicDescriptorsBound = false;
#ifdef _DEBUG
const PipelineLayout* pDbgPipelineLayout = nullptr;
#endif
@@ -105,16 +106,17 @@ public:
void Reset()
{
- SetCout = 0;
- DynamicOffsetCount = 0;
+ pResourceCache = nullptr;
+ BindPoint = VK_PIPELINE_BIND_POINT_MAX_ENUM;
+ SetCout = 0;
+ DynamicOffsetCount = 0;
+ DynamicDescriptorsBound = false;
+
#ifdef _DEBUG
// In release mode, do not clear vectors as this causes unnecessary work
vkSets.clear();
DynamicOffsets.clear();
-#endif
- pResourceCache = nullptr;
- BindPoint = VK_PIPELINE_BIND_POINT_MAX_ENUM;
-#ifdef _DEBUG
+
pDbgPipelineLayout = nullptr;
#endif
}
@@ -246,6 +248,8 @@ __forceinline void PipelineLayout::BindDescriptorSetsWithDynamicOffsets(VulkanUt
// dynamicOffsetCount must equal the total number of dynamic descriptors in the sets being bound (13.2.5)
BindInfo.DynamicOffsetCount,
BindInfo.DynamicOffsets.data());
+
+ BindInfo.DynamicDescriptorsBound = true;
}
}
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
index 2bc18ce1..454429b8 100644
--- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
@@ -421,7 +421,12 @@ namespace Diligent
#endif
if (m_DescrSetBindInfo.DynamicOffsetCount != 0)
- m_pPipelineState->BindDescriptorSetsWithDynamicOffsets(GetCommandBuffer(), m_ContextId, this, m_DescrSetBindInfo);
+ {
+ if (!m_DescrSetBindInfo.DynamicDescriptorsBound || (Flags & DRAW_FLAG_RESOURCE_BUFFERS_INTACT) == 0)
+ {
+ m_pPipelineState->BindDescriptorSetsWithDynamicOffsets(GetCommandBuffer(), m_ContextId, this, m_DescrSetBindInfo);
+ }
+ }
#if 0
#ifdef _DEBUG
else
diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp
index b978f3c6..b3b97ec6 100644
--- a/Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/PipelineLayout.cpp
@@ -499,6 +499,8 @@ void PipelineLayout::PrepareDescriptorSets(DeviceContextVkImpl* pCtxVkI
0,
nullptr);
}
+
+ BindInfo.DynamicDescriptorsBound = false;
}
}