From 9e567836f3e63c541cde7b0a02fd2fc7916402c8 Mon Sep 17 00:00:00 2001 From: azhirnov Date: Sun, 4 Oct 2020 23:22:16 +0300 Subject: Added dummy implementation for D3D11, D3D12, OpenGL --- .../include/DeviceContextGLImpl.hpp | 15 +++++++++++++ .../include/RenderDeviceGLImpl.hpp | 12 +++++++++++ .../src/DeviceContextGLImpl.cpp | 25 ++++++++++++++++++++++ .../src/RenderDeviceGLImpl.cpp | 23 +++++++++++++++++++- 4 files changed, 74 insertions(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp index 205c62b7..8f1b4c37 100644 --- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp +++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp @@ -243,6 +243,21 @@ public: /// Implementation of IDeviceContext::Flush() in OpenGL backend. virtual void DILIGENT_CALL_TYPE Flush() override final; + /// Implementation of IDeviceContext::BuildBLAS() in OpenGL backend. + virtual void DILIGENT_CALL_TYPE BuildBLAS(const BLASBuildAttribs& Attribs) override final; + + /// Implementation of IDeviceContext::BuildTLAS() in OpenGL backend. + virtual void DILIGENT_CALL_TYPE BuildTLAS(const TLASBuildAttribs& Attribs) override final; + + /// Implementation of IDeviceContext::CopyBLAS() in OpenGL backend. + virtual void DILIGENT_CALL_TYPE CopyBLAS(const CopyBLASAttribs& Attribs) override final; + + /// Implementation of IDeviceContext::CopyTLAS() in OpenGL backend. + virtual void DILIGENT_CALL_TYPE CopyTLAS(const CopyTLASAttribs& Attribs) override final; + + /// Implementation of IDeviceContext::TraceRays() in OpenGL backend. + virtual void DILIGENT_CALL_TYPE TraceRays(const TraceRaysAttribs& Attribs) override final; + /// Implementation of IDeviceContextGL::UpdateCurrentGLContext(). virtual bool DILIGENT_CALL_TYPE UpdateCurrentGLContext() override final; diff --git a/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.hpp b/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.hpp index afb46edb..be2b4ddc 100644 --- a/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.hpp +++ b/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.hpp @@ -107,6 +107,18 @@ public: virtual void DILIGENT_CALL_TYPE CreateFramebuffer(const FramebufferDesc& Desc, IFramebuffer** ppFramebuffer) override final; + /// Implementation of IRenderDevice::CreateBLAS() in OpenGL backend. + virtual void DILIGENT_CALL_TYPE CreateBLAS(const BottomLevelASDesc& Desc, + IBottomLevelAS** ppBLAS) override final; + + /// Implementation of IRenderDevice::CreateTLAS() in OpenGL backend. + virtual void DILIGENT_CALL_TYPE CreateTLAS(const TopLevelASDesc& Desc, + ITopLevelAS** ppTLAS) override final; + + /// Implementation of IRenderDevice::CreateSBT() in OpenGL backend. + virtual void DILIGENT_CALL_TYPE CreateSBT(const ShaderBindingTableDesc& Desc, + IShaderBindingTable** ppSBT) override final; + /// Implementation of IRenderDeviceGL::CreateTextureFromGLHandle(). virtual void DILIGENT_CALL_TYPE CreateTextureFromGLHandle(Uint32 GLHandle, Uint32 GLBindTarget, diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index f4ef1136..deea5ade 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -1720,4 +1720,29 @@ void DeviceContextGLImpl::ResolveTextureSubresource(ITexture* CommitRenderTargets(); } +void DeviceContextGLImpl::BuildBLAS(const BLASBuildAttribs& Attribs) +{ + UNSUPPORTED("BuildBLAS is not supported in OpenGL"); +} + +void DeviceContextGLImpl::BuildTLAS(const TLASBuildAttribs& Attribs) +{ + UNSUPPORTED("BuildTLAS is not supported in OpenGL"); +} + +void DeviceContextGLImpl::CopyBLAS(const CopyBLASAttribs& Attribs) +{ + UNSUPPORTED("CopyBLAS is not supported in OpenGL"); +} + +void DeviceContextGLImpl::CopyTLAS(const CopyTLASAttribs& Attribs) +{ + UNSUPPORTED("CopyTLAS is not supported in OpenGL"); +} + +void DeviceContextGLImpl::TraceRays(const TraceRaysAttribs& Attribs) +{ + UNSUPPORTED("TraceRays is not supported in OpenGL"); +} + } // namespace Diligent diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp index 466f1387..a4c8a35a 100644 --- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp @@ -456,7 +456,7 @@ RenderDeviceGLImpl::RenderDeviceGLImpl(IReferenceCounters* pRefCounters, #undef SET_FEATURE_STATE #if defined(_MSC_VER) && defined(_WIN64) - static_assert(sizeof(DeviceFeatures) == 30, "Did you add a new feature to DeviceFeatures? Please handle its satus here."); + static_assert(sizeof(DeviceFeatures) == 31, "Did you add a new feature to DeviceFeatures? Please handle its satus here."); #endif } @@ -769,6 +769,27 @@ void RenderDeviceGLImpl::CreateFramebuffer(const FramebufferDesc& Desc, IFramebu }); } +void RenderDeviceGLImpl::CreateBLAS(const BottomLevelASDesc& Desc, + IBottomLevelAS** ppBLAS) +{ + UNSUPPORTED("CreateBLAS is not supported in OpenGL"); + *ppBLAS = nullptr; +} + +void RenderDeviceGLImpl::CreateTLAS(const TopLevelASDesc& Desc, + ITopLevelAS** ppTLAS) +{ + UNSUPPORTED("CreateTLAS is not supported in OpenGL"); + *ppTLAS = nullptr; +} + +void RenderDeviceGLImpl::CreateSBT(const ShaderBindingTableDesc& Desc, + IShaderBindingTable** ppSBT) +{ + UNSUPPORTED("CreateSBT is not supported in OpenGL"); + *ppSBT = nullptr; +} + bool RenderDeviceGLImpl::CheckExtension(const Char* ExtensionString) { return m_ExtensionStrings.find(ExtensionString) != m_ExtensionStrings.end(); -- cgit v1.2.3 From 73fd82a29d3175e156754010f5de261d6f561f16 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sun, 4 Oct 2020 16:59:33 -0700 Subject: A few random fixes to ray tracing API and implementation --- Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp index a4c8a35a..b7bdf993 100644 --- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp @@ -310,6 +310,7 @@ RenderDeviceGLImpl::RenderDeviceGLImpl(IReferenceCounters* pRefCounters, SET_FEATURE_STATE(VertexPipelineUAVWritesAndAtomics, false, "Vertex pipeline UAV writes and atomics are"); SET_FEATURE_STATE(MeshShaders, false, "Mesh shaders are"); + SET_FEATURE_STATE(RayTracing, false, "Ray tracing is"); { bool WireframeFillSupported = (glPolygonMode != nullptr); -- cgit v1.2.3 From 7f26e40e0898391a32e6a05d91ef1a217d885668 Mon Sep 17 00:00:00 2001 From: azhirnov Date: Sun, 25 Oct 2020 15:53:05 +0300 Subject: PSO refactoring for ray tracing --- Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.hpp | 4 ++++ Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp | 2 ++ Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp | 6 ++++++ 3 files changed, 12 insertions(+) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.hpp b/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.hpp index 3c34b483..23c0fc9c 100644 --- a/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.hpp +++ b/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.hpp @@ -94,6 +94,10 @@ public: virtual void DILIGENT_CALL_TYPE CreateComputePipelineState(const ComputePipelineStateCreateInfo& PSOCreateInfo, IPipelineState** ppPipelineState) override final; + /// Implementation of IRenderDevice::CreateRayTracingPipelineState() in OpenGL backend. + virtual void DILIGENT_CALL_TYPE CreateRayTracingPipelineState(const RayTracingPipelineStateCreateInfo& PSOCreateInfo, + IPipelineState** ppPipelineState) override final; + void CreateGraphicsPipelineState(const GraphicsPipelineStateCreateInfo& PSOCreateInfo, IPipelineState** ppPipelineState, bool bIsDeviceInternal); diff --git a/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp index 8b429094..b911cdde 100644 --- a/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp @@ -154,6 +154,8 @@ PipelineStateGLImpl::~PipelineStateGLImpl() void PipelineStateGLImpl::Destruct() { + TPipelineStateBase::Destruct(); + auto& RawAllocator = GetRawAllocator(); m_StaticResourceCache.Destroy(RawAllocator); GetDevice()->OnDestroyPSO(this); diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp index ca75a9ca..7707f979 100644 --- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp @@ -736,6 +736,12 @@ void RenderDeviceGLImpl::CreateComputePipelineState(const ComputePipelineStateCr return CreateComputePipelineState(PSOCreateInfo, ppPipelineState, false); } +void RenderDeviceGLImpl::CreateRayTracingPipelineState(const RayTracingPipelineStateCreateInfo& PSOCreateInfo, IPipelineState** ppPipelineState) +{ + UNSUPPORTED("CreateRayTracingPipelineState is not supported in OpenGL"); + *ppPipelineState = nullptr; +} + void RenderDeviceGLImpl::CreateFence(const FenceDesc& Desc, IFence** ppFence) { CreateDeviceObject( -- cgit v1.2.3 From f8be662d357be9dcbb4b298d93b43d29ae93ce04 Mon Sep 17 00:00:00 2001 From: assiduous Date: Tue, 27 Oct 2020 19:08:28 -0700 Subject: A number of updates/fixes to PSO refactor merge --- Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp index 7707f979..c55b958f 100644 --- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp @@ -149,13 +149,18 @@ RenderDeviceGLImpl::RenderDeviceGLImpl(IReferenceCounters* pRefCounters, sizeof(FenceGLImpl), sizeof(QueryGLImpl), sizeof(RenderPassGLImpl), - sizeof(FramebufferGLImpl) + sizeof(FramebufferGLImpl), + 0, + 0, + 0 } }, // Device caps must be filled in before the constructor of Pipeline Cache is called! m_GLContext{InitAttribs, m_DeviceCaps, pSCDesc} // clang-format on { + static_assert(sizeof(DeviceObjectSizes) == sizeof(size_t) * 15, "Please add new objects to DeviceObjectSizes constructor"); + GLint NumExtensions = 0; glGetIntegerv(GL_NUM_EXTENSIONS, &NumExtensions); CHECK_GL_ERROR("Failed to get the number of extensions"); @@ -738,7 +743,7 @@ void RenderDeviceGLImpl::CreateComputePipelineState(const ComputePipelineStateCr void RenderDeviceGLImpl::CreateRayTracingPipelineState(const RayTracingPipelineStateCreateInfo& PSOCreateInfo, IPipelineState** ppPipelineState) { - UNSUPPORTED("CreateRayTracingPipelineState is not supported in OpenGL"); + UNSUPPORTED("Ray tracing is not supported in OpenGL"); *ppPipelineState = nullptr; } -- cgit v1.2.3 From 135d5dc6743fc89d7a19c539fa06eca33506f51b Mon Sep 17 00:00:00 2001 From: azhirnov Date: Wed, 28 Oct 2020 19:33:03 +0300 Subject: added ray tracing implementation for dx12 and vulkan --- Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp index 8f1b4c37..0b2154e6 100644 --- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp +++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp @@ -40,6 +40,8 @@ #include "FramebufferGLImpl.hpp" #include "RenderPassGLImpl.hpp" #include "PipelineStateGLImpl.hpp" +#include "BottomLevelASBase.hpp" +#include "TopLevelASBase.hpp" namespace Diligent { @@ -53,6 +55,8 @@ struct DeviceContextGLImplTraits using QueryType = QueryGLImpl; using FramebufferType = FramebufferGLImpl; using RenderPassType = RenderPassGLImpl; + using BottomLevelASType = BottomLevelASBase; + using TopLevelASType = TopLevelASBase; }; /// Device context implementation in OpenGL backend. -- cgit v1.2.3 From efa43e2bd2475a4dec6771bf9759f6a99f7d77ed Mon Sep 17 00:00:00 2001 From: azhirnov Date: Tue, 3 Nov 2020 13:52:24 +0300 Subject: fixed resource state transitions, some improvements for ray tracing --- Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp index 0b2154e6..32055367 100644 --- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp +++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp @@ -56,7 +56,7 @@ struct DeviceContextGLImplTraits using FramebufferType = FramebufferGLImpl; using RenderPassType = RenderPassGLImpl; using BottomLevelASType = BottomLevelASBase; - using TopLevelASType = TopLevelASBase; + using TopLevelASType = TopLevelASBase; }; /// Device context implementation in OpenGL backend. -- cgit v1.2.3 From 5e81b867be771dc7f2add0d7b403af4aeaa744db Mon Sep 17 00:00:00 2001 From: azhirnov Date: Thu, 5 Nov 2020 03:43:05 +0300 Subject: Added AS copy with compacting. Added UB & SB size checks for Vulkan. Some improvements for ray tracing & tests. --- Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp | 6 ++++++ Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp | 10 ++++++++++ 2 files changed, 16 insertions(+) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp index 32055367..b851a017 100644 --- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp +++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp @@ -259,6 +259,12 @@ public: /// Implementation of IDeviceContext::CopyTLAS() in OpenGL backend. virtual void DILIGENT_CALL_TYPE CopyTLAS(const CopyTLASAttribs& Attribs) override final; + /// Implementation of IDeviceContext::WriteBLASCompactedSize() in OpenGL backend. + virtual void DILIGENT_CALL_TYPE WriteBLASCompactedSize(const WriteBLASCompactedSizeAttribs& Attribs) override final; + + /// Implementation of IDeviceContext::WriteTLASCompactedSize() in OpenGL backend. + virtual void DILIGENT_CALL_TYPE WriteTLASCompactedSize(const WriteTLASCompactedSizeAttribs& Attribs) override final; + /// Implementation of IDeviceContext::TraceRays() in OpenGL backend. virtual void DILIGENT_CALL_TYPE TraceRays(const TraceRaysAttribs& Attribs) override final; diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index 7b09f9ce..8fdb05b6 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -1740,6 +1740,16 @@ void DeviceContextGLImpl::CopyTLAS(const CopyTLASAttribs& Attribs) UNSUPPORTED("CopyTLAS is not supported in OpenGL"); } +void DeviceContextGLImpl::WriteBLASCompactedSize(const WriteBLASCompactedSizeAttribs& Attribs) +{ + UNSUPPORTED("WriteBLASCompactedSize is not supported in OpenGL"); +} + +void DeviceContextGLImpl::WriteTLASCompactedSize(const WriteTLASCompactedSizeAttribs& Attribs) +{ + UNSUPPORTED("WriteTLASCompactedSize is not supported in OpenGL"); +} + void DeviceContextGLImpl::TraceRays(const TraceRaysAttribs& Attribs) { UNSUPPORTED("TraceRays is not supported in OpenGL"); -- cgit v1.2.3 From 8e0218168e2f63812f658298b3571c53879a5780 Mon Sep 17 00:00:00 2001 From: azhirnov Date: Thu, 5 Nov 2020 19:58:57 +0300 Subject: Added support for local root signature & shader record. Bug fix for ray tracing. --- Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp | 4 ++-- Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp index b851a017..a128c7c7 100644 --- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp +++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp @@ -248,10 +248,10 @@ public: virtual void DILIGENT_CALL_TYPE Flush() override final; /// Implementation of IDeviceContext::BuildBLAS() in OpenGL backend. - virtual void DILIGENT_CALL_TYPE BuildBLAS(const BLASBuildAttribs& Attribs) override final; + virtual void DILIGENT_CALL_TYPE BuildBLAS(const BuildBLASAttribs& Attribs) override final; /// Implementation of IDeviceContext::BuildTLAS() in OpenGL backend. - virtual void DILIGENT_CALL_TYPE BuildTLAS(const TLASBuildAttribs& Attribs) override final; + virtual void DILIGENT_CALL_TYPE BuildTLAS(const BuildTLASAttribs& Attribs) override final; /// Implementation of IDeviceContext::CopyBLAS() in OpenGL backend. virtual void DILIGENT_CALL_TYPE CopyBLAS(const CopyBLASAttribs& Attribs) override final; diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index 8fdb05b6..4ff89506 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -1720,12 +1720,12 @@ void DeviceContextGLImpl::ResolveTextureSubresource(ITexture* CommitRenderTargets(); } -void DeviceContextGLImpl::BuildBLAS(const BLASBuildAttribs& Attribs) +void DeviceContextGLImpl::BuildBLAS(const BuildBLASAttribs& Attribs) { UNSUPPORTED("BuildBLAS is not supported in OpenGL"); } -void DeviceContextGLImpl::BuildTLAS(const TLASBuildAttribs& Attribs) +void DeviceContextGLImpl::BuildTLAS(const BuildTLASAttribs& Attribs) { UNSUPPORTED("BuildTLAS is not supported in OpenGL"); } -- cgit v1.2.3 From db5cfe224b9ff00234b29ff097262bc7377b90c4 Mon Sep 17 00:00:00 2001 From: assiduous Date: Thu, 5 Nov 2020 21:43:17 -0800 Subject: Refactored BufferBase --- Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp index ac99cfa0..97d7ddb7 100644 --- a/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp @@ -383,7 +383,7 @@ void BufferGLImpl::CreateViewInternal(const BufferViewDesc& OrigViewDesc, IBuffe try { auto ViewDesc = OrigViewDesc; - CorrectBufferViewDesc(ViewDesc); + ValidateAndCorrectBufferViewDesc(m_Desc, ViewDesc); auto* pDeviceGLImpl = GetDevice(); auto& BuffViewAllocator = pDeviceGLImpl->GetBuffViewObjAllocator(); -- cgit v1.2.3 From 4de58520987882e1daa162e31cabca3f334c20a8 Mon Sep 17 00:00:00 2001 From: assiduous Date: Thu, 5 Nov 2020 22:46:17 -0800 Subject: Refactored TextureBase --- Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp b/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp index 243ab1c9..77e681f7 100644 --- a/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp @@ -359,7 +359,7 @@ void TextureBaseGL::CreateViewInternal(const struct TextureViewDesc& OrigViewDes try { auto ViewDesc = OrigViewDesc; - CorrectTextureViewDesc(ViewDesc); + ValidatedAndCorrectTextureViewDesc(m_Desc, ViewDesc); auto* pDeviceGLImpl = GetDevice(); auto& TexViewAllocator = pDeviceGLImpl->GetTexViewObjAllocator(); @@ -598,7 +598,7 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL, TextureViewDesc SRVDesc; SRVDesc.TextureDim = SrcTexDesc.Type; SRVDesc.ViewType = TEXTURE_VIEW_SHADER_RESOURCE; - CorrectTextureViewDesc(SRVDesc); + ValidatedAndCorrectTextureViewDesc(m_Desc, SRVDesc); // Note: texture view allocates memory for the copy of the name // If the name is empty, memory should not be allocated // We have to provide allocator even though it will never be used @@ -617,7 +617,7 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL, RTVDesc.FirstArraySlice = DepthSlice + DstSlice; RTVDesc.MostDetailedMip = DstMipLevel; RTVDesc.NumArraySlices = 1; - CorrectTextureViewDesc(RTVDesc); + ValidatedAndCorrectTextureViewDesc(m_Desc, RTVDesc); // Note: texture view allocates memory for the copy of the name // If the name is empty, memory should not be allocated // We have to provide allocator even though it will never be used -- cgit v1.2.3 From 43c3821993cb3d6ec3025fa7156da8544d2a1dac Mon Sep 17 00:00:00 2001 From: azhirnov Date: Mon, 16 Nov 2020 20:30:23 +0300 Subject: D3D12 resource binding refactoring, rename LinearAllocator to FixedLinearAllocator. --- Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.hpp | 2 +- Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.hpp b/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.hpp index 93180774..0635313d 100644 --- a/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.hpp +++ b/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.hpp @@ -112,7 +112,7 @@ private: void Initialize(const PSOCreateInfoType& CreateInfo, const std::vector& ShaderStages); void InitResourceLayouts(const std::vector& ShaderStages, - LinearAllocator& MemPool); + FixedLinearAllocator& MemPool); void Destruct(); diff --git a/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp index 32be5dfc..b8c0a7c0 100644 --- a/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp @@ -40,7 +40,7 @@ namespace Diligent template void PipelineStateGLImpl::Initialize(const PSOCreateInfoType& CreateInfo, const std::vector& ShaderStages) { - LinearAllocator MemPool{GetRawAllocator()}; + FixedLinearAllocator MemPool{GetRawAllocator()}; VERIFY_EXPR(m_NumShaderStages > 0 && m_NumShaderStages == ShaderStages.size()); if (!GetDevice()->GetDeviceCaps().Features.SeparablePrograms) m_NumShaderStages = 1; @@ -190,7 +190,7 @@ IMPLEMENT_QUERY_INTERFACE(PipelineStateGLImpl, IID_PipelineStateGL, TPipelineSta void PipelineStateGLImpl::InitResourceLayouts(const std::vector& ShaderStages, - LinearAllocator& MemPool) + FixedLinearAllocator& MemPool) { auto* const pDeviceGL = GetDevice(); const auto& deviceCaps = pDeviceGL->GetDeviceCaps(); -- cgit v1.2.3