summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-12-03 01:17:30 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-12-03 01:17:30 +0000
commit670f344ec66ad0d4b65b15ba66ad094af109b99c (patch)
tree62acbefc1102e5f897743af4078e97516d13d53b /Graphics/GraphicsEngineVulkan
parentImproved state transition handling in D3D12 backend (diff)
downloadDiligentCore-670f344ec66ad0d4b65b15ba66ad094af109b99c.tar.gz
DiligentCore-670f344ec66ad0d4b65b15ba66ad094af109b99c.zip
Replaced COMMIT_SHADER_RESOURCES_FLAGS with RESOURCE_STATE_TRANSITION_MODE
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp8
-rw-r--r--Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp12
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderResourceCacheVk.cpp6
6 files changed, 16 insertions, 16 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
index a6f034b2..5de53766 100644
--- a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
@@ -67,7 +67,7 @@ public:
virtual void TransitionShaderResources(IPipelineState* pPipelineState, IShaderResourceBinding* pShaderResourceBinding)override final;
- virtual void CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, COMMIT_SHADER_RESOURCES_FLAGS Flags)override final;
+ virtual void CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final;
virtual void SetStencilRef(Uint32 StencilRef)override final;
diff --git a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h
index dc9a87cb..8f1d5453 100644
--- a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h
@@ -67,7 +67,7 @@ public:
void CommitAndTransitionShaderResources(IShaderResourceBinding* pShaderResourceBinding,
DeviceContextVkImpl* pCtxVkImpl,
bool CommitResources,
- Uint32 Flags,
+ RESOURCE_STATE_TRANSITION_MODE StateTransitionMode,
PipelineLayout::DescriptorSetBindInfo* pDescrSetBindInfo)const;
void BindDescriptorSetsWithDynamicOffsets(DeviceContextVkImpl* pCtxVkImpl,
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
index 412b452c..2530235b 100644
--- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
@@ -260,15 +260,15 @@ namespace Diligent
VERIFY_EXPR(pPipelineState != nullptr);
auto *pPipelineStateVk = ValidatedCast<PipelineStateVkImpl>(pPipelineState);
- pPipelineStateVk->CommitAndTransitionShaderResources(pShaderResourceBinding, this, false, COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES, nullptr);
+ pPipelineStateVk->CommitAndTransitionShaderResources(pShaderResourceBinding, this, false, RESOURCE_STATE_TRANSITION_MODE_TRANSITION, nullptr);
}
- void DeviceContextVkImpl::CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, COMMIT_SHADER_RESOURCES_FLAGS Flags)
+ void DeviceContextVkImpl::CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)
{
- if (!DeviceContextBase::CommitShaderResources(pShaderResourceBinding, Flags, 0 /*Dummy*/))
+ if (!DeviceContextBase::CommitShaderResources(pShaderResourceBinding, StateTransitionMode, 0 /*Dummy*/))
return;
- m_pPipelineState->CommitAndTransitionShaderResources(pShaderResourceBinding, this, true, Flags, &m_DescrSetBindInfo);
+ m_pPipelineState->CommitAndTransitionShaderResources(pShaderResourceBinding, this, true, StateTransitionMode, &m_DescrSetBindInfo);
}
void DeviceContextVkImpl::SetStencilRef(Uint32 StencilRef)
diff --git a/Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp b/Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp
index ec6d61c3..feebec7b 100644
--- a/Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp
@@ -304,7 +304,7 @@ namespace Diligent
if (CurrLayout != VK_IMAGE_LAYOUT_GENERAL)
Ctx.TransitionImageLayout(*pTexVk, CurrLayout, VK_IMAGE_LAYOUT_GENERAL, SubresRange);
- Ctx.CommitShaderResources(&SRB, COMMIT_SHADER_RESOURCES_FLAG_NONE);
+ Ctx.CommitShaderResources(&SRB, RESOURCE_STATE_TRANSITION_MODE_NONE);
DispatchComputeAttribs DispatchAttrs((DstWidth + 7) / 8, (DstHeight + 7) / 8, ViewDesc.NumArraySlices);
Ctx.DispatchCompute(DispatchAttrs);
diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
index 757151fd..407e6f43 100644
--- a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp
@@ -508,7 +508,7 @@ bool PipelineStateVkImpl::IsCompatibleWith(const IPipelineState *pPSO)const
void PipelineStateVkImpl::CommitAndTransitionShaderResources(IShaderResourceBinding* pShaderResourceBinding,
DeviceContextVkImpl* pCtxVkImpl,
bool CommitResources,
- Uint32 Flags,
+ RESOURCE_STATE_TRANSITION_MODE StateTransitionMode,
PipelineLayout::DescriptorSetBindInfo* pDescrSetBindInfo)const
{
if (!m_HasStaticResources && !m_HasNonStaticResources)
@@ -552,14 +552,14 @@ void PipelineStateVkImpl::CommitAndTransitionShaderResources(IShaderResourceBind
if (CommitResources)
{
- if (Flags & COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES)
+ if (StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_TRANSITION)
ResourceCache.TransitionResources<false>(pCtxVkImpl);
- else if (Flags & COMMIT_SHADER_RESOURCES_FLAG_VERIFY_STATES)
- {
#ifdef DEVELOPMENT
+ else if (StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY)
+ {
ResourceCache.TransitionResources<true>(pCtxVkImpl);
-#endif
}
+#endif
VkDescriptorSet DynamicDescrSet = VK_NULL_HANDLE;
auto DynamicDescriptorSetVkLayout = m_PipelineLayout.GetDynamicDescriptorSetVkLayout();
@@ -589,7 +589,7 @@ void PipelineStateVkImpl::CommitAndTransitionShaderResources(IShaderResourceBind
}
else
{
- VERIFY( (Flags & COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES) != 0 , "Resources should be transitioned or committed or both");
+ VERIFY(StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_TRANSITION, "Resources should be transitioned or committed or both");
ResourceCache.TransitionResources<false>(pCtxVkImpl);
}
}
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderResourceCacheVk.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderResourceCacheVk.cpp
index 43643fad..5e5dcaee 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderResourceCacheVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderResourceCacheVk.cpp
@@ -122,7 +122,7 @@ void ShaderResourceCacheVk::TransitionResources(DeviceContextVkImpl* pCtxVkImpl)
LOG_ERROR_MESSAGE("State of buffer '", pBufferVk->GetDesc().Name, "' is incorrect. Required state: ",
GetResourceStateString(RequiredState), ". Actual state: ",
GetResourceStateString(pBufferVk->GetState()),
- ". Call TransitionShaderResources() or provide COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES flag to CommitShaderResources()");
+ ". Call TransitionShaderResources() or provide RESOURCE_STATE_TRANSITION_MODE_TRANSITION flag to CommitShaderResources()");
}
else
{
@@ -156,7 +156,7 @@ void ShaderResourceCacheVk::TransitionResources(DeviceContextVkImpl* pCtxVkImpl)
LOG_ERROR_MESSAGE("State of buffer '", pBufferVk->GetDesc().Name, "' is incorrect. Required state: ",
GetResourceStateString(RequiredState), ". Actual state: ",
GetResourceStateString(pBufferVk->GetState()),
- ". Call TransitionShaderResources() or provide COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES flag to CommitShaderResources()");
+ ". Call TransitionShaderResources() or provide RESOURCE_STATE_TRANSITION_MODE_TRANSITION flag to CommitShaderResources()");
}
else
{
@@ -212,7 +212,7 @@ void ShaderResourceCacheVk::TransitionResources(DeviceContextVkImpl* pCtxVkImpl)
LOG_ERROR_MESSAGE("State of texture '", pTextureVk->GetDesc().Name, "' is incorrect. Required state: ",
GetResourceStateString(RequiredState), ". Actual state: ",
GetResourceStateString(pTextureVk->GetState()),
- ". Call TransitionShaderResources() or specify COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES flag in a call to CommitShaderResources()");
+ ". Call TransitionShaderResources() or specify RESOURCE_STATE_TRANSITION_MODE_TRANSITION flag in a call to CommitShaderResources()");
}
else
{