From 946884fb264969aa03e5d266d2349c8a74e5cf55 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Tue, 24 Jul 2018 21:45:59 -0700 Subject: Updated VertexStreamInfo to use final buffer implementation type --- Graphics/GraphicsEngine/include/DeviceContextBase.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.h b/Graphics/GraphicsEngine/include/DeviceContextBase.h index 1a291a10..037e6ba4 100644 --- a/Graphics/GraphicsEngine/include/DeviceContextBase.h +++ b/Graphics/GraphicsEngine/include/DeviceContextBase.h @@ -41,10 +41,11 @@ namespace Diligent { /// Describes input vertex stream +template struct VertexStreamInfo { /// Strong reference to the buffer object - RefCntAutoPtr pBuffer; + RefCntAutoPtr pBuffer; Uint32 Offset = 0; ///< Offset in bytes }; @@ -149,7 +150,7 @@ protected: RefCntAutoPtr m_pSwapChain; /// Vertex streams. Every stream holds strong reference to the buffer - VertexStreamInfo m_VertexStreams[MaxBufferSlots]; + VertexStreamInfo m_VertexStreams[MaxBufferSlots]; /// Number of bound vertex streams Uint32 m_NumVertexStreams = 0; @@ -227,9 +228,9 @@ inline void DeviceContextBase{}; for (Uint32 s = StartSlot + NumBuffersSet; s < m_NumVertexStreams; ++s) - m_VertexStreams[s] = VertexStreamInfo{}; + m_VertexStreams[s] = VertexStreamInfo{}; m_NumVertexStreams = 0; } m_NumVertexStreams = std::max(m_NumVertexStreams, StartSlot + NumBuffersSet ); @@ -237,7 +238,7 @@ inline void DeviceContextBase(ppBuffers[Buff]) : nullptr; CurrStream.Offset = pOffsets ? pOffsets[Buff] : 0; #ifdef DEVELOPMENT if ( CurrStream.pBuffer ) @@ -252,7 +253,7 @@ inline void DeviceContextBase 0 && !m_VertexStreams[m_NumVertexStreams-1].pBuffer) - m_VertexStreams[m_NumVertexStreams--] = VertexStreamInfo{}; + m_VertexStreams[m_NumVertexStreams--] = VertexStreamInfo{}; } template @@ -566,7 +567,7 @@ template :: ClearStateCache() { for(Uint32 stream=0; stream < m_NumVertexStreams; ++stream) - m_VertexStreams[stream] = VertexStreamInfo(); + m_VertexStreams[stream] = VertexStreamInfo{}; #ifdef _DEBUG for(Uint32 stream=m_NumVertexStreams; stream < _countof(m_VertexStreams); ++stream) { -- cgit v1.2.3