diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-29 14:49:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 14:49:26 +0800 |
| commit | f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch) | |
| tree | ea1d61342cd29368e19135000ec2948813096205 /tools/gfx/debug-layer | |
| parent | a729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff) | |
format
* format
* Minor test fixes
* enable checking cpp format in ci
Diffstat (limited to 'tools/gfx/debug-layer')
27 files changed, 424 insertions, 284 deletions
diff --git a/tools/gfx/debug-layer/debug-base.h b/tools/gfx/debug-layer/debug-base.h index aa269cc7b..c235102c4 100644 --- a/tools/gfx/debug-layer/debug-base.h +++ b/tools/gfx/debug-layer/debug-base.h @@ -1,11 +1,11 @@ // debug-base.h #pragma once -#include "slang-gfx.h" -#include "slang-com-ptr.h" -#include "core/slang-com-object.h" #include "../command-encoder-com-forward.h" #include "../renderer-shared.h" +#include "core/slang-com-object.h" +#include "slang-com-ptr.h" +#include "slang-gfx.h" namespace gfx { @@ -14,61 +14,57 @@ using namespace Slang; namespace debug { - class DebugObjectBase : public Slang::ComObject +class DebugObjectBase : public Slang::ComObject +{ +public: + uint64_t uid; + DebugObjectBase() { - public: - uint64_t uid; - DebugObjectBase() - { - static uint64_t uidCounter = 0; - uid = ++uidCounter; - } - }; + static uint64_t uidCounter = 0; + uid = ++uidCounter; + } +}; - template<typename TInterface> - class DebugObject - : public TInterface - , public DebugObjectBase - { - public: - Slang::ComPtr<TInterface> baseObject; - }; +template<typename TInterface> +class DebugObject : public TInterface, public DebugObjectBase +{ +public: + Slang::ComPtr<TInterface> baseObject; +}; - template <typename TInterface> - class UnownedDebugObject - : public TInterface - , public DebugObjectBase - { - public: - TInterface* baseObject = nullptr; - }; +template<typename TInterface> +class UnownedDebugObject : public TInterface, public DebugObjectBase +{ +public: + TInterface* baseObject = nullptr; +}; - class DebugDevice; - class DebugShaderTable; - class DebugQueryPool; - class DebugBufferResource; - class DebugTextureResource; - class DebugResourceView; - class DebugAccelerationStructure; - class DebugSamplerState; - class DebugShaderObject; - class DebugRootShaderObject; - class DebugCommandBuffer; - class DebugResourceCommandEncoderImpl; - class DebugComputeCommandEncoder; - class DebugResourceCommandEncoder; - class DebugRenderCommandEncoder; - class DebugRayTracingCommandEncoder; - class DebugFence; - class DebugCommandQueue; - class DebugFramebuffer; - class DebugFramebufferLayout; - class DebugInputLayout; - class DebugPipelineState; - class DebugRenderPassLayout; - class DebugShaderProgram; - class DebugTransientResourceHeap; - class DebugSwapchain; +class DebugDevice; +class DebugShaderTable; +class DebugQueryPool; +class DebugBufferResource; +class DebugTextureResource; +class DebugResourceView; +class DebugAccelerationStructure; +class DebugSamplerState; +class DebugShaderObject; +class DebugRootShaderObject; +class DebugCommandBuffer; +class DebugResourceCommandEncoderImpl; +class DebugComputeCommandEncoder; +class DebugResourceCommandEncoder; +class DebugRenderCommandEncoder; +class DebugRayTracingCommandEncoder; +class DebugFence; +class DebugCommandQueue; +class DebugFramebuffer; +class DebugFramebufferLayout; +class DebugInputLayout; +class DebugPipelineState; +class DebugRenderPassLayout; +class DebugShaderProgram; +class DebugTransientResourceHeap; +class DebugSwapchain; } // namespace debug } // namespace gfx diff --git a/tools/gfx/debug-layer/debug-buffer.h b/tools/gfx/debug-layer/debug-buffer.h index 56c79c3d5..95720324c 100644 --- a/tools/gfx/debug-layer/debug-buffer.h +++ b/tools/gfx/debug-layer/debug-buffer.h @@ -19,14 +19,15 @@ public: virtual SLANG_NO_THROW Type SLANG_MCALL getType() override; virtual SLANG_NO_THROW Desc* SLANG_MCALL getDesc() override; virtual SLANG_NO_THROW DeviceAddress SLANG_MCALL getDeviceAddress() override; - virtual SLANG_NO_THROW Result SLANG_MCALL getNativeResourceHandle(InteropHandle* outHandle) override; + virtual SLANG_NO_THROW Result SLANG_MCALL + getNativeResourceHandle(InteropHandle* outHandle) override; virtual SLANG_NO_THROW Result SLANG_MCALL getSharedHandle(InteropHandle* outHandle) override; virtual SLANG_NO_THROW Result SLANG_MCALL setDebugName(const char* name) override; virtual SLANG_NO_THROW const char* SLANG_MCALL getDebugName() override; virtual SLANG_NO_THROW Result SLANG_MCALL - map(MemoryRange* rangeToRead, void** outPointer) override; + map(MemoryRange* rangeToRead, void** outPointer) override; virtual SLANG_NO_THROW Result SLANG_MCALL unmap(MemoryRange* writtenRange) override; }; diff --git a/tools/gfx/debug-layer/debug-command-buffer.cpp b/tools/gfx/debug-layer/debug-command-buffer.cpp index f3c71cb77..37e1c9e71 100644 --- a/tools/gfx/debug-layer/debug-command-buffer.cpp +++ b/tools/gfx/debug-layer/debug-command-buffer.cpp @@ -2,9 +2,8 @@ #include "debug-command-buffer.h" #include "debug-framebuffer.h" -#include "debug-render-pass.h" - #include "debug-helper-functions.h" +#include "debug-render-pass.h" namespace gfx { @@ -43,7 +42,9 @@ void DebugCommandBuffer::encodeRenderCommands( auto innerFramebuffer = getInnerObj(framebuffer); m_renderCommandEncoder.isOpen = true; baseObject->encodeRenderCommands( - innerRenderPass, innerFramebuffer, &m_renderCommandEncoder.baseObject); + innerRenderPass, + innerFramebuffer, + &m_renderCommandEncoder.baseObject); if (m_renderCommandEncoder.baseObject) *outEncoder = &m_renderCommandEncoder; else @@ -116,15 +117,15 @@ void DebugCommandBuffer::close() } if (m_computeCommandEncoder.isOpen) { - GFX_DIAGNOSE_ERROR( - "A compute command encoder on this command buffer is still open. " - "IComputeCommandEncoder::endEncoding() must be called before closing a command buffer."); + GFX_DIAGNOSE_ERROR("A compute command encoder on this command buffer is still open. " + "IComputeCommandEncoder::endEncoding() must be called before closing a " + "command buffer."); } if (m_resourceCommandEncoder.isOpen) { - GFX_DIAGNOSE_ERROR( - "A resource command encoder on this command buffer is still open. " - "IResourceCommandEncoder::endEncoding() must be called before closing a command buffer."); + GFX_DIAGNOSE_ERROR("A resource command encoder on this command buffer is still open. " + "IResourceCommandEncoder::endEncoding() must be called before closing a " + "command buffer."); } isOpen = false; baseObject->close(); @@ -140,9 +141,12 @@ void DebugCommandBuffer::invalidateDescriptorHeapBinding() { SLANG_GFX_API_FUNC; ComPtr<ICommandBufferD3D12> cmdBuf; - if (SLANG_FAILED(baseObject->queryInterface(SlangUUID SLANG_UUID_ICommandBufferD3D12, (void**)cmdBuf.writeRef()))) + if (SLANG_FAILED(baseObject->queryInterface( + SlangUUID SLANG_UUID_ICommandBufferD3D12, + (void**)cmdBuf.writeRef()))) { - GFX_DIAGNOSE_ERROR("The current command buffer implementation does not provide ICommandBufferD3D12 interface."); + GFX_DIAGNOSE_ERROR("The current command buffer implementation does not provide " + "ICommandBufferD3D12 interface."); return; } return cmdBuf->invalidateDescriptorHeapBinding(); @@ -152,9 +156,12 @@ void DebugCommandBuffer::ensureInternalDescriptorHeapsBound() { SLANG_GFX_API_FUNC; ComPtr<ICommandBufferD3D12> cmdBuf; - if (SLANG_FAILED(baseObject->queryInterface(SlangUUID SLANG_UUID_ICommandBufferD3D12, (void**)cmdBuf.writeRef()))) + if (SLANG_FAILED(baseObject->queryInterface( + SlangUUID SLANG_UUID_ICommandBufferD3D12, + (void**)cmdBuf.writeRef()))) { - GFX_DIAGNOSE_ERROR("The current command buffer implementation does not provide ICommandBufferD3D12 interface."); + GFX_DIAGNOSE_ERROR("The current command buffer implementation does not provide " + "ICommandBufferD3D12 interface."); return; } return cmdBuf->ensureInternalDescriptorHeapsBound(); diff --git a/tools/gfx/debug-layer/debug-command-buffer.h b/tools/gfx/debug-layer/debug-command-buffer.h index 33709fb2c..d2d6a1365 100644 --- a/tools/gfx/debug-layer/debug-command-buffer.h +++ b/tools/gfx/debug-layer/debug-command-buffer.h @@ -1,7 +1,6 @@ // debug-command-buffer.h #pragma once #include "debug-base.h" - #include "debug-command-encoder.h" #include "debug-shader-object.h" @@ -19,6 +18,7 @@ public: public: DebugTransientResourceHeap* m_transientHeap; + private: DebugRenderCommandEncoder m_renderCommandEncoder; DebugComputeCommandEncoder m_computeCommandEncoder; @@ -33,11 +33,11 @@ public: IFramebuffer* framebuffer, IRenderCommandEncoder** outEncoder) override; virtual SLANG_NO_THROW void SLANG_MCALL - encodeComputeCommands(IComputeCommandEncoder** outEncoder) override; + encodeComputeCommands(IComputeCommandEncoder** outEncoder) override; virtual SLANG_NO_THROW void SLANG_MCALL - encodeResourceCommands(IResourceCommandEncoder** outEncoder) override; + encodeResourceCommands(IResourceCommandEncoder** outEncoder) override; virtual SLANG_NO_THROW void SLANG_MCALL - encodeRayTracingCommands(IRayTracingCommandEncoder** outEncoder) override; + encodeRayTracingCommands(IRayTracingCommandEncoder** outEncoder) override; virtual SLANG_NO_THROW void SLANG_MCALL close() override; virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(InteropHandle* outHandle) override; virtual SLANG_NO_THROW void SLANG_MCALL invalidateDescriptorHeapBinding() override; @@ -46,6 +46,7 @@ public: private: void checkEncodersClosedBeforeNewEncoder(); void checkCommandBufferOpenWhenCreatingEncoder(); + public: DebugRootShaderObject rootObject; bool isOpen = true; diff --git a/tools/gfx/debug-layer/debug-command-encoder.cpp b/tools/gfx/debug-layer/debug-command-encoder.cpp index 6838732a0..f09130d98 100644 --- a/tools/gfx/debug-layer/debug-command-encoder.cpp +++ b/tools/gfx/debug-layer/debug-command-encoder.cpp @@ -3,13 +3,12 @@ #include "debug-buffer.h" #include "debug-command-buffer.h" +#include "debug-helper-functions.h" #include "debug-pipeline-state.h" #include "debug-query.h" #include "debug-resource-views.h" #include "debug-texture.h" -#include "debug-helper-functions.h" - namespace gfx { using namespace Slang; @@ -40,7 +39,8 @@ Result DebugComputeCommandEncoder::bindPipeline( } Result DebugComputeCommandEncoder::bindPipelineWithRootObject( - IPipelineState* state, IShaderObject* rootObject) + IPipelineState* state, + IShaderObject* rootObject) { SLANG_GFX_API_FUNC; return baseObject->bindPipelineWithRootObject(getInnerObj(state), getInnerObj(rootObject)); @@ -53,7 +53,8 @@ Result DebugComputeCommandEncoder::dispatchCompute(int x, int y, int z) } Result DebugComputeCommandEncoder::dispatchComputeIndirect( - IBufferResource* cmdBuffer, Offset offset) + IBufferResource* cmdBuffer, + Offset offset) { SLANG_GFX_API_FUNC; return baseObject->dispatchComputeIndirect(getInnerObj(cmdBuffer), offset); @@ -82,7 +83,8 @@ Result DebugRenderCommandEncoder::bindPipeline( } Result DebugRenderCommandEncoder::bindPipelineWithRootObject( - IPipelineState* state, IShaderObject* rootObject) + IPipelineState* state, + IShaderObject* rootObject) { SLANG_GFX_API_FUNC; return baseObject->bindPipelineWithRootObject(getInnerObj(state), getInnerObj(rootObject)); @@ -123,7 +125,9 @@ void DebugRenderCommandEncoder::setVertexBuffers( } void DebugRenderCommandEncoder::setIndexBuffer( - IBufferResource* buffer, Format indexFormat, Offset offset) + IBufferResource* buffer, + Format indexFormat, + Offset offset) { SLANG_GFX_API_FUNC; auto innerBuffer = static_cast<DebugBufferResource*>(buffer)->baseObject.get(); @@ -137,7 +141,9 @@ Result DebugRenderCommandEncoder::draw(GfxCount vertexCount, GfxIndex startVerte } Result DebugRenderCommandEncoder::drawIndexed( - GfxCount indexCount, GfxIndex startIndex, GfxIndex baseVertex) + GfxCount indexCount, + GfxIndex startIndex, + GfxIndex baseVertex) { SLANG_GFX_API_FUNC; return baseObject->drawIndexed(indexCount, startIndex, baseVertex); @@ -152,7 +158,11 @@ Result DebugRenderCommandEncoder::drawIndirect( { SLANG_GFX_API_FUNC; return baseObject->drawIndirect( - maxDrawCount, getInnerObj(argBuffer), argOffset, getInnerObj(countBuffer), countOffset); + maxDrawCount, + getInnerObj(argBuffer), + argOffset, + getInnerObj(countBuffer), + countOffset); } Result DebugRenderCommandEncoder::drawIndexedIndirect( @@ -164,7 +174,11 @@ Result DebugRenderCommandEncoder::drawIndexedIndirect( { SLANG_GFX_API_FUNC; return baseObject->drawIndexedIndirect( - maxDrawCount, getInnerObj(argBuffer), argOffset, getInnerObj(countBuffer), countOffset); + maxDrawCount, + getInnerObj(argBuffer), + argOffset, + getInnerObj(countBuffer), + countOffset); } void DebugRenderCommandEncoder::setStencilReference(uint32_t referenceValue) @@ -174,7 +188,9 @@ void DebugRenderCommandEncoder::setStencilReference(uint32_t referenceValue) } Result DebugRenderCommandEncoder::setSamplePositions( - GfxCount samplesPerPixel, GfxCount pixelCount, const SamplePosition* samplePositions) + GfxCount samplesPerPixel, + GfxCount pixelCount, + const SamplePosition* samplePositions) { SLANG_GFX_API_FUNC; return baseObject->setSamplePositions(samplesPerPixel, pixelCount, samplePositions); @@ -187,8 +203,8 @@ Result DebugRenderCommandEncoder::drawInstanced( GfxIndex startInstanceLocation) { SLANG_GFX_API_FUNC; - return baseObject->drawInstanced( - vertexCount, instanceCount, startVertex, startInstanceLocation); + return baseObject + ->drawInstanced(vertexCount, instanceCount, startVertex, startInstanceLocation); } Result DebugRenderCommandEncoder::drawIndexedInstanced( @@ -200,7 +216,11 @@ Result DebugRenderCommandEncoder::drawIndexedInstanced( { SLANG_GFX_API_FUNC; return baseObject->drawIndexedInstanced( - indexCount, instanceCount, startIndexLocation, baseVertexLocation, startInstanceLocation); + indexCount, + instanceCount, + startIndexLocation, + baseVertexLocation, + startInstanceLocation); } Result DebugRenderCommandEncoder::drawMeshTasks(int x, int y, int z) @@ -232,8 +252,8 @@ void DebugResourceCommandEncoderImpl::copyBuffer( SLANG_GFX_API_FUNC; auto dstImpl = static_cast<DebugBufferResource*>(dst); auto srcImpl = static_cast<DebugBufferResource*>(src); - getBaseResourceEncoder()->copyBuffer( - dstImpl->baseObject, dstOffset, srcImpl->baseObject, srcOffset, size); + getBaseResourceEncoder() + ->copyBuffer(dstImpl->baseObject, dstOffset, srcImpl->baseObject, srcOffset, size); } void DebugResourceCommandEncoderImpl::uploadBufferData( @@ -272,7 +292,7 @@ void DebugResourceCommandEncoderImpl::bufferBarrier( SLANG_GFX_API_FUNC; List<IBufferResource*> innerBuffers; - for(GfxIndex i = 0; i < count; i++) + for (GfxIndex i = 0; i < count; i++) { innerBuffers.add(static_cast<DebugBufferResource*>(buffers[i])->baseObject.get()); } @@ -313,19 +333,25 @@ void DebugResourceCommandEncoderImpl::uploadTextureData( { SLANG_GFX_API_FUNC; getBaseResourceEncoder()->uploadTextureData( - getInnerObj(dst), subResourceRange, offset, extent, subResourceData, subResourceDataCount); + getInnerObj(dst), + subResourceRange, + offset, + extent, + subResourceData, + subResourceDataCount); } void DebugResourceCommandEncoderImpl::clearResourceView( - IResourceView* view, ClearValue* clearValue, ClearResourceViewFlags::Enum flags) + IResourceView* view, + ClearValue* clearValue, + ClearResourceViewFlags::Enum flags) { SLANG_GFX_API_FUNC; switch (view->getViewDesc()->type) { case IResourceView::Type::DepthStencil: case IResourceView::Type::RenderTarget: - case IResourceView::Type::UnorderedAccess: - break; + case IResourceView::Type::UnorderedAccess: break; default: GFX_DIAGNOSE_ERROR_FORMAT( "Resource view %lld cannot be cleared. Only DepthStencil, " @@ -345,14 +371,24 @@ void DebugResourceCommandEncoderImpl::resolveResource( { SLANG_GFX_API_FUNC; getBaseResourceEncoder()->resolveResource( - getInnerObj(source), sourceState, sourceRange, getInnerObj(dest), destState, destRange); + getInnerObj(source), + sourceState, + sourceRange, + getInnerObj(dest), + destState, + destRange); } void DebugResourceCommandEncoderImpl::resolveQuery( - IQueryPool* queryPool, GfxIndex index, GfxCount count, IBufferResource* buffer, Offset offset) + IQueryPool* queryPool, + GfxIndex index, + GfxCount count, + IBufferResource* buffer, + Offset offset) { SLANG_GFX_API_FUNC; - getBaseResourceEncoder()->resolveQuery(getInnerObj(queryPool), index, count, getInnerObj(buffer), offset); + getBaseResourceEncoder() + ->resolveQuery(getInnerObj(queryPool), index, count, getInnerObj(buffer), offset); } void DebugResourceCommandEncoderImpl::copyTextureToBuffer( @@ -368,7 +404,15 @@ void DebugResourceCommandEncoderImpl::copyTextureToBuffer( { SLANG_GFX_API_FUNC; getBaseResourceEncoder()->copyTextureToBuffer( - getInnerObj(dst), dstOffset, dstSize, dstRowStride, getInnerObj(src), srcState, srcSubresource, srcOffset, extent); + getInnerObj(dst), + dstOffset, + dstSize, + dstRowStride, + getInnerObj(src), + srcState, + srcSubresource, + srcOffset, + extent); } void DebugResourceCommandEncoderImpl::textureSubresourceBarrier( @@ -378,8 +422,8 @@ void DebugResourceCommandEncoderImpl::textureSubresourceBarrier( ResourceState dst) { SLANG_GFX_API_FUNC; - getBaseResourceEncoder()->textureSubresourceBarrier( - getInnerObj(texture), subresourceRange, src, dst); + getBaseResourceEncoder() + ->textureSubresourceBarrier(getInnerObj(texture), subresourceRange, src, dst); } void DebugResourceCommandEncoderImpl::beginDebugEvent(const char* name, float rgbColor[3]) @@ -418,7 +462,9 @@ void DebugRayTracingCommandEncoder::buildAccelerationStructure( } validateAccelerationStructureBuildInputs(desc.inputs); baseObject->buildAccelerationStructure( - innerDesc, propertyQueryCount, innerQueryDescs.getBuffer()); + innerDesc, + propertyQueryCount, + innerQueryDescs.getBuffer()); } void DebugRayTracingCommandEncoder::copyAccelerationStructure( @@ -451,7 +497,10 @@ void DebugRayTracingCommandEncoder::queryAccelerationStructureProperties( innerQueryDesc.queryPool = getInnerObj(innerQueryDesc.queryPool); } baseObject->queryAccelerationStructureProperties( - accelerationStructureCount, innerAS.getBuffer(), queryCount, innerQueryDescs.getBuffer()); + accelerationStructureCount, + innerAS.getBuffer(), + queryCount, + innerQueryDescs.getBuffer()); } void DebugRayTracingCommandEncoder::serializeAccelerationStructure( @@ -471,7 +520,8 @@ void DebugRayTracingCommandEncoder::deserializeAccelerationStructure( } Result DebugRayTracingCommandEncoder::bindPipeline( - IPipelineState* state, IShaderObject** outRootObject) + IPipelineState* state, + IShaderObject** outRootObject) { SLANG_GFX_API_FUNC; auto innerPipeline = getInnerObj(state); @@ -484,7 +534,8 @@ Result DebugRayTracingCommandEncoder::bindPipeline( } Result DebugRayTracingCommandEncoder::bindPipelineWithRootObject( - IPipelineState* state, IShaderObject* rootObject) + IPipelineState* state, + IShaderObject* rootObject) { SLANG_GFX_API_FUNC; return baseObject->bindPipelineWithRootObject(getInnerObj(state), getInnerObj(rootObject)); @@ -498,7 +549,8 @@ Result DebugRayTracingCommandEncoder::dispatchRays( GfxCount depth) { SLANG_GFX_API_FUNC; - return baseObject->dispatchRays(rayGenShaderIndex, getInnerObj(shaderTable), width, height, depth); + return baseObject + ->dispatchRays(rayGenShaderIndex, getInnerObj(shaderTable), width, height, depth); } } // namespace debug diff --git a/tools/gfx/debug-layer/debug-command-encoder.h b/tools/gfx/debug-layer/debug-command-encoder.h index 152a1a733..467c52828 100644 --- a/tools/gfx/debug-layer/debug-command-encoder.h +++ b/tools/gfx/debug-layer/debug-command-encoder.h @@ -27,6 +27,7 @@ public: } uint32_t addRef() { return 1; } uint32_t release() { return 1; } + public: virtual SLANG_NO_THROW void SLANG_MCALL copyBuffer( IBufferResource* dst, @@ -35,9 +36,8 @@ public: Offset srcOffset, Size size); virtual SLANG_NO_THROW void SLANG_MCALL - uploadBufferData(IBufferResource* dst, Offset offset, Size size, void* data); - virtual SLANG_NO_THROW void SLANG_MCALL - writeTimestamp(IQueryPool* pool, GfxIndex index); + uploadBufferData(IBufferResource* dst, Offset offset, Size size, void* data); + virtual SLANG_NO_THROW void SLANG_MCALL writeTimestamp(IQueryPool* pool, GfxIndex index); virtual SLANG_NO_THROW void SLANG_MCALL textureBarrier( GfxCount count, ITextureResource* const* textures, @@ -66,7 +66,9 @@ public: ITextureResource::SubresourceData* subResourceData, GfxCount subResourceDataCount); virtual SLANG_NO_THROW void SLANG_MCALL clearResourceView( - IResourceView* view, ClearValue* clearValue, ClearResourceViewFlags::Enum flags); + IResourceView* view, + ClearValue* clearValue, + ClearResourceViewFlags::Enum flags); virtual SLANG_NO_THROW void SLANG_MCALL resolveResource( ITextureResource* source, ResourceState sourceState, @@ -99,9 +101,8 @@ public: virtual SLANG_NO_THROW void SLANG_MCALL endDebugEvent(); }; -class DebugComputeCommandEncoder - : public UnownedDebugObject<IComputeCommandEncoder> - , public DebugResourceCommandEncoderImpl +class DebugComputeCommandEncoder : public UnownedDebugObject<IComputeCommandEncoder>, + public DebugResourceCommandEncoderImpl { public: SLANG_GFX_FORWARD_RESOURCE_COMMAND_ENCODER_IMPL(DebugResourceCommandEncoderImpl) @@ -110,7 +111,8 @@ public: virtual IResourceCommandEncoder* getBaseResourceEncoder() override { return baseObject; } virtual void* getInterface(SlangUUID const& uuid) override { - if (uuid == GfxGUID::IID_IResourceCommandEncoder || uuid == GfxGUID::IID_IComputeCommandEncoder || uuid == ISlangUnknown::getTypeGuid()) + if (uuid == GfxGUID::IID_IResourceCommandEncoder || + uuid == GfxGUID::IID_IComputeCommandEncoder || uuid == ISlangUnknown::getTypeGuid()) { return this; } @@ -120,21 +122,20 @@ public: public: virtual SLANG_NO_THROW void SLANG_MCALL endEncoding() override; virtual SLANG_NO_THROW Result SLANG_MCALL - bindPipeline(IPipelineState* state, IShaderObject** outRootShaderObject) override; + bindPipeline(IPipelineState* state, IShaderObject** outRootShaderObject) override; virtual SLANG_NO_THROW Result SLANG_MCALL - bindPipelineWithRootObject(IPipelineState* state, IShaderObject* rootObject) override; + bindPipelineWithRootObject(IPipelineState* state, IShaderObject* rootObject) override; virtual SLANG_NO_THROW Result SLANG_MCALL dispatchCompute(int x, int y, int z) override; virtual SLANG_NO_THROW Result SLANG_MCALL - dispatchComputeIndirect(IBufferResource* cmdBuffer, Offset offset) override; + dispatchComputeIndirect(IBufferResource* cmdBuffer, Offset offset) override; public: DebugCommandBuffer* commandBuffer; bool isOpen = false; }; -class DebugResourceCommandEncoder - : public UnownedDebugObject<IResourceCommandEncoder> - , public DebugResourceCommandEncoderImpl +class DebugResourceCommandEncoder : public UnownedDebugObject<IResourceCommandEncoder>, + public DebugResourceCommandEncoderImpl { public: SLANG_GFX_FORWARD_RESOURCE_COMMAND_ENCODER_IMPL(DebugResourceCommandEncoderImpl) @@ -158,49 +159,47 @@ public: bool isOpen = false; }; -class DebugRenderCommandEncoder - : public UnownedDebugObject<IRenderCommandEncoder> - , public DebugResourceCommandEncoderImpl +class DebugRenderCommandEncoder : public UnownedDebugObject<IRenderCommandEncoder>, + public DebugResourceCommandEncoderImpl { public: SLANG_GFX_FORWARD_RESOURCE_COMMAND_ENCODER_IMPL(DebugResourceCommandEncoderImpl) - virtual DebugCommandBuffer* getCommandBuffer() override - { - return commandBuffer; - } + virtual DebugCommandBuffer* getCommandBuffer() override { return commandBuffer; } virtual bool getIsOpen() override { return isOpen; } virtual IResourceCommandEncoder* getBaseResourceEncoder() override { return baseObject; } virtual void* getInterface(SlangUUID const& uuid) override { - if (uuid == GfxGUID::IID_IResourceCommandEncoder || uuid == GfxGUID::IID_IRenderCommandEncoder || uuid == ISlangUnknown::getTypeGuid()) + if (uuid == GfxGUID::IID_IResourceCommandEncoder || + uuid == GfxGUID::IID_IRenderCommandEncoder || uuid == ISlangUnknown::getTypeGuid()) { return this; } return nullptr; } + public: virtual SLANG_NO_THROW void SLANG_MCALL endEncoding() override; virtual SLANG_NO_THROW Result SLANG_MCALL - bindPipeline(IPipelineState* state, IShaderObject** outRootShaderObject) override; + bindPipeline(IPipelineState* state, IShaderObject** outRootShaderObject) override; virtual SLANG_NO_THROW Result SLANG_MCALL - bindPipelineWithRootObject(IPipelineState* state, IShaderObject* rootObject) override; + bindPipelineWithRootObject(IPipelineState* state, IShaderObject* rootObject) override; virtual SLANG_NO_THROW void SLANG_MCALL - setViewports(GfxCount count, const Viewport* viewports) override; + setViewports(GfxCount count, const Viewport* viewports) override; virtual SLANG_NO_THROW void SLANG_MCALL - setScissorRects(GfxCount count, const ScissorRect* scissors) override; + setScissorRects(GfxCount count, const ScissorRect* scissors) override; virtual SLANG_NO_THROW void SLANG_MCALL - setPrimitiveTopology(PrimitiveTopology topology) override; + setPrimitiveTopology(PrimitiveTopology topology) override; virtual SLANG_NO_THROW void SLANG_MCALL setVertexBuffers( GfxIndex startSlot, GfxCount slotCount, IBufferResource* const* buffers, const Offset* offsets) override; virtual SLANG_NO_THROW void SLANG_MCALL - setIndexBuffer(IBufferResource* buffer, Format indexFormat, Offset offset = 0) override; + setIndexBuffer(IBufferResource* buffer, Format indexFormat, Offset offset = 0) override; virtual SLANG_NO_THROW Result SLANG_MCALL - draw(GfxCount vertexCount, GfxIndex startVertex = 0) override; + draw(GfxCount vertexCount, GfxIndex startVertex = 0) override; virtual SLANG_NO_THROW Result SLANG_MCALL - drawIndexed(GfxCount indexCount, GfxIndex startIndex = 0, GfxIndex baseVertex = 0) override; + drawIndexed(GfxCount indexCount, GfxIndex startIndex = 0, GfxIndex baseVertex = 0) override; virtual SLANG_NO_THROW Result SLANG_MCALL drawIndirect( GfxCount maxDrawCount, IBufferResource* argBuffer, @@ -231,17 +230,15 @@ public: GfxIndex baseVertexLocation, GfxIndex startInstanceLocation) override; - virtual SLANG_NO_THROW Result SLANG_MCALL - drawMeshTasks(int x, int y, int z) override; + virtual SLANG_NO_THROW Result SLANG_MCALL drawMeshTasks(int x, int y, int z) override; public: DebugCommandBuffer* commandBuffer; bool isOpen = false; }; -class DebugRayTracingCommandEncoder - : public UnownedDebugObject<IRayTracingCommandEncoder> - , public DebugResourceCommandEncoderImpl +class DebugRayTracingCommandEncoder : public UnownedDebugObject<IRayTracingCommandEncoder>, + public DebugResourceCommandEncoderImpl { public: SLANG_GFX_FORWARD_RESOURCE_COMMAND_ENCODER_IMPL(DebugResourceCommandEncoderImpl) @@ -250,12 +247,14 @@ public: virtual IResourceCommandEncoder* getBaseResourceEncoder() override { return baseObject; } virtual void* getInterface(SlangUUID const& uuid) override { - if (uuid == GfxGUID::IID_IResourceCommandEncoder || uuid == GfxGUID::IID_IRayTracingCommandEncoder || uuid == ISlangUnknown::getTypeGuid()) + if (uuid == GfxGUID::IID_IResourceCommandEncoder || + uuid == GfxGUID::IID_IRayTracingCommandEncoder || uuid == ISlangUnknown::getTypeGuid()) { return this; } return nullptr; } + public: virtual SLANG_NO_THROW void SLANG_MCALL endEncoding() override; virtual SLANG_NO_THROW void SLANG_MCALL buildAccelerationStructure( @@ -272,14 +271,13 @@ public: GfxCount queryCount, AccelerationStructureQueryDesc* queryDescs) override; virtual SLANG_NO_THROW void SLANG_MCALL - serializeAccelerationStructure(DeviceAddress dest, IAccelerationStructure* source) override; - virtual SLANG_NO_THROW void SLANG_MCALL deserializeAccelerationStructure( - IAccelerationStructure* dest, - DeviceAddress source) override; + serializeAccelerationStructure(DeviceAddress dest, IAccelerationStructure* source) override; + virtual SLANG_NO_THROW void SLANG_MCALL + deserializeAccelerationStructure(IAccelerationStructure* dest, DeviceAddress source) override; virtual SLANG_NO_THROW Result SLANG_MCALL - bindPipeline(IPipelineState* state, IShaderObject** outRootObject) override; + bindPipeline(IPipelineState* state, IShaderObject** outRootObject) override; virtual SLANG_NO_THROW Result SLANG_MCALL - bindPipelineWithRootObject(IPipelineState* state, IShaderObject* rootObject) override; + bindPipelineWithRootObject(IPipelineState* state, IShaderObject* rootObject) override; virtual SLANG_NO_THROW Result SLANG_MCALL dispatchRays( GfxIndex rayGenShaderIndex, IShaderTable* shaderTable, diff --git a/tools/gfx/debug-layer/debug-command-queue.cpp b/tools/gfx/debug-layer/debug-command-queue.cpp index d094f3438..3759b07b8 100644 --- a/tools/gfx/debug-layer/debug-command-queue.cpp +++ b/tools/gfx/debug-layer/debug-command-queue.cpp @@ -3,9 +3,8 @@ #include "debug-command-buffer.h" #include "debug-fence.h" -#include "debug-transient-heap.h" - #include "debug-helper-functions.h" +#include "debug-transient-heap.h" namespace gfx { @@ -20,7 +19,11 @@ const ICommandQueue::Desc& DebugCommandQueue::getDesc() return baseObject->getDesc(); } -void DebugCommandQueue::executeCommandBuffers(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal) +void DebugCommandQueue::executeCommandBuffers( + GfxCount count, + ICommandBuffer* const* commandBuffers, + IFence* fence, + uint64_t valueToSignal) { SLANG_GFX_API_FUNC; List<ICommandBuffer*> innerCommandBuffers; @@ -46,10 +49,15 @@ void DebugCommandQueue::executeCommandBuffers(GfxCount count, ICommandBuffer* co } } } - baseObject->executeCommandBuffers(count, innerCommandBuffers.getBuffer(), getInnerObj(fence), valueToSignal); + baseObject->executeCommandBuffers( + count, + innerCommandBuffers.getBuffer(), + getInnerObj(fence), + valueToSignal); if (fence) { - getDebugObj(fence)->maxValueToSignal = Math::Max(getDebugObj(fence)->maxValueToSignal, valueToSignal); + getDebugObj(fence)->maxValueToSignal = + Math::Max(getDebugObj(fence)->maxValueToSignal, valueToSignal); } } @@ -60,7 +68,9 @@ void DebugCommandQueue::waitOnHost() } Result DebugCommandQueue::waitForFenceValuesOnDevice( - GfxCount fenceCount, IFence** fences, uint64_t* waitValues) + GfxCount fenceCount, + IFence** fences, + uint64_t* waitValues) { SLANG_GFX_API_FUNC; List<IFence*> innerFences; diff --git a/tools/gfx/debug-layer/debug-command-queue.h b/tools/gfx/debug-layer/debug-command-queue.h index 3c9afa98b..417e9888a 100644 --- a/tools/gfx/debug-layer/debug-command-queue.h +++ b/tools/gfx/debug-layer/debug-command-queue.h @@ -17,11 +17,14 @@ public: public: ICommandQueue* getInterface(const Slang::Guid& guid); virtual SLANG_NO_THROW const Desc& SLANG_MCALL getDesc() override; - virtual SLANG_NO_THROW void SLANG_MCALL - executeCommandBuffers(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal) override; + virtual SLANG_NO_THROW void SLANG_MCALL executeCommandBuffers( + GfxCount count, + ICommandBuffer* const* commandBuffers, + IFence* fence, + uint64_t valueToSignal) override; virtual SLANG_NO_THROW void SLANG_MCALL waitOnHost() override; - virtual SLANG_NO_THROW Result SLANG_MCALL waitForFenceValuesOnDevice( - GfxCount fenceCount, IFence** fences, uint64_t* waitValues) override; + virtual SLANG_NO_THROW Result SLANG_MCALL + waitForFenceValuesOnDevice(GfxCount fenceCount, IFence** fences, uint64_t* waitValues) override; virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(InteropHandle* outHandle) override; }; diff --git a/tools/gfx/debug-layer/debug-device.cpp b/tools/gfx/debug-layer/debug-device.cpp index 44ca1de7a..c5798710a 100644 --- a/tools/gfx/debug-layer/debug-device.cpp +++ b/tools/gfx/debug-layer/debug-device.cpp @@ -45,7 +45,10 @@ Result DebugDevice::getNativeDeviceHandles(InteropHandles* outHandles) return baseObject->getNativeDeviceHandles(outHandles); } -Result DebugDevice::getFeatures(const char** outFeatures, Size bufferSize, GfxCount* outFeatureCount) +Result DebugDevice::getFeatures( + const char** outFeatures, + Size bufferSize, + GfxCount* outFeatureCount) { SLANG_GFX_API_FUNC; @@ -116,7 +119,10 @@ Result DebugDevice::createTextureFromNativeHandle( SLANG_GFX_API_FUNC; RefPtr<DebugTextureResource> outObject = new DebugTextureResource(); - auto result = baseObject->createTextureFromNativeHandle(handle, srcDesc, outObject->baseObject.writeRef()); + auto result = baseObject->createTextureFromNativeHandle( + handle, + srcDesc, + outObject->baseObject.writeRef()); if (SLANG_FAILED(result)) return result; returnComPtr(outResource, outObject); @@ -132,7 +138,11 @@ Result DebugDevice::createTextureFromSharedHandle( SLANG_GFX_API_FUNC; RefPtr<DebugTextureResource> outObject = new DebugTextureResource(); - auto result = baseObject->createTextureFromSharedHandle(handle, srcDesc, size, outObject->baseObject.writeRef()); + auto result = baseObject->createTextureFromSharedHandle( + handle, + srcDesc, + size, + outObject->baseObject.writeRef()); if (SLANG_FAILED(result)) return result; returnComPtr(outResource, outObject); @@ -147,7 +157,8 @@ Result DebugDevice::createBufferResource( SLANG_GFX_API_FUNC; RefPtr<DebugBufferResource> outObject = new DebugBufferResource(); - auto result = baseObject->createBufferResource(desc, initData, outObject->baseObject.writeRef()); + auto result = + baseObject->createBufferResource(desc, initData, outObject->baseObject.writeRef()); if (SLANG_FAILED(result)) return result; returnComPtr(outResource, outObject); @@ -162,7 +173,8 @@ Result DebugDevice::createBufferFromNativeHandle( SLANG_GFX_API_FUNC; RefPtr<DebugBufferResource> outObject = new DebugBufferResource(); - auto result = baseObject->createBufferFromNativeHandle(handle, srcDesc, outObject->baseObject.writeRef()); + auto result = + baseObject->createBufferFromNativeHandle(handle, srcDesc, outObject->baseObject.writeRef()); if (SLANG_FAILED(result)) return result; returnComPtr(outResource, outObject); @@ -177,7 +189,8 @@ Result DebugDevice::createBufferFromSharedHandle( SLANG_GFX_API_FUNC; RefPtr<DebugBufferResource> outObject = new DebugBufferResource(); - auto result = baseObject->createBufferFromSharedHandle(handle, srcDesc, outObject->baseObject.writeRef()); + auto result = + baseObject->createBufferFromSharedHandle(handle, srcDesc, outObject->baseObject.writeRef()); if (SLANG_FAILED(result)) return result; returnComPtr(outResource, outObject); @@ -204,10 +217,8 @@ Result DebugDevice::createTextureView( SLANG_GFX_API_FUNC; RefPtr<DebugResourceView> outObject = new DebugResourceView(); - auto result = baseObject->createTextureView( - getInnerObj(texture), - desc, - outObject->baseObject.writeRef()); + auto result = + baseObject->createTextureView(getInnerObj(texture), desc, outObject->baseObject.writeRef()); if (SLANG_FAILED(result)) return result; returnComPtr(outView, outObject); @@ -251,7 +262,8 @@ Result DebugDevice::createAccelerationStructure( auto innerDesc = desc; innerDesc.buffer = getInnerObj(innerDesc.buffer); RefPtr<DebugAccelerationStructure> outObject = new DebugAccelerationStructure(); - auto result = baseObject->createAccelerationStructure(innerDesc, outObject->baseObject.writeRef()); + auto result = + baseObject->createAccelerationStructure(innerDesc, outObject->baseObject.writeRef()); if (SLANG_FAILED(result)) return result; returnComPtr(outAS, outObject); @@ -329,15 +341,12 @@ Result DebugDevice::createSwapchain( return Result(); } -Result DebugDevice::createInputLayout( - IInputLayout::Desc const& desc, - IInputLayout** outLayout) +Result DebugDevice::createInputLayout(IInputLayout::Desc const& desc, IInputLayout** outLayout) { SLANG_GFX_API_FUNC; RefPtr<DebugInputLayout> outObject = new DebugInputLayout(); - auto result = baseObject->createInputLayout( - desc, outObject->baseObject.writeRef()); + auto result = baseObject->createInputLayout(desc, outObject->baseObject.writeRef()); if (SLANG_FAILED(result)) return result; returnComPtr(outLayout, outObject); @@ -386,8 +395,11 @@ Result DebugDevice::createShaderObject2( RefPtr<DebugShaderObject> outObject = new DebugShaderObject(); auto typeName = type->getName(); - auto result = - baseObject->createShaderObject2(session, type, containerType, outObject->baseObject.writeRef()); + auto result = baseObject->createShaderObject2( + session, + type, + containerType, + outObject->baseObject.writeRef()); outObject->m_typeName = typeName; outObject->m_device = this; outObject->m_slangType = type; @@ -406,8 +418,10 @@ Result DebugDevice::createMutableShaderObject( RefPtr<DebugShaderObject> outObject = new DebugShaderObject(); auto typeName = type->getName(); - auto result = - baseObject->createMutableShaderObject(type, containerType, outObject->baseObject.writeRef()); + auto result = baseObject->createMutableShaderObject( + type, + containerType, + outObject->baseObject.writeRef()); outObject->m_typeName = typeName; outObject->m_device = this; outObject->m_slangType = type; @@ -427,8 +441,11 @@ Result DebugDevice::createMutableShaderObject2( RefPtr<DebugShaderObject> outObject = new DebugShaderObject(); auto typeName = type->getName(); - auto result = - baseObject->createMutableShaderObject2(session, type, containerType, outObject->baseObject.writeRef()); + auto result = baseObject->createMutableShaderObject2( + session, + type, + containerType, + outObject->baseObject.writeRef()); outObject->m_typeName = typeName; outObject->m_device = this; outObject->m_slangType = type; @@ -439,12 +456,14 @@ Result DebugDevice::createMutableShaderObject2( } Result DebugDevice::createMutableRootShaderObject( - IShaderProgram* program, IShaderObject** outRootObject) + IShaderProgram* program, + IShaderObject** outRootObject) { SLANG_GFX_API_FUNC; RefPtr<DebugShaderObject> outObject = new DebugShaderObject(); auto result = baseObject->createMutableRootShaderObject( - getInnerObj(program), outObject->baseObject.writeRef()); + getInnerObj(program), + outObject->baseObject.writeRef()); if (SLANG_FAILED(result)) return result; outObject->m_device = this; @@ -455,12 +474,14 @@ Result DebugDevice::createMutableRootShaderObject( } Result DebugDevice::createShaderObjectFromTypeLayout( - slang::TypeLayoutReflection* typeLayout, IShaderObject** outShaderObject) + slang::TypeLayoutReflection* typeLayout, + IShaderObject** outShaderObject) { SLANG_GFX_API_FUNC; RefPtr<DebugShaderObject> outObject = new DebugShaderObject(); - auto result = baseObject->createShaderObjectFromTypeLayout(typeLayout, outObject->baseObject.writeRef()); + auto result = + baseObject->createShaderObjectFromTypeLayout(typeLayout, outObject->baseObject.writeRef()); auto type = typeLayout->getType(); auto typeName = type->getName(); outObject->m_typeName = typeName; @@ -473,12 +494,14 @@ Result DebugDevice::createShaderObjectFromTypeLayout( } Result DebugDevice::createMutableShaderObjectFromTypeLayout( - slang::TypeLayoutReflection* typeLayout, IShaderObject** outShaderObject) + slang::TypeLayoutReflection* typeLayout, + IShaderObject** outShaderObject) { SLANG_GFX_API_FUNC; RefPtr<DebugShaderObject> outObject = new DebugShaderObject(); auto result = baseObject->createMutableShaderObjectFromTypeLayout( - typeLayout, outObject->baseObject.writeRef()); + typeLayout, + outObject->baseObject.writeRef()); if (SLANG_FAILED(result)) return result; auto type = typeLayout->getType(); @@ -491,7 +514,9 @@ Result DebugDevice::createMutableShaderObjectFromTypeLayout( } Result DebugDevice::createProgram( - const IShaderProgram::Desc& desc, IShaderProgram** outProgram, ISlangBlob** outDiagnostics) + const IShaderProgram::Desc& desc, + IShaderProgram** outProgram, + ISlangBlob** outDiagnostics) { SLANG_GFX_API_FUNC; @@ -505,12 +530,15 @@ Result DebugDevice::createProgram( } Result DebugDevice::createProgram2( - const IShaderProgram::CreateDesc2& desc, IShaderProgram** outProgram, ISlangBlob** outDiagnostics) + const IShaderProgram::CreateDesc2& desc, + IShaderProgram** outProgram, + ISlangBlob** outDiagnostics) { SLANG_GFX_API_FUNC; IShaderProgram::Desc desc1 = {}; RefPtr<DebugShaderProgram> outObject = new DebugShaderProgram(); - auto result = baseObject->createProgram2(desc, outObject->baseObject.writeRef(), outDiagnostics); + auto result = + baseObject->createProgram2(desc, outObject->baseObject.writeRef(), outDiagnostics); if (SLANG_FAILED(result)) return result; auto base = static_cast<ShaderProgramBase*>(outObject->baseObject.get()); @@ -582,8 +610,8 @@ SlangResult DebugDevice::readTextureResource( size_t* outPixelSize) { SLANG_GFX_API_FUNC; - return baseObject->readTextureResource( - getInnerObj(resource), state, outBlob, outRowPitch, outPixelSize); + return baseObject + ->readTextureResource(getInnerObj(resource), state, outBlob, outRowPitch, outPixelSize); } SlangResult DebugDevice::readBufferResource( @@ -622,7 +650,11 @@ Result DebugDevice::createFence(const IFence::Desc& desc, IFence** outFence) } Result DebugDevice::waitForFences( - GfxCount fenceCount, IFence** fences, uint64_t* values , bool waitForAll, uint64_t timeout) + GfxCount fenceCount, + IFence** fences, + uint64_t* values, + bool waitForAll, + uint64_t timeout) { SLANG_GFX_API_FUNC; ShortList<IFence*> innerFences; @@ -630,11 +662,18 @@ Result DebugDevice::waitForFences( { innerFences.add(getInnerObj(fences[i])); } - return baseObject->waitForFences(fenceCount, innerFences.getArrayView().getBuffer(), values, waitForAll, timeout); + return baseObject->waitForFences( + fenceCount, + innerFences.getArrayView().getBuffer(), + values, + waitForAll, + timeout); } Result DebugDevice::getTextureAllocationInfo( - const ITextureResource::Desc& desc, size_t* outSize, size_t* outAlignment) + const ITextureResource::Desc& desc, + size_t* outSize, + size_t* outAlignment) { SLANG_GFX_API_FUNC; return baseObject->getTextureAllocationInfo(desc, outSize, outAlignment); diff --git a/tools/gfx/debug-layer/debug-device.h b/tools/gfx/debug-layer/debug-device.h index 90feaa37e..a4debd2e7 100644 --- a/tools/gfx/debug-layer/debug-device.h +++ b/tools/gfx/debug-layer/debug-device.h @@ -12,22 +12,24 @@ namespace debug class DebugDevice : public DebugObject<IDevice> { public: - SlangResult SLANG_MCALL queryInterface(SlangUUID const& uuid, void** outObject) noexcept override; + SlangResult SLANG_MCALL + queryInterface(SlangUUID const& uuid, void** outObject) noexcept override; SLANG_COM_OBJECT_IUNKNOWN_ADD_REF; SLANG_COM_OBJECT_IUNKNOWN_RELEASE; public: DebugDevice(); IDevice* getInterface(const Slang::Guid& guid); - virtual SLANG_NO_THROW Result SLANG_MCALL getNativeDeviceHandles(InteropHandles* outHandles) override; + virtual SLANG_NO_THROW Result SLANG_MCALL + getNativeDeviceHandles(InteropHandles* outHandles) override; virtual SLANG_NO_THROW bool SLANG_MCALL hasFeature(const char* feature) override; virtual SLANG_NO_THROW Result SLANG_MCALL - getFeatures(const char** outFeatures, Size bufferSize, GfxCount* outFeatureCount) override; + getFeatures(const char** outFeatures, Size bufferSize, GfxCount* outFeatureCount) override; virtual SLANG_NO_THROW Result SLANG_MCALL - getFormatSupportedResourceStates(Format format, ResourceStateSet* outStates) override; + getFormatSupportedResourceStates(Format format, ResourceStateSet* outStates) override; virtual SLANG_NO_THROW Result SLANG_MCALL - getSlangSession(slang::ISession** outSlangSession) override; + getSlangSession(slang::ISession** outSlangSession) override; virtual SLANG_NO_THROW Result SLANG_MCALL createTransientResourceHeap( const ITransientResourceHeap::Desc& desc, ITransientResourceHeap** outHeap) override; @@ -57,7 +59,7 @@ public: const IBufferResource::Desc& srcDesc, IBufferResource** outResource) override; virtual SLANG_NO_THROW Result SLANG_MCALL - createSamplerState(ISamplerState::Desc const& desc, ISamplerState** outSampler) override; + createSamplerState(ISamplerState::Desc const& desc, ISamplerState** outSampler) override; virtual SLANG_NO_THROW Result SLANG_MCALL createTextureView( ITextureResource* texture, IResourceView::Desc const& desc, @@ -77,7 +79,7 @@ public: IFramebufferLayout::Desc const& desc, IFramebufferLayout** outFrameBuffer) override; virtual SLANG_NO_THROW Result SLANG_MCALL - createFramebuffer(IFramebuffer::Desc const& desc, IFramebuffer** outFrameBuffer) override; + createFramebuffer(IFramebuffer::Desc const& desc, IFramebuffer** outFrameBuffer) override; virtual SLANG_NO_THROW Result SLANG_MCALL createRenderPassLayout( const IRenderPassLayout::Desc& desc, IRenderPassLayout** outRenderPassLayout) override; @@ -85,11 +87,10 @@ public: ISwapchain::Desc const& desc, WindowHandle window, ISwapchain** outSwapchain) override; - virtual SLANG_NO_THROW Result SLANG_MCALL createInputLayout( - IInputLayout::Desc const& desc, - IInputLayout** outLayout) override; virtual SLANG_NO_THROW Result SLANG_MCALL - createCommandQueue(const ICommandQueue::Desc& desc, ICommandQueue** outQueue) override; + createInputLayout(IInputLayout::Desc const& desc, IInputLayout** outLayout) override; + virtual SLANG_NO_THROW Result SLANG_MCALL + createCommandQueue(const ICommandQueue::Desc& desc, ICommandQueue** outQueue) override; virtual SLANG_NO_THROW Result SLANG_MCALL createShaderObject( slang::TypeReflection* type, ShaderObjectContainerType container, @@ -109,15 +110,21 @@ public: ShaderObjectContainerType container, IShaderObject** outObject) override; virtual SLANG_NO_THROW Result SLANG_MCALL createShaderObjectFromTypeLayout( - slang::TypeLayoutReflection* typeLayout, IShaderObject** outObject) override; + slang::TypeLayoutReflection* typeLayout, + IShaderObject** outObject) override; virtual SLANG_NO_THROW Result SLANG_MCALL createMutableShaderObjectFromTypeLayout( - slang::TypeLayoutReflection* typeLayout, IShaderObject** outObject) override; - virtual SLANG_NO_THROW Result SLANG_MCALL - createMutableRootShaderObject(IShaderProgram* program, IShaderObject** outObject) override; - virtual SLANG_NO_THROW Result SLANG_MCALL - createProgram(const IShaderProgram::Desc& desc, IShaderProgram** outProgram, ISlangBlob** outDiagnostics) override; + slang::TypeLayoutReflection* typeLayout, + IShaderObject** outObject) override; virtual SLANG_NO_THROW Result SLANG_MCALL - createProgram2(const IShaderProgram::CreateDesc2& desc, IShaderProgram** outProgram, ISlangBlob** outDiagnostics) override; + createMutableRootShaderObject(IShaderProgram* program, IShaderObject** outObject) override; + virtual SLANG_NO_THROW Result SLANG_MCALL createProgram( + const IShaderProgram::Desc& desc, + IShaderProgram** outProgram, + ISlangBlob** outDiagnostics) override; + virtual SLANG_NO_THROW Result SLANG_MCALL createProgram2( + const IShaderProgram::CreateDesc2& desc, + IShaderProgram** outProgram, + ISlangBlob** outDiagnostics) override; virtual SLANG_NO_THROW Result SLANG_MCALL createGraphicsPipelineState( const GraphicsPipelineStateDesc& desc, IPipelineState** outState) override; @@ -139,11 +146,10 @@ public: Size size, ISlangBlob** outBlob) override; virtual SLANG_NO_THROW const DeviceInfo& SLANG_MCALL getDeviceInfo() const override; - virtual SLANG_NO_THROW Result SLANG_MCALL createQueryPool( - const IQueryPool::Desc& desc, - IQueryPool** outPool) override; virtual SLANG_NO_THROW Result SLANG_MCALL - createFence(const IFence::Desc& desc, IFence** outFence) override; + createQueryPool(const IQueryPool::Desc& desc, IQueryPool** outPool) override; + virtual SLANG_NO_THROW Result SLANG_MCALL + createFence(const IFence::Desc& desc, IFence** outFence) override; virtual SLANG_NO_THROW Result SLANG_MCALL waitForFences( GfxCount fenceCount, IFence** fences, @@ -151,10 +157,12 @@ public: bool waitForAll, uint64_t timeout) override; virtual SLANG_NO_THROW Result SLANG_MCALL getTextureAllocationInfo( - const ITextureResource::Desc& desc, size_t* outSize, size_t* outAlignment) override; + const ITextureResource::Desc& desc, + size_t* outSize, + size_t* outAlignment) override; virtual SLANG_NO_THROW Result SLANG_MCALL getTextureRowAlignment(size_t* outAlignment) override; virtual SLANG_NO_THROW Result SLANG_MCALL - createShaderTable(const IShaderTable::Desc& desc, IShaderTable** outTable) override; + createShaderTable(const IShaderTable::Desc& desc, IShaderTable** outTable) override; }; } // namespace debug diff --git a/tools/gfx/debug-layer/debug-fence.cpp b/tools/gfx/debug-layer/debug-fence.cpp index 66c541618..4e8673578 100644 --- a/tools/gfx/debug-layer/debug-fence.cpp +++ b/tools/gfx/debug-layer/debug-fence.cpp @@ -33,7 +33,10 @@ Result DebugFence::setCurrentValue(uint64_t value) SLANG_GFX_API_FUNC; if (value < maxValueToSignal) { - GFX_DIAGNOSE_ERROR_FORMAT("Cannot set fence value (%d) to lower than pending signal value (%d) on the fence.", value, maxValueToSignal); + GFX_DIAGNOSE_ERROR_FORMAT( + "Cannot set fence value (%d) to lower than pending signal value (%d) on the fence.", + value, + maxValueToSignal); } return baseObject->setCurrentValue(value); } diff --git a/tools/gfx/debug-layer/debug-fence.h b/tools/gfx/debug-layer/debug-fence.h index 1f61fac33..de61e5838 100644 --- a/tools/gfx/debug-layer/debug-fence.h +++ b/tools/gfx/debug-layer/debug-fence.h @@ -17,7 +17,9 @@ public: virtual SLANG_NO_THROW Result SLANG_MCALL getCurrentValue(uint64_t* outValue) override; virtual SLANG_NO_THROW Result SLANG_MCALL setCurrentValue(uint64_t value) override; virtual SLANG_NO_THROW Result SLANG_MCALL getSharedHandle(InteropHandle* outHandle) override; - virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(InteropHandle* outNativeHandle) override; + virtual SLANG_NO_THROW Result SLANG_MCALL + getNativeHandle(InteropHandle* outNativeHandle) override; + public: uint64_t maxValueToSignal = 0; }; diff --git a/tools/gfx/debug-layer/debug-framebuffer.h b/tools/gfx/debug-layer/debug-framebuffer.h index 76e05040c..a7ab637de 100644 --- a/tools/gfx/debug-layer/debug-framebuffer.h +++ b/tools/gfx/debug-layer/debug-framebuffer.h @@ -9,8 +9,7 @@ using namespace Slang; namespace debug { -class DebugFramebuffer - : public DebugObject<IFramebuffer> +class DebugFramebuffer : public DebugObject<IFramebuffer> { public: SLANG_COM_OBJECT_IUNKNOWN_ALL; diff --git a/tools/gfx/debug-layer/debug-helper-functions.cpp b/tools/gfx/debug-layer/debug-helper-functions.cpp index e75d0a3c3..adeff9d2e 100644 --- a/tools/gfx/debug-layer/debug-helper-functions.cpp +++ b/tools/gfx/debug-layer/debug-helper-functions.cpp @@ -54,14 +54,14 @@ void validateAccelerationStructureBuildInputs( if (!buildInputs.instanceDescs) { GFX_DIAGNOSE_WARNING("IAccelerationStructure::BuildInputs::instanceDescs is null " - "when creating a top-level acceleration structure."); + "when creating a top-level acceleration structure."); } break; case IAccelerationStructure::Kind::BottomLevel: if (!buildInputs.geometryDescs) { GFX_DIAGNOSE_WARNING("IAccelerationStructure::BuildInputs::geometryDescs is null " - "when creating a bottom-level acceleration structure."); + "when creating a bottom-level acceleration structure."); } for (int i = 0; i < buildInputs.descCount; i++) { @@ -75,12 +75,13 @@ void validateAccelerationStructureBuildInputs( case Format::R16G16B16A16_FLOAT: case Format::R16G16_FLOAT: case Format::R16G16B16A16_SNORM: - case Format::R16G16_SNORM: - break; + case Format::R16G16_SNORM: break; default: GFX_DIAGNOSE_ERROR( - "Unsupported IAccelerationStructure::TriangleDesc::vertexFormat. Valid " - "values are R32G32B32_FLOAT, R32G32_FLOAT, R16G16B16A16_FLOAT, R16G16_FLOAT, " + "Unsupported " + "IAccelerationStructure::TriangleDesc::vertexFormat. Valid " + "values are R32G32B32_FLOAT, R32G32_FLOAT, R16G16B16A16_FLOAT, " + "R16G16_FLOAT, " "R16G16B16A16_SNORM or R16G16_SNORM."); } if (buildInputs.geometryDescs[i].content.triangles.indexCount) @@ -88,17 +89,18 @@ void validateAccelerationStructureBuildInputs( switch (buildInputs.geometryDescs[i].content.triangles.indexFormat) { case Format::R32_UINT: - case Format::R16_UINT: - break; + case Format::R16_UINT: break; default: GFX_DIAGNOSE_ERROR( - "Unsupported IAccelerationStructure::TriangleDesc::indexFormat. Valid " + "Unsupported " + "IAccelerationStructure::TriangleDesc::indexFormat. Valid " "values are Unknown, R32_UINT or R16_UINT."); } if (!buildInputs.geometryDescs[i].content.triangles.indexData) { GFX_DIAGNOSE_ERROR( - "IAccelerationStructure::TriangleDesc::indexData cannot be null if " + "IAccelerationStructure::TriangleDesc::indexData cannot be " + "null if " "IAccelerationStructure::TriangleDesc::indexCount is not 0"); } } @@ -106,14 +108,16 @@ void validateAccelerationStructureBuildInputs( { if (buildInputs.geometryDescs[i].content.triangles.indexCount == 0) { - GFX_DIAGNOSE_ERROR( - "IAccelerationStructure::TriangleDesc::indexCount cannot be 0 if " - "IAccelerationStructure::TriangleDesc::indexFormat is not Format::Unknown"); + GFX_DIAGNOSE_ERROR("IAccelerationStructure::TriangleDesc::" + "indexCount cannot be 0 if " + "IAccelerationStructure::TriangleDesc::" + "indexFormat is not Format::Unknown"); } if (buildInputs.geometryDescs[i].content.triangles.indexData == 0) { GFX_DIAGNOSE_ERROR( - "IAccelerationStructure::TriangleDesc::indexData cannot be null if " + "IAccelerationStructure::TriangleDesc::indexData cannot be " + "null if " "IAccelerationStructure::TriangleDesc::indexFormat is not " "Format::Unknown"); } @@ -130,7 +134,8 @@ void validateAccelerationStructureBuildInputs( if (buildInputs.geometryDescs[i].content.triangles.indexData != 0) { GFX_DIAGNOSE_ERROR( - "IAccelerationStructure::TriangleDesc::indexData must be null if " + "IAccelerationStructure::TriangleDesc::indexData must be null " + "if " "IAccelerationStructure::TriangleDesc::indexFormat is " "Format::Unknown"); } @@ -144,9 +149,7 @@ void validateAccelerationStructureBuildInputs( } } break; - default: - GFX_DIAGNOSE_ERROR("Invalid value of IAccelerationStructure::Kind."); - break; + default: GFX_DIAGNOSE_ERROR("Invalid value of IAccelerationStructure::Kind."); break; } } diff --git a/tools/gfx/debug-layer/debug-helper-functions.h b/tools/gfx/debug-layer/debug-helper-functions.h index f2edd0d84..8fad98f8a 100644 --- a/tools/gfx/debug-layer/debug-helper-functions.h +++ b/tools/gfx/debug-layer/debug-helper-functions.h @@ -1,7 +1,6 @@ // debug-helper-functions.h #pragma once #include "debug-base.h" - #include "debug-buffer.h" #include "debug-command-buffer.h" #include "debug-command-queue.h" @@ -29,13 +28,13 @@ namespace debug { #ifdef __FUNCSIG__ -# define SLANG_FUNC_SIG __FUNCSIG__ +#define SLANG_FUNC_SIG __FUNCSIG__ #elif defined(__PRETTY_FUNCTION__) -# define SLANG_FUNC_SIG __FUNCSIG__ +#define SLANG_FUNC_SIG __FUNCSIG__ #elif defined(__FUNCTION__) -# define SLANG_FUNC_SIG __FUNCTION__ +#define SLANG_FUNC_SIG __FUNCTION__ #else -# define SLANG_FUNC_SIG "UnknownFunction" +#define SLANG_FUNC_SIG "UnknownFunction" #endif extern thread_local const char* _currentFunctionName; @@ -50,12 +49,12 @@ struct SetCurrentFuncRAII /// Returns the public API function name from a `SLANG_FUNC_SIG` string. String _gfxGetFuncName(const char* input); -template <typename... TArgs> +template<typename... TArgs> char* _gfxDiagnoseFormat( - char* buffer, // Initial buffer to output formatted string. - size_t shortBufferSize, // Size of the initial buffer. + char* buffer, // Initial buffer to output formatted string. + size_t shortBufferSize, // Size of the initial buffer. List<char>& bufferArray, // A list for allocating a large buffer if needed. - const char* format, // The format string. + const char* format, // The format string. TArgs... args) { int length = sprintf_s(buffer, shortBufferSize, format, args...); @@ -70,7 +69,7 @@ char* _gfxDiagnoseFormat( return buffer; } -template <typename... TArgs> +template<typename... TArgs> void _gfxDiagnoseImpl(DebugMessageType type, const char* format, TArgs... args) { char shortBuffer[256]; @@ -103,7 +102,11 @@ void _gfxDiagnoseImpl(DebugMessageType type, const char* format, TArgs... args) char shortBuffer[256]; \ List<char> bufferArray; \ auto message = _gfxDiagnoseFormat( \ - shortBuffer, sizeof(shortBuffer), bufferArray, format, __VA_ARGS__); \ + shortBuffer, \ + sizeof(shortBuffer), \ + bufferArray, \ + format, \ + __VA_ARGS__); \ _gfxDiagnoseImpl( \ type, \ "%s: %s", \ @@ -117,16 +120,16 @@ void _gfxDiagnoseImpl(DebugMessageType type, const char* format, TArgs... args) I##typeName* Debug##typeName::getInterface(const Slang::Guid& guid) \ { \ return (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_I##typeName) \ - ? static_cast<I##typeName*>(this) \ - : nullptr; \ + ? static_cast<I##typeName*>(this) \ + : nullptr; \ } #define SLANG_GFX_DEBUG_GET_INTERFACE_IMPL_PARENT(typeName, parentType) \ I##typeName* Debug##typeName::getInterface(const Slang::Guid& guid) \ { \ return (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_I##typeName || \ guid == GfxGUID::IID_I##parentType) \ - ? static_cast<I##typeName*>(this) \ - : nullptr; \ + ? static_cast<I##typeName*>(this) \ + : nullptr; \ } // Utility conversion functions to get Debug* object or the inner object from a user provided diff --git a/tools/gfx/debug-layer/debug-query.h b/tools/gfx/debug-layer/debug-query.h index 890745387..a1faa966b 100644 --- a/tools/gfx/debug-layer/debug-query.h +++ b/tools/gfx/debug-layer/debug-query.h @@ -15,10 +15,11 @@ public: SLANG_COM_OBJECT_IUNKNOWN_ALL; IQueryPool::Desc desc; + public: IQueryPool* getInterface(const Slang::Guid& guid); virtual SLANG_NO_THROW Result SLANG_MCALL - getResult(GfxIndex index, GfxCount count, uint64_t* data) override; + getResult(GfxIndex index, GfxCount count, uint64_t* data) override; virtual SLANG_NO_THROW Result SLANG_MCALL reset() override; }; diff --git a/tools/gfx/debug-layer/debug-resource-views.h b/tools/gfx/debug-layer/debug-resource-views.h index b9a9b4539..625860a08 100644 --- a/tools/gfx/debug-layer/debug-resource-views.h +++ b/tools/gfx/debug-layer/debug-resource-views.h @@ -17,7 +17,8 @@ public: public: IResourceView* getInterface(const Slang::Guid& guid); virtual SLANG_NO_THROW Desc* SLANG_MCALL getViewDesc() override; - virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(InteropHandle* outNativeHandle) override; + virtual SLANG_NO_THROW Result SLANG_MCALL + getNativeHandle(InteropHandle* outNativeHandle) override; }; class DebugAccelerationStructure : public DebugObject<IAccelerationStructure> @@ -29,7 +30,7 @@ public: IAccelerationStructure* getInterface(const Slang::Guid& guid); virtual SLANG_NO_THROW DeviceAddress SLANG_MCALL getDeviceAddress() override; virtual SLANG_NO_THROW Result SLANG_MCALL - getNativeHandle(InteropHandle* outNativeHandle) override; + getNativeHandle(InteropHandle* outNativeHandle) override; virtual SLANG_NO_THROW Desc* SLANG_MCALL getViewDesc() override; }; diff --git a/tools/gfx/debug-layer/debug-sampler-state.h b/tools/gfx/debug-layer/debug-sampler-state.h index d0b082ec5..0cabd8da7 100644 --- a/tools/gfx/debug-layer/debug-sampler-state.h +++ b/tools/gfx/debug-layer/debug-sampler-state.h @@ -17,7 +17,7 @@ public: public: ISamplerState* getInterface(const Slang::Guid& guid); virtual SLANG_NO_THROW Result SLANG_MCALL - getNativeHandle(InteropHandle* outNativeHandle) override; + getNativeHandle(InteropHandle* outNativeHandle) override; }; } // namespace debug diff --git a/tools/gfx/debug-layer/debug-shader-object.cpp b/tools/gfx/debug-layer/debug-shader-object.cpp index eb67c46ab..c262320f5 100644 --- a/tools/gfx/debug-layer/debug-shader-object.cpp +++ b/tools/gfx/debug-layer/debug-shader-object.cpp @@ -1,11 +1,10 @@ // debug-shader-object.cpp #include "debug-shader-object.h" +#include "debug-helper-functions.h" #include "debug-resource-views.h" #include "debug-sampler-state.h" -#include "debug-helper-functions.h" - namespace gfx { using namespace Slang; @@ -142,7 +141,9 @@ Result DebugShaderObject::setCombinedTextureSampler( m_resources[ShaderOffsetKey{offset}] = viewImpl; m_initializedBindingRanges.add(offset.bindingRangeIndex); return baseObject->setCombinedTextureSampler( - offset, getInnerObj(viewImpl), getInnerObj(sampler)); + offset, + getInnerObj(viewImpl), + getInnerObj(sampler)); } Result DebugShaderObject::setSpecializationArgs( @@ -155,11 +156,13 @@ Result DebugShaderObject::setSpecializationArgs( } Result DebugShaderObject::getCurrentVersion( - ITransientResourceHeap* transientHeap, IShaderObject** outObject) + ITransientResourceHeap* transientHeap, + IShaderObject** outObject) { SLANG_GFX_API_FUNC; ComPtr<IShaderObject> innerObject; - SLANG_RETURN_ON_FAIL(baseObject->getCurrentVersion(getInnerObj(transientHeap), innerObject.writeRef())); + SLANG_RETURN_ON_FAIL( + baseObject->getCurrentVersion(getInnerObj(transientHeap), innerObject.writeRef())); RefPtr<DebugShaderObject> debugShaderObject = new DebugShaderObject(); debugShaderObject->baseObject = innerObject; debugShaderObject->m_typeName = innerObject->getElementTypeLayout()->getName(); diff --git a/tools/gfx/debug-layer/debug-shader-object.h b/tools/gfx/debug-layer/debug-shader-object.h index b5a268892..56fda0622 100644 --- a/tools/gfx/debug-layer/debug-shader-object.h +++ b/tools/gfx/debug-layer/debug-shader-object.h @@ -15,8 +15,8 @@ struct ShaderOffsetKey bool operator==(ShaderOffsetKey other) const { return offset.bindingArrayIndex == other.offset.bindingArrayIndex && - offset.bindingRangeIndex == other.offset.bindingRangeIndex && - offset.uniformOffset == other.offset.uniformOffset; + offset.bindingRangeIndex == other.offset.bindingRangeIndex && + offset.uniformOffset == other.offset.uniformOffset; } Slang::HashCode getHashCode() const { @@ -40,17 +40,17 @@ public: virtual SLANG_NO_THROW ShaderObjectContainerType SLANG_MCALL getContainerType() override; virtual SLANG_NO_THROW GfxCount SLANG_MCALL getEntryPointCount() override; virtual SLANG_NO_THROW Result SLANG_MCALL - getEntryPoint(GfxIndex index, IShaderObject** entryPoint) override; + getEntryPoint(GfxIndex index, IShaderObject** entryPoint) override; virtual SLANG_NO_THROW Result SLANG_MCALL - setData(ShaderOffset const& offset, void const* data, size_t size) override; + setData(ShaderOffset const& offset, void const* data, size_t size) override; virtual SLANG_NO_THROW Result SLANG_MCALL - getObject(ShaderOffset const& offset, IShaderObject** object) override; + getObject(ShaderOffset const& offset, IShaderObject** object) override; virtual SLANG_NO_THROW Result SLANG_MCALL - setObject(ShaderOffset const& offset, IShaderObject* object) override; + setObject(ShaderOffset const& offset, IShaderObject* object) override; virtual SLANG_NO_THROW Result SLANG_MCALL - setResource(ShaderOffset const& offset, IResourceView* resourceView) override; + setResource(ShaderOffset const& offset, IResourceView* resourceView) override; virtual SLANG_NO_THROW Result SLANG_MCALL - setSampler(ShaderOffset const& offset, ISamplerState* sampler) override; + setSampler(ShaderOffset const& offset, ISamplerState* sampler) override; virtual SLANG_NO_THROW Result SLANG_MCALL setCombinedTextureSampler( ShaderOffset const& offset, IResourceView* textureView, @@ -60,12 +60,12 @@ public: const slang::SpecializationArg* args, GfxCount count) override; - virtual SLANG_NO_THROW Result SLANG_MCALL getCurrentVersion( - ITransientResourceHeap* transientHeap, IShaderObject** outObject) override; + virtual SLANG_NO_THROW Result SLANG_MCALL + getCurrentVersion(ITransientResourceHeap* transientHeap, IShaderObject** outObject) override; virtual SLANG_NO_THROW const void* SLANG_MCALL getRawData() override; virtual SLANG_NO_THROW size_t SLANG_MCALL getSize() override; virtual SLANG_NO_THROW Result SLANG_MCALL - setConstantBufferOverride(IBufferResource* constantBuffer) override; + setConstantBufferOverride(IBufferResource* constantBuffer) override; public: // Type name of an ordinary shader object. diff --git a/tools/gfx/debug-layer/debug-shader-program.h b/tools/gfx/debug-layer/debug-shader-program.h index 0f154f2a3..a98a40ded 100644 --- a/tools/gfx/debug-layer/debug-shader-program.h +++ b/tools/gfx/debug-layer/debug-shader-program.h @@ -16,7 +16,9 @@ public: public: IShaderProgram* getInterface(const Slang::Guid& guid); - virtual SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL findTypeByName(const char* name) override; + virtual SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL + findTypeByName(const char* name) override; + public: Slang::ComPtr<slang::IComponentType> m_slangProgram; }; diff --git a/tools/gfx/debug-layer/debug-swap-chain.cpp b/tools/gfx/debug-layer/debug-swap-chain.cpp index b1d3bc201..904d8d0c6 100644 --- a/tools/gfx/debug-layer/debug-swap-chain.cpp +++ b/tools/gfx/debug-layer/debug-swap-chain.cpp @@ -2,9 +2,8 @@ #include "debug-swap-chain.h" #include "debug-command-queue.h" -#include "debug-texture.h" - #include "debug-helper-functions.h" +#include "debug-texture.h" namespace gfx { diff --git a/tools/gfx/debug-layer/debug-swap-chain.h b/tools/gfx/debug-layer/debug-swap-chain.h index 83a467d65..92accb4fd 100644 --- a/tools/gfx/debug-layer/debug-swap-chain.h +++ b/tools/gfx/debug-layer/debug-swap-chain.h @@ -18,7 +18,7 @@ public: ISwapchain* getInterface(const Slang::Guid& guid); virtual SLANG_NO_THROW const Desc& SLANG_MCALL getDesc() override; virtual SLANG_NO_THROW Result SLANG_MCALL - getImage(GfxIndex index, ITextureResource** outResource) override; + getImage(GfxIndex index, ITextureResource** outResource) override; virtual SLANG_NO_THROW Result SLANG_MCALL present() override; virtual SLANG_NO_THROW int SLANG_MCALL acquireNextImage() override; virtual SLANG_NO_THROW Result SLANG_MCALL resize(GfxCount width, GfxCount height) override; diff --git a/tools/gfx/debug-layer/debug-texture.cpp b/tools/gfx/debug-layer/debug-texture.cpp index ad3dce4fe..87ca019b0 100644 --- a/tools/gfx/debug-layer/debug-texture.cpp +++ b/tools/gfx/debug-layer/debug-texture.cpp @@ -39,7 +39,10 @@ Result DebugTextureResource::setDebugName(const char* name) return baseObject->setDebugName(name); } -const char* DebugTextureResource::getDebugName() { return baseObject->getDebugName(); } +const char* DebugTextureResource::getDebugName() +{ + return baseObject->getDebugName(); +} } // namespace debug } // namespace gfx diff --git a/tools/gfx/debug-layer/debug-texture.h b/tools/gfx/debug-layer/debug-texture.h index 79e3aa3cf..a560f6a56 100644 --- a/tools/gfx/debug-layer/debug-texture.h +++ b/tools/gfx/debug-layer/debug-texture.h @@ -18,7 +18,8 @@ public: ITextureResource* getInterface(const Slang::Guid& guid); virtual SLANG_NO_THROW Type SLANG_MCALL getType() override; virtual SLANG_NO_THROW Desc* SLANG_MCALL getDesc() override; - virtual SLANG_NO_THROW Result SLANG_MCALL getNativeResourceHandle(InteropHandle* outHandle) override; + virtual SLANG_NO_THROW Result SLANG_MCALL + getNativeResourceHandle(InteropHandle* outHandle) override; virtual SLANG_NO_THROW Result SLANG_MCALL getSharedHandle(InteropHandle* outHandle) override; virtual SLANG_NO_THROW Result SLANG_MCALL setDebugName(const char* name) override; diff --git a/tools/gfx/debug-layer/debug-transient-heap.cpp b/tools/gfx/debug-layer/debug-transient-heap.cpp index 84861297a..424a8feb1 100644 --- a/tools/gfx/debug-layer/debug-transient-heap.cpp +++ b/tools/gfx/debug-layer/debug-transient-heap.cpp @@ -2,7 +2,6 @@ #include "debug-transient-heap.h" #include "debug-command-buffer.h" - #include "debug-helper-functions.h" namespace gfx @@ -79,7 +78,10 @@ Result DebugTransientResourceHeapD3D12::allocateTransientDescriptorTable( SLANG_GFX_API_FUNC; return baseObject->allocateTransientDescriptorTable( - type, count, outDescriptorOffset, outD3DDescriptorHeapHandle); + type, + count, + outDescriptorOffset, + outD3DDescriptorHeapHandle); } } // namespace debug diff --git a/tools/gfx/debug-layer/debug-transient-heap.h b/tools/gfx/debug-layer/debug-transient-heap.h index 60430228d..4b4b4e227 100644 --- a/tools/gfx/debug-layer/debug-transient-heap.h +++ b/tools/gfx/debug-layer/debug-transient-heap.h @@ -16,12 +16,13 @@ public: SLANG_COM_OBJECT_IUNKNOWN_RELEASE; public: - virtual SLANG_NO_THROW SlangResult SLANG_MCALL queryInterface(SlangUUID const& uuid, void** outObject) override; + virtual SLANG_NO_THROW SlangResult SLANG_MCALL + queryInterface(SlangUUID const& uuid, void** outObject) override; virtual SLANG_NO_THROW Result SLANG_MCALL synchronizeAndReset() override; virtual SLANG_NO_THROW Result SLANG_MCALL finish() override; virtual SLANG_NO_THROW Result SLANG_MCALL - createCommandBuffer(ICommandBuffer** outCommandBuffer) override; + createCommandBuffer(ICommandBuffer** outCommandBuffer) override; }; class DebugTransientResourceHeapD3D12 : public DebugObject<ITransientResourceHeapD3D12> @@ -29,8 +30,10 @@ class DebugTransientResourceHeapD3D12 : public DebugObject<ITransientResourceHea public: SLANG_COM_OBJECT_IUNKNOWN_ADD_REF; SLANG_COM_OBJECT_IUNKNOWN_RELEASE; + public: - virtual SLANG_NO_THROW SlangResult SLANG_MCALL queryInterface(SlangUUID const& uuid, void** outObject) override; + virtual SLANG_NO_THROW SlangResult SLANG_MCALL + queryInterface(SlangUUID const& uuid, void** outObject) override; virtual SLANG_NO_THROW Result SLANG_MCALL allocateTransientDescriptorTable( DescriptorType type, GfxCount count, |
