diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-10-30 21:18:45 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-10-30 21:18:45 +0000 |
| commit | 076e2f20ce80ef9ea6ccb351c2bfdc3b99ac8015 (patch) | |
| tree | c750936f9e5cb8a3bb2743d8497b287245e596b3 /Graphics/GraphicsEngine | |
| parent | Added include tests for BLAS, TLAS and SBT headers, fixed few issues (diff) | |
| download | DiligentCore-076e2f20ce80ef9ea6ccb351c2bfdc3b99ac8015.tar.gz DiligentCore-076e2f20ce80ef9ea6ccb351c2bfdc3b99ac8015.zip | |
A number of minor updates
Diffstat (limited to 'Graphics/GraphicsEngine')
5 files changed, 24 insertions, 16 deletions
diff --git a/Graphics/GraphicsEngine/include/BottomLevelASBase.hpp b/Graphics/GraphicsEngine/include/BottomLevelASBase.hpp index 9f37fb3f..41f2fdf3 100644 --- a/Graphics/GraphicsEngine/include/BottomLevelASBase.hpp +++ b/Graphics/GraphicsEngine/include/BottomLevelASBase.hpp @@ -133,6 +133,7 @@ public: } this->m_Desc.pBoxes = pBoxes.release(); } + VERIFY_EXPR(m_StringPool.GetRemainingSize() == 0); } ~BottomLevelASBase() diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.hpp b/Graphics/GraphicsEngine/include/DeviceContextBase.hpp index 0d98bae3..829416d2 100644 --- a/Graphics/GraphicsEngine/include/DeviceContextBase.hpp +++ b/Graphics/GraphicsEngine/include/DeviceContextBase.hpp @@ -1811,10 +1811,7 @@ void DeviceContextBase<BaseInterface, ImplementationTraits>:: DEV_CHECK_ERR(Barrier.NewState != RESOURCE_STATE_UNKNOWN, "New resource state can't be unknown"); RESOURCE_STATE OldState = RESOURCE_STATE_UNKNOWN; - RefCntAutoPtr<ITexture> pTexture{Barrier.pResource, IID_Texture}; - RefCntAutoPtr<IBuffer> pBuffer{Barrier.pResource, IID_Buffer}; - - if (pTexture) + if (RefCntAutoPtr<ITexture> pTexture{Barrier.pResource, IID_Texture}) { const auto& TexDesc = pTexture->GetDesc(); @@ -1850,7 +1847,7 @@ void DeviceContextBase<BaseInterface, ImplementationTraits>:: "Failed to transition texture '", TexDesc.Name, "': only whole resources can be transitioned on this device"); } } - else if (pBuffer) + else if (RefCntAutoPtr<IBuffer> pBuffer{Barrier.pResource, IID_Buffer}) { const auto& BuffDesc = pBuffer->GetDesc(); DEV_CHECK_ERR(VerifyResourceStates(Barrier.NewState, false), "Invlaid new state specified for buffer '", BuffDesc.Name, "'"); @@ -1858,6 +1855,14 @@ void DeviceContextBase<BaseInterface, ImplementationTraits>:: DEV_CHECK_ERR(OldState != RESOURCE_STATE_UNKNOWN, "The state of buffer '", BuffDesc.Name, "' is unknown to the engine and is not explicitly specified in the barrier"); DEV_CHECK_ERR(VerifyResourceStates(OldState, false), "Invlaid old state specified for buffer '", BuffDesc.Name, "'"); } + else if (RefCntAutoPtr<IBottomLevelAS> pBLAS{Barrier.pResource, IID_BottomLevelAS}) + { + // AZ TODO + } + else if (RefCntAutoPtr<ITopLevelAS> pTLAS{Barrier.pResource, IID_TopLevelAS}) + { + // AZ TODO + } else { UNEXPECTED("unsupported resource type"); @@ -2147,7 +2152,7 @@ bool DeviceContextBase<BaseInterface, ImplementationTraits>::BuildTLAS(const TLA if (Attribs.pInstanceBuffer == nullptr) { - LOG_ERROR_MESSAGE("IDeviceContext::BuildTLAS: pInstanceaBuffer must not be null"); + LOG_ERROR_MESSAGE("IDeviceContext::BuildTLAS: pInstanceBuffer must not be null"); return false; } diff --git a/Graphics/GraphicsEngine/interface/DeviceContext.h b/Graphics/GraphicsEngine/interface/DeviceContext.h index 04ff3030..35e17e91 100644 --- a/Graphics/GraphicsEngine/interface/DeviceContext.h +++ b/Graphics/GraphicsEngine/interface/DeviceContext.h @@ -743,6 +743,7 @@ DILIGENT_TYPED_ENUM(RAYTRACING_INSTANCE_FLAGS, Uint8) RAYTRACING_INSTANCE_FLAGS_LAST = 0x08 }; +DEFINE_FLAG_ENUM_OPERATORS(RAYTRACING_INSTANCE_FLAGS) /// AZ TODO DILIGENT_TYPED_ENUM(COPY_AS_MODE, Uint8) @@ -1145,7 +1146,7 @@ struct StateTransitionDesc RESOURCE_STATE _OldState, RESOURCE_STATE _NewState, bool _UpdateState)noexcept : - pResource {static_cast<IDeviceObject*>(_pBuffer)}, + pResource {_pBuffer }, OldState {_OldState }, NewState {_NewState }, UpdateResourceState {_UpdateState} @@ -1155,7 +1156,7 @@ struct StateTransitionDesc RESOURCE_STATE _OldState, RESOURCE_STATE _NewState, bool _UpdateState)noexcept : - pResource {static_cast<IDeviceObject*>(_pBLAS)}, + pResource {_pBLAS }, OldState {_OldState }, NewState {_NewState }, UpdateResourceState {_UpdateState} @@ -1165,7 +1166,7 @@ struct StateTransitionDesc RESOURCE_STATE _OldState, RESOURCE_STATE _NewState, bool _UpdateState)noexcept : - pResource {static_cast<IDeviceObject*>(_pTLAS)}, + pResource {_pTLAS }, OldState {_OldState }, NewState {_NewState }, UpdateResourceState {_UpdateState} diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h index 093039bd..00d91725 100644 --- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h +++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h @@ -83,7 +83,8 @@ DILIGENT_TYPED_ENUM(BIND_FLAGS, Uint32) BIND_UNORDERED_ACCESS = 0x80L, ///< A buffer or a texture can be bound as an unordered access view BIND_INDIRECT_DRAW_ARGS = 0x100L, ///< A buffer can be bound as the source buffer for indirect draw commands BIND_INPUT_ATTACHMENT = 0x200L, ///< A texture can be used as render pass input attachment - BIND_RAY_TRACING = 0x400L, ///< A buffer can be used as scratch buffer for acceleration structure building. + BIND_RAY_TRACING = 0x400L, ///< A buffer can be used as a scratch buffer or as the source of primitive data + /// for acceleration structure building BIND_FLAGS_LAST = 0x400L }; DEFINE_FLAG_ENUM_OPERATORS(BIND_FLAGS) diff --git a/Graphics/GraphicsEngine/interface/PipelineState.h b/Graphics/GraphicsEngine/interface/PipelineState.h index 3afa83f2..4115a9d1 100644 --- a/Graphics/GraphicsEngine/interface/PipelineState.h +++ b/Graphics/GraphicsEngine/interface/PipelineState.h @@ -223,11 +223,11 @@ struct RayTracingGeneralShaderGroup /// AZ TODO IShader* pShader DEFAULT_INITIALIZER(nullptr); - + #if DILIGENT_CPP_INTERFACE RayTracingGeneralShaderGroup() noexcept {} - + RayTracingGeneralShaderGroup(const char* _Name, IShader* _pShader) noexcept: Name {_Name }, @@ -248,11 +248,11 @@ struct RayTracingTriangleHitShaderGroup /// AZ TODO IShader* pAnyHitShader DEFAULT_INITIALIZER(nullptr); // can be null - + #if DILIGENT_CPP_INTERFACE RayTracingTriangleHitShaderGroup() noexcept {} - + RayTracingTriangleHitShaderGroup(const char* _Name, IShader* _pClosestHitShader, IShader* _pAnyHitShader = nullptr) noexcept: @@ -278,11 +278,11 @@ struct RayTracingProceduralHitShaderGroup /// AZ TODO IShader* pAnyHitShader DEFAULT_INITIALIZER(nullptr); // can be null - + #if DILIGENT_CPP_INTERFACE RayTracingProceduralHitShaderGroup() noexcept {} - + RayTracingProceduralHitShaderGroup(const char* _Name, IShader* _pIntersectionShader, IShader* _pClosestHitShader = nullptr, |
