summaryrefslogtreecommitdiff
path: root/tools/gfx/renderer-shared.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-06-30 14:59:18 -0700
committerGitHub <noreply@github.com>2021-06-30 14:59:18 -0700
commita03d21a5f54cba913c3f52e2822a433de8f39fdd (patch)
tree84d24d4355cc4b3e941da9eab57147cd9d297ee4 /tools/gfx/renderer-shared.h
parent5395ef82535c283109b1ea6b89b737c5a39bf147 (diff)
[gfx] Add inline ray tracing support. (#1899)
Diffstat (limited to 'tools/gfx/renderer-shared.h')
-rw-r--r--tools/gfx/renderer-shared.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/gfx/renderer-shared.h b/tools/gfx/renderer-shared.h
index 127987726..e3580b9b6 100644
--- a/tools/gfx/renderer-shared.h
+++ b/tools/gfx/renderer-shared.h
@@ -33,9 +33,11 @@ struct GfxGUID
static const Slang::Guid IID_IRenderCommandEncoder;
static const Slang::Guid IID_IComputeCommandEncoder;
static const Slang::Guid IID_IResourceCommandEncoder;
+ static const Slang::Guid IID_IRayTracingCommandEncoder;
static const Slang::Guid IID_ICommandBuffer;
static const Slang::Guid IID_ICommandQueue;
static const Slang::Guid IID_IQueryPool;
+ static const Slang::Guid IID_IAccelerationStructure;
};
// We use a `BreakableReference` to avoid the cyclic reference situation in gfx implementation.
@@ -252,6 +254,15 @@ public:
IResourceView* getInterface(const Slang::Guid& guid);
};
+class AccelerationStructureBase
+ : public IAccelerationStructure
+ , public Slang::ComObject
+{
+public:
+ SLANG_COM_OBJECT_IUNKNOWN_ALL
+ IAccelerationStructure* getInterface(const Slang::Guid& guid);
+};
+
class RendererBase;
typedef uint32_t ShaderComponentID;
@@ -1061,6 +1072,18 @@ public:
ShaderObjectContainerType containerType,
IShaderObject** outObject) SLANG_OVERRIDE;
+ // Provides a default implementation that returns SLANG_E_NOT_AVAILABLE for platforms
+ // without ray tracing support.
+ virtual SLANG_NO_THROW Result SLANG_MCALL getAccelerationStructurePrebuildInfo(
+ const IAccelerationStructure::BuildInputs& buildInputs,
+ IAccelerationStructure::PrebuildInfo* outPrebuildInfo) override;
+
+ // Provides a default implementation that returns SLANG_E_NOT_AVAILABLE for platforms
+ // without ray tracing support.
+ virtual SLANG_NO_THROW Result SLANG_MCALL createAccelerationStructure(
+ const IAccelerationStructure::CreateDesc& desc,
+ IAccelerationStructure** outView) override;
+
Result getShaderObjectLayout(
slang::TypeReflection* type,
ShaderObjectContainerType container,