summaryrefslogtreecommitdiff
path: root/tools/gfx/debug-layer.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-11-04 09:40:56 -0700
committerGitHub <noreply@github.com>2021-11-04 09:40:56 -0700
commit8fe3f9cd7d664fc98e33cf276427390b42b9b468 (patch)
tree2e920085fc82f45befef0c438357596e3d159e82 /tools/gfx/debug-layer.h
parentaf0f26d54ce39b6d7203646abd6e970b8113584c (diff)
Add interface for new gfx features. (#2003)
* Add interface for new gfx features. * Add cuda implementation. * Code review fixes. * Fix. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/debug-layer.h')
-rw-r--r--tools/gfx/debug-layer.h63
1 files changed, 62 insertions, 1 deletions
diff --git a/tools/gfx/debug-layer.h b/tools/gfx/debug-layer.h
index aa56e5530..9be3aca20 100644
--- a/tools/gfx/debug-layer.h
+++ b/tools/gfx/debug-layer.h
@@ -45,6 +45,9 @@ public:
virtual SLANG_NO_THROW Result SLANG_MCALL
getFeatures(const char** outFeatures, UInt bufferSize, UInt* outFeatureCount) override;
virtual SLANG_NO_THROW Result SLANG_MCALL
+ getFormatSupportedResourceStates(Format format, ResourceStateSet* outStates) override;
+
+ virtual SLANG_NO_THROW Result SLANG_MCALL
getSlangSession(slang::ISession** outSlangSession) override;
virtual SLANG_NO_THROW Result SLANG_MCALL createTransientResourceHeap(
const ITransientResourceHeap::Desc& desc,
@@ -100,6 +103,8 @@ public:
ShaderObjectContainerType container,
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) override;
virtual SLANG_NO_THROW Result SLANG_MCALL createGraphicsPipelineState(
const GraphicsPipelineStateDesc& desc,
@@ -125,6 +130,10 @@ public:
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;
+ virtual SLANG_NO_THROW Result SLANG_MCALL
+ waitForFences(IFence** fences, uint32_t fenceCount, bool waitForAll, uint64_t timeout) override;
};
class DebugQueryPool : public DebugObject<IQueryPool>
@@ -149,6 +158,8 @@ public:
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 getNativeHandle(NativeHandle* outHandle) override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL setDebugName(const char* name) override;
+ virtual SLANG_NO_THROW const char* SLANG_MCALL getDebugName() override;
};
class DebugTextureResource : public DebugObject<ITextureResource>
@@ -161,6 +172,8 @@ public:
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 getNativeHandle(NativeHandle* outHandle) override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL setDebugName(const char* name) override;
+ virtual SLANG_NO_THROW const char* SLANG_MCALL getDebugName() override;
};
class DebugResourceView : public DebugObject<IResourceView>
@@ -276,7 +289,11 @@ public:
virtual SLANG_NO_THROW void SLANG_MCALL endEncoding() override;
virtual SLANG_NO_THROW Result SLANG_MCALL
bindPipeline(IPipelineState* state, IShaderObject** outRootShaderObject) override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL
+ bindPipelineAndRootObject(IPipelineState* state, IShaderObject* rootObject) override;
virtual SLANG_NO_THROW void SLANG_MCALL dispatchCompute(int x, int y, int z) override;
+ virtual SLANG_NO_THROW void SLANG_MCALL
+ dispatchComputeIndirect(IBufferResource* cmdBuffer, uint64_t offset) override;
virtual SLANG_NO_THROW void SLANG_MCALL writeTimestamp(IQueryPool* pool, SlangInt index) override;
public:
@@ -290,6 +307,8 @@ public:
virtual SLANG_NO_THROW void SLANG_MCALL endEncoding() override;
virtual SLANG_NO_THROW Result SLANG_MCALL
bindPipeline(IPipelineState* state, IShaderObject** outRootShaderObject) override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL
+ bindPipelineAndRootObject(IPipelineState* state, IShaderObject* rootObject) override;
virtual SLANG_NO_THROW void SLANG_MCALL
setViewports(uint32_t count, const Viewport* viewports) override;
virtual SLANG_NO_THROW void SLANG_MCALL
@@ -307,6 +326,18 @@ public:
virtual SLANG_NO_THROW void SLANG_MCALL draw(UInt vertexCount, UInt startVertex = 0) override;
virtual SLANG_NO_THROW void SLANG_MCALL
drawIndexed(UInt indexCount, UInt startIndex = 0, UInt baseVertex = 0) override;
+ virtual SLANG_NO_THROW void SLANG_MCALL drawIndirect(
+ uint32_t maxDrawCount,
+ IBufferResource* argBuffer,
+ uint64_t argOffset,
+ IBufferResource* countBuffer,
+ uint64_t countOffset) override;
+ virtual SLANG_NO_THROW void SLANG_MCALL drawIndexedIndirect(
+ uint32_t maxDrawCount,
+ IBufferResource* argBuffer,
+ uint64_t argOffset,
+ IBufferResource* countBuffer,
+ uint64_t countOffset) override;
virtual SLANG_NO_THROW void SLANG_MCALL setStencilReference(uint32_t referenceValue) override;
virtual SLANG_NO_THROW void SLANG_MCALL writeTimestamp(IQueryPool* pool, SlangInt index) override;
@@ -338,6 +369,23 @@ public:
IBufferResource* const* buffers,
ResourceState src,
ResourceState dst) override;
+ virtual SLANG_NO_THROW void SLANG_MCALL copyTexture(
+ ITextureResource* dst,
+ ITextureResource::SubresourceRange dstSubresource,
+ ITextureResource::Offset3D dstOffset,
+ ITextureResource* src,
+ ITextureResource::SubresourceRange srcSubresource,
+ ITextureResource::Offset3D srcOffset,
+ ITextureResource::Size extent) override;
+
+ virtual SLANG_NO_THROW void SLANG_MCALL uploadTextureData(
+ ITextureResource* dst,
+ ITextureResource::SubresourceRange subResourceRange,
+ ITextureResource::Offset3D offset,
+ ITextureResource::Offset3D extent,
+ ITextureResource::SubresourceData* subResourceData,
+ size_t subResourceDataCount) override;
+
public:
DebugCommandBuffer* commandBuffer;
bool isOpen = false;
@@ -374,6 +422,8 @@ public:
AccessFlag::Enum destAccess) override;
virtual SLANG_NO_THROW void SLANG_MCALL
bindPipeline(IPipelineState* state, IShaderObject** outRootObject) override;
+ virtual SLANG_NO_THROW void SLANG_MCALL
+ bindPipelineAndRootObject(IPipelineState* state, IShaderObject* rootObject) override;
virtual SLANG_NO_THROW void SLANG_MCALL dispatchRays(
const char* rayGenShaderName,
int32_t width,
@@ -385,6 +435,17 @@ public:
bool isOpen = false;
};
+class DebugFence : public DebugObject<IFence>
+{
+public:
+ SLANG_COM_OBJECT_IUNKNOWN_ALL;
+ IFence* getInterface(const Slang::Guid& guid);
+ virtual SLANG_NO_THROW FenceStatus SLANG_MCALL getStatus() override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL reset() override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL getSharedHandle(uint64_t* outHandle) override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(void** outNativeHandle) override;
+};
+
class DebugTransientResourceHeap;
class DebugCommandBuffer : public DebugObject<ICommandBuffer>
@@ -434,7 +495,7 @@ 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(uint32_t count, ICommandBuffer* const* commandBuffers) override;
+ executeCommandBuffers(uint32_t count, ICommandBuffer* const* commandBuffers, IFence* fence) override;
virtual SLANG_NO_THROW void SLANG_MCALL wait() override;
virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(NativeHandle* outHandle) override;
};