summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-07-25 04:31:09 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-07-25 04:31:09 +0000
commitc746f802d7b23d9c5ee0f52a7e5428a32bf3f316 (patch)
tree344b4a987341150fda9fd7f8642b902e9f96df71 /Graphics/GraphicsEngineVulkan
parentFixed performance issue with resetting unchanged vertex buffers (diff)
downloadDiligentCore-c746f802d7b23d9c5ee0f52a7e5428a32bf3f316.tar.gz
DiligentCore-c746f802d7b23d9c5ee0f52a7e5428a32bf3f316.zip
Updated DeviceContextBase to use final types for pipeline state, buffers and texture views
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h3
-rw-r--r--Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h3
-rw-r--r--Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h7
-rw-r--r--Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h3
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h3
-rw-r--r--Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h2
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp14
14 files changed, 27 insertions, 22 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h b/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h
index 6c88c16e..5d6671ce 100644
--- a/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h
@@ -41,7 +41,7 @@ class BufferVkImpl;
class BufferViewVkImpl : public BufferViewBase<IBufferViewVk>
{
public:
- typedef BufferViewBase<IBufferViewVk> TBufferViewBase;
+ using TBufferViewBase = BufferViewBase<IBufferViewVk>;
BufferViewVkImpl( IReferenceCounters* pRefCounters,
IRenderDevice* pDevice,
diff --git a/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h b/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h
index e4a0edf4..6b448e1b 100644
--- a/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h
@@ -45,7 +45,8 @@ class FixedBlockMemoryAllocator;
class BufferVkImpl : public BufferBase<IBufferVk, BufferViewVkImpl, FixedBlockMemoryAllocator>
{
public:
- typedef BufferBase<IBufferVk, BufferViewVkImpl, FixedBlockMemoryAllocator> TBufferBase;
+ using TBufferBase = BufferBase<IBufferVk, BufferViewVkImpl, FixedBlockMemoryAllocator>;
+
BufferVkImpl(IReferenceCounters* pRefCounters,
FixedBlockMemoryAllocator& BuffViewObjMemAllocator,
class RenderDeviceVkImpl* pDeviceVk,
diff --git a/Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h b/Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h
index d309b49e..d4507a28 100644
--- a/Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h
@@ -36,7 +36,8 @@ namespace Diligent
class CommandListVkImpl : public CommandListBase<ICommandList>
{
public:
- typedef CommandListBase<ICommandList> TCommandListBase;
+ using TCommandListBase = CommandListBase<ICommandList>;
+
CommandListVkImpl(IReferenceCounters* pRefCounters,
IRenderDevice* pDevice,
IDeviceContext* pDeferredCtx,
diff --git a/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h b/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h
index b1ec606f..5a3de325 100644
--- a/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h
@@ -41,7 +41,7 @@ namespace Diligent
class CommandQueueVkImpl : public ObjectBase<ICommandQueueVk>
{
public:
- typedef ObjectBase<ICommandQueueVk> TBase;
+ using TBase = ObjectBase<ICommandQueueVk>;
CommandQueueVkImpl(IReferenceCounters* pRefCounters,
std::shared_ptr<VulkanUtilities::VulkanLogicalDevice> LogicalDevice,
diff --git a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
index 26e74a25..4470c028 100644
--- a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h
@@ -37,15 +37,18 @@
#include "DescriptorPoolManager.h"
#include "PipelineLayout.h"
#include "GenerateMipsVkHelper.h"
+#include "BufferVKImpl.h"
+#include "TextureViewVKImpl.h"
+#include "PipelineStateVKImpl.h"
namespace Diligent
{
/// Implementation of the Diligent::IDeviceContext interface
-class DeviceContextVkImpl : public DeviceContextBase<IDeviceContextVk>
+class DeviceContextVkImpl : public DeviceContextBase<IDeviceContextVk, BufferVkImpl, TextureViewVkImpl, PipelineStateVkImpl>
{
public:
- typedef DeviceContextBase<IDeviceContextVk> TDeviceContextBase;
+ using TDeviceContextBase = DeviceContextBase<IDeviceContextVk, BufferVkImpl, TextureViewVkImpl, PipelineStateVkImpl>;
DeviceContextVkImpl(IReferenceCounters* pRefCounters,
class RenderDeviceVkImpl* pDevice,
diff --git a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h
index e06d853d..b98dedf5 100644
--- a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h
@@ -48,7 +48,7 @@ class FixedBlockMemoryAllocator;
class PipelineStateVkImpl : public PipelineStateBase<IPipelineStateVk, IRenderDeviceVk>
{
public:
- typedef PipelineStateBase<IPipelineStateVk, IRenderDeviceVk> TPipelineStateBase;
+ using TPipelineStateBase = PipelineStateBase<IPipelineStateVk, IRenderDeviceVk>;
PipelineStateVkImpl( IReferenceCounters* pRefCounters, class RenderDeviceVkImpl* pDeviceVk, const PipelineStateDesc &PipelineDesc );
~PipelineStateVkImpl();
diff --git a/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h b/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h
index 612854f7..11257bf0 100644
--- a/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h
@@ -54,7 +54,7 @@ namespace Diligent
class RenderDeviceVkImpl : public RenderDeviceBase<IRenderDeviceVk>
{
public:
- typedef RenderDeviceBase<IRenderDeviceVk> TRenderDeviceBase;
+ using TRenderDeviceBase = RenderDeviceBase<IRenderDeviceVk>;
RenderDeviceVkImpl( IReferenceCounters* pRefCounters,
IMemoryAllocator& RawMemAllocator,
diff --git a/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h b/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h
index 23d4c713..c3595b0e 100644
--- a/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h
@@ -38,7 +38,7 @@ class FixedBlockMemoryAllocator;
class SamplerVkImpl : public SamplerBase<ISamplerVk, IRenderDeviceVk>
{
public:
- typedef SamplerBase<ISamplerVk, IRenderDeviceVk> TSamplerBase;
+ using TSamplerBase = SamplerBase<ISamplerVk, IRenderDeviceVk>;
SamplerVkImpl(IReferenceCounters* pRefCounters, class RenderDeviceVkImpl* pRenderDeviceVk, const SamplerDesc& SamplerDesc);
~SamplerVkImpl();
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h b/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h
index 978a967d..34186c61 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h
@@ -43,7 +43,8 @@ class FixedBlockMemoryAllocator;
class ShaderResourceBindingVkImpl : public ShaderResourceBindingBase<IShaderResourceBindingVk>
{
public:
- typedef ShaderResourceBindingBase<IShaderResourceBindingVk> TBase;
+ using TBase = ShaderResourceBindingBase<IShaderResourceBindingVk>;
+
ShaderResourceBindingVkImpl(IReferenceCounters* pRefCounters, class PipelineStateVkImpl* pPSO, bool IsPSOInternal);
~ShaderResourceBindingVkImpl();
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h
index 2c6d7272..09d14a9b 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h
@@ -43,7 +43,7 @@ class FixedBlockMemoryAllocator;
class ShaderVkImpl : public ShaderBase<IShaderVk, IRenderDeviceVk>
{
public:
- typedef ShaderBase<IShaderVk, IRenderDeviceVk> TShaderBase;
+ using TShaderBase = ShaderBase<IShaderVk, IRenderDeviceVk>;
ShaderVkImpl(IReferenceCounters* pRefCounters, class RenderDeviceVkImpl* pRenderDeviceVk, const ShaderCreationAttribs &CreationAttribs);
~ShaderVkImpl();
diff --git a/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h b/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h
index 018e1eb8..dcb62ab5 100644
--- a/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h
@@ -40,7 +40,8 @@ class IMemoryAllocator;
class SwapChainVkImpl : public SwapChainBase<ISwapChainVk>
{
public:
- typedef SwapChainBase<ISwapChainVk> TSwapChainBase;
+ using TSwapChainBase = SwapChainBase<ISwapChainVk>;
+
SwapChainVkImpl(IReferenceCounters* pRefCounters,
const SwapChainDesc& SwapChainDesc,
class RenderDeviceVkImpl* pRenderDeviceVk,
diff --git a/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h b/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h
index 63d66ac0..9863d6aa 100644
--- a/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h
@@ -39,7 +39,7 @@ class FixedBlockMemoryAllocator;
class TextureViewVkImpl : public TextureViewBase<ITextureViewVk>
{
public:
- typedef TextureViewBase<ITextureViewVk> TTextureViewBase;
+ using TTextureViewBase = TextureViewBase<ITextureViewVk>;
TextureViewVkImpl( IReferenceCounters* pRefCounters,
IRenderDevice* pDevice,
diff --git a/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h b/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h
index 660dd151..825a5f44 100644
--- a/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h
+++ b/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h
@@ -41,7 +41,7 @@ class FixedBlockMemoryAllocator;
class TextureVkImpl : public TextureBase<ITextureVk, TextureViewVkImpl, FixedBlockMemoryAllocator>
{
public:
- typedef TextureBase<ITextureVk, TextureViewVkImpl, FixedBlockMemoryAllocator> TTextureBase;
+ using TTextureBase = TextureBase<ITextureVk, TextureViewVkImpl, FixedBlockMemoryAllocator>;
// Creates a new Vk resource
TextureVkImpl(IReferenceCounters* pRefCounters,
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
index 1c8352d6..b4cd4dc9 100644
--- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
@@ -264,11 +264,10 @@ namespace Diligent
void DeviceContextVkImpl::CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, Uint32 Flags)
{
- if (!DeviceContextBase::CommitShaderResources<PipelineStateVkImpl>(pShaderResourceBinding, Flags, 0 /*Dummy*/))
+ if (!DeviceContextBase::CommitShaderResources(pShaderResourceBinding, Flags, 0 /*Dummy*/))
return;
- auto *pPipelineStateVk = m_pPipelineState.RawPtr<PipelineStateVkImpl>();
- pPipelineStateVk->CommitAndTransitionShaderResources(pShaderResourceBinding, this, true, Flags, &m_DesrSetBindInfo);
+ m_pPipelineState->CommitAndTransitionShaderResources(pShaderResourceBinding, this, true, Flags, &m_DesrSetBindInfo);
}
void DeviceContextVkImpl::SetStencilRef(Uint32 StencilRef)
@@ -304,9 +303,8 @@ namespace Diligent
void DeviceContextVkImpl::CommitVkVertexBuffers()
{
#ifdef DEVELOPMENT
- auto *pPipelineStateVk = m_pPipelineState.RawPtr<PipelineStateVkImpl>();
- if (m_NumVertexStreams < pPipelineStateVk->GetNumBufferSlotsUsed())
- LOG_ERROR("Currently bound pipeline state \"", pPipelineStateVk->GetDesc().Name, "\" expects ", pPipelineStateVk->GetNumBufferSlotsUsed(), " input buffer slots, but only ", m_NumVertexStreams, " is bound");
+ if (m_NumVertexStreams < m_pPipelineState->GetNumBufferSlotsUsed())
+ LOG_ERROR("Currently bound pipeline state \"", m_pPipelineState->GetDesc().Name, "\" expects ", m_pPipelineState->GetNumBufferSlotsUsed(), " input buffer slots, but only ", m_NumVertexStreams, " is bound");
#endif
// Do not initialize array with zeroes for performance reasons
VkBuffer vkVertexBuffers[MaxBufferSlots];// = {}
@@ -399,7 +397,7 @@ namespace Diligent
}
#endif
- auto *pPipelineStateVk = m_pPipelineState.RawPtr<PipelineStateVkImpl>();
+ auto *pPipelineStateVk = m_pPipelineState.RawPtr();
EnsureVkCmdBuffer();
@@ -507,7 +505,7 @@ namespace Diligent
}
#endif
- auto *pPipelineStateVk = m_pPipelineState.RawPtr<PipelineStateVkImpl>();
+ auto *pPipelineStateVk = m_pPipelineState.RawPtr();
EnsureVkCmdBuffer();