diff options
| author | Yong He <yonghe@outlook.com> | 2021-06-30 14:59:18 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-30 14:59:18 -0700 |
| commit | a03d21a5f54cba913c3f52e2822a433de8f39fdd (patch) | |
| tree | 84d24d4355cc4b3e941da9eab57147cd9d297ee4 /tools/gfx/renderer-shared.cpp | |
| parent | 5395ef82535c283109b1ea6b89b737c5a39bf147 (diff) | |
[gfx] Add inline ray tracing support. (#1899)
Diffstat (limited to 'tools/gfx/renderer-shared.cpp')
| -rw-r--r-- | tools/gfx/renderer-shared.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/tools/gfx/renderer-shared.cpp b/tools/gfx/renderer-shared.cpp index 9d6c85309..c88081547 100644 --- a/tools/gfx/renderer-shared.cpp +++ b/tools/gfx/renderer-shared.cpp @@ -25,13 +25,11 @@ const Slang::Guid GfxGUID::IID_IDevice = SLANG_UUID_IDevice; const Slang::Guid GfxGUID::IID_IShaderObject = SLANG_UUID_IShaderObject; const Slang::Guid GfxGUID::IID_IRenderPassLayout = SLANG_UUID_IRenderPassLayout; -const Slang::Guid GfxGUID::IID_ICommandEncoder = SLANG_UUID_ICommandEncoder; -const Slang::Guid GfxGUID::IID_IRenderCommandEncoder = SLANG_UUID_IRenderCommandEncoder; -const Slang::Guid GfxGUID::IID_IComputeCommandEncoder = SLANG_UUID_IComputeCommandEncoder; -const Slang::Guid GfxGUID::IID_IResourceCommandEncoder = SLANG_UUID_IResourceCommandEncoder; +const Slang::Guid GfxGUID::IID_IRayTracingCommandEncoder = SLANG_UUID_IRayTracingCommandEncoder; const Slang::Guid GfxGUID::IID_ICommandBuffer = SLANG_UUID_ICommandBuffer; const Slang::Guid GfxGUID::IID_ICommandQueue = SLANG_UUID_ICommandQueue; const Slang::Guid GfxGUID::IID_IQueryPool = SLANG_UUID_IQueryPool; +const Slang::Guid GfxGUID::IID_IAccelerationStructure = SLANG_UUID_IAccelerationStructure; StageType translateStage(SlangStage slangStage) @@ -119,6 +117,14 @@ IResourceView* ResourceViewBase::getInterface(const Guid& guid) return nullptr; } +IAccelerationStructure* AccelerationStructureBase::getInterface(const Slang::Guid& guid) +{ + if (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_IResourceView || + guid == GfxGUID::IID_IAccelerationStructure) + return static_cast<IAccelerationStructure*>(this); + return nullptr; +} + IShaderObject* ShaderObjectBase::getInterface(const Guid& guid) { if (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_IShaderObject) @@ -279,6 +285,24 @@ SLANG_NO_THROW Result SLANG_MCALL RendererBase::createShaderObject( return createShaderObject(shaderObjectLayout, outObject); } +Result RendererBase::getAccelerationStructurePrebuildInfo( + const IAccelerationStructure::BuildInputs& buildInputs, + IAccelerationStructure::PrebuildInfo* outPrebuildInfo) +{ + SLANG_UNUSED(buildInputs); + SLANG_UNUSED(outPrebuildInfo); + return SLANG_E_NOT_AVAILABLE; +} + +Result RendererBase::createAccelerationStructure( + const IAccelerationStructure::CreateDesc& desc, + IAccelerationStructure** outView) +{ + SLANG_UNUSED(desc); + SLANG_UNUSED(outView); + return SLANG_E_NOT_AVAILABLE; +} + Result RendererBase::getShaderObjectLayout( slang::TypeReflection* type, ShaderObjectContainerType container, |
