From 60e2802464102539b3e0302aa899e22b43b97c0b Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Mon, 28 May 2018 21:16:33 -0700 Subject: Moved vertex buffer stride definition from IDeviceContext::SetVertexBuffers() to vertex layout description --- Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h | 2 +- Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp | 4 ++-- Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h index 5a4a80fc..3a28312a 100644 --- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h @@ -53,7 +53,7 @@ public: virtual void SetBlendFactors(const float* pBlendFactors = nullptr)override final; - virtual void SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pStrides, Uint32 *pOffsets, Uint32 Flags )override final; + virtual void SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pOffsets, Uint32 Flags )override final; virtual void InvalidateState()override final; diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index 41592b37..3618354b 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -159,9 +159,9 @@ namespace Diligent } } - void DeviceContextGLImpl::SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pStrides, Uint32 *pOffsets, Uint32 Flags ) + void DeviceContextGLImpl::SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pOffsets, Uint32 Flags ) { - TDeviceContextBase::SetVertexBuffers( StartSlot, NumBuffersSet, ppBuffers, pStrides, pOffsets, Flags ); + TDeviceContextBase::SetVertexBuffers( StartSlot, NumBuffersSet, ppBuffers, pOffsets, Flags ); m_bVAOIsUpToDate = false; } diff --git a/Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp b/Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp index 13fbdc4c..18ad1ff8 100644 --- a/Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp @@ -90,7 +90,7 @@ const GLObjectWrappers::GLVertexArrayObj& VAOCache::GetVAO( IPipelineState *pPSO const auto &InputLayout = pPSOGL->GetDesc().GraphicsPipeline.InputLayout; const LayoutElement *LayoutElems = InputLayout.LayoutElements; Uint32 NumElems = InputLayout.NumElements; - const Uint32 *TightStrides = pPSOGL->GetTightStrides(); + const Uint32 *Strides = pPSOGL->GetBufferStrides(); // Construct the key VAOCacheKey Key(pPSO, pIndexBuffer); @@ -115,7 +115,7 @@ const GLObjectWrappers::GLVertexArrayObj& VAOCache::GetVAO( IPipelineState *pPSO Key.NumUsedSlots = MaxUsedSlot; auto &CurrStream = VertexStreams[BuffSlot]; - auto Stride = CurrStream.Stride ? CurrStream.Stride : TightStrides[BuffSlot]; + auto Stride = Strides[BuffSlot]; auto &pCurrBuf = VertexBuffers[BuffSlot]; auto &CurrStreamKey = Key.Streams[BuffSlot]; if (pCurrBuf == nullptr) @@ -179,7 +179,7 @@ const GLObjectWrappers::GLVertexArrayObj& VAOCache::GetVAO( IPipelineState *pPSO // Get buffer through the strong reference. Note that we are not // using pointers stored in the key for safety auto &CurrStream = VertexStreams[BuffSlot]; - auto Stride = CurrStream.Stride ? CurrStream.Stride : TightStrides[BuffSlot]; + auto Stride = Strides[BuffSlot]; auto *pBuff = VertexBuffers[BuffSlot]; VERIFY( pBuff != nullptr, "Vertex buffer is null" ); const BufferGLImpl *pBufferOGL = static_cast( pBuff ); -- cgit v1.2.3