summaryrefslogtreecommitdiff
path: root/tools/gfx/renderer-shared.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/renderer-shared.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/renderer-shared.h')
-rw-r--r--tools/gfx/renderer-shared.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/gfx/renderer-shared.h b/tools/gfx/renderer-shared.h
index 51db601c9..11e80dbaa 100644
--- a/tools/gfx/renderer-shared.h
+++ b/tools/gfx/renderer-shared.h
@@ -38,6 +38,7 @@ struct GfxGUID
static const Slang::Guid IID_ICommandQueue;
static const Slang::Guid IID_IQueryPool;
static const Slang::Guid IID_IAccelerationStructure;
+ static const Slang::Guid IID_IFence;
};
// We use a `BreakableReference` to avoid the cyclic reference situation in gfx implementation.
@@ -199,6 +200,7 @@ protected:
{}
IResource::Type m_type;
+ Slang::String m_debugName;
};
class BufferResource : public IBufferResource, public Resource
@@ -219,6 +221,15 @@ public:
virtual SLANG_NO_THROW IResource::Type SLANG_MCALL getType() SLANG_OVERRIDE;
virtual SLANG_NO_THROW IBufferResource::Desc* SLANG_MCALL getDesc() SLANG_OVERRIDE;
virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(NativeHandle* outHandle) SLANG_OVERRIDE;
+ virtual SLANG_NO_THROW Result SLANG_MCALL setDebugName(const char* name) override
+ {
+ m_debugName = name;
+ return SLANG_OK;
+ }
+ virtual SLANG_NO_THROW const char* SLANG_MCALL getDebugName() override
+ {
+ return m_debugName.getBuffer();
+ }
protected:
Desc m_desc;
@@ -242,6 +253,15 @@ public:
virtual SLANG_NO_THROW IResource::Type SLANG_MCALL getType() SLANG_OVERRIDE;
virtual SLANG_NO_THROW ITextureResource::Desc* SLANG_MCALL getDesc() SLANG_OVERRIDE;
virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(NativeHandle* outHandle) SLANG_OVERRIDE;
+ virtual SLANG_NO_THROW Result SLANG_MCALL setDebugName(const char* name) override
+ {
+ m_debugName = name;
+ return SLANG_OK;
+ }
+ virtual SLANG_NO_THROW const char* SLANG_MCALL getDebugName() override
+ {
+ return m_debugName.getBuffer();
+ }
protected:
Desc m_desc;
@@ -1151,6 +1171,8 @@ public:
virtual SLANG_NO_THROW Result SLANG_MCALL getFeatures(
const char** outFeatures, UInt bufferSize, UInt* outFeatureCount) SLANG_OVERRIDE;
virtual SLANG_NO_THROW bool SLANG_MCALL hasFeature(const char* featureName) SLANG_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) SLANG_OVERRIDE;
IDevice* getInterface(const Slang::Guid& guid);
@@ -1181,6 +1203,18 @@ public:
virtual SLANG_NO_THROW Result SLANG_MCALL createRayTracingPipelineState(
const RayTracingPipelineStateDesc& desc, IPipelineState** outState) override;
+ // Provides a default implementation that returns SLANG_E_NOT_AVAILABLE.
+ virtual SLANG_NO_THROW Result SLANG_MCALL
+ createMutableRootShaderObject(IShaderProgram* program, IShaderObject** outObject) override;
+
+ // Provides a default implementation that returns SLANG_E_NOT_AVAILABLE.
+ virtual SLANG_NO_THROW Result SLANG_MCALL
+ createFence(const IFence::Desc& desc, IFence** outFence) override;
+
+ // Provides a default implementation that returns SLANG_E_NOT_AVAILABLE.
+ virtual SLANG_NO_THROW Result SLANG_MCALL
+ waitForFences(IFence** fences, uint32_t fenceCount, bool waitForAll, uint64_t timeout) override;
+
Result getShaderObjectLayout(
slang::TypeReflection* type,
ShaderObjectContainerType container,