diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-05-29 04:16:33 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-05-29 04:16:33 +0000 |
| commit | 60e2802464102539b3e0302aa899e22b43b97c0b (patch) | |
| tree | 5a7f854bdcc4ac9d2da616060d33d60816e99965 /Graphics/GraphicsEngineOpenGL | |
| parent | Fixed issue with storage buffer not being bound through UAV in Vulkan; fixed ... (diff) | |
| download | DiligentCore-60e2802464102539b3e0302aa899e22b43b97c0b.tar.gz DiligentCore-60e2802464102539b3e0302aa899e22b43b97c0b.zip | |
Moved vertex buffer stride definition from IDeviceContext::SetVertexBuffers() to vertex layout description
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h | 2 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp | 4 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp | 6 |
3 files changed, 6 insertions, 6 deletions
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<const BufferGLImpl*>( pBuff ); |
