From 8fe3f9cd7d664fc98e33cf276427390b42b9b468 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 4 Nov 2021 09:40:56 -0700 Subject: 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 --- tools/gfx/renderer-shared.cpp | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'tools/gfx/renderer-shared.cpp') diff --git a/tools/gfx/renderer-shared.cpp b/tools/gfx/renderer-shared.cpp index 791cb1859..64f3f318c 100644 --- a/tools/gfx/renderer-shared.cpp +++ b/tools/gfx/renderer-shared.cpp @@ -31,6 +31,7 @@ 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; +const Slang::Guid GfxGUID::IID_IFence = SLANG_UUID_IFence; StageType translateStage(SlangStage slangStage) @@ -300,6 +301,30 @@ SLANG_NO_THROW bool SLANG_MCALL RendererBase::hasFeature(const char* featureName return m_features.findFirstIndex([&](Slang::String x) { return x == featureName; }) != -1; } +Result RendererBase::getFormatSupportedResourceStates(Format format, ResourceStateSet* outStates) +{ + SLANG_UNUSED(format); + outStates->add(ResourceState::AccelerationStructure); + outStates->add(ResourceState::ConstantBuffer); + outStates->add(ResourceState::CopyDestination); + outStates->add(ResourceState::CopySource); + outStates->add(ResourceState::DepthRead); + outStates->add(ResourceState::DepthWrite); + outStates->add(ResourceState::IndexBuffer); + outStates->add(ResourceState::IndirectArgument); + outStates->add(ResourceState::PreInitialized); + outStates->add(ResourceState::Present); + outStates->add(ResourceState::RenderTarget); + outStates->add(ResourceState::ResolveDestination); + outStates->add(ResourceState::ResolveSource); + outStates->add(ResourceState::ShaderResource); + outStates->add(ResourceState::StreamOutput); + outStates->add(ResourceState::Undefined); + outStates->add(ResourceState::UnorderedAccess); + outStates->add(ResourceState::VertexBuffer); + return SLANG_OK; +} + SLANG_NO_THROW Result SLANG_MCALL RendererBase::getSlangSession(slang::ISession** outSlangSession) { *outSlangSession = slangContext.session.get(); @@ -352,6 +377,31 @@ Result RendererBase::createRayTracingPipelineState(const RayTracingPipelineState return SLANG_E_NOT_AVAILABLE; } +Result RendererBase::createMutableRootShaderObject( + IShaderProgram* program, IShaderObject** outObject) +{ + SLANG_UNUSED(program); + SLANG_UNUSED(outObject); + return SLANG_E_NOT_AVAILABLE; +} + +Result RendererBase::createFence(const IFence::Desc& desc, IFence** outFence) +{ + SLANG_UNUSED(desc); + *outFence = nullptr; + return SLANG_E_NOT_AVAILABLE; +} + +Result RendererBase::waitForFences( + IFence** fences, uint32_t fenceCount, bool waitForAll, uint64_t timeout) +{ + SLANG_UNUSED(fences); + SLANG_UNUSED(fenceCount); + SLANG_UNUSED(waitForAll); + SLANG_UNUSED(timeout); + return SLANG_E_NOT_AVAILABLE; +} + Result RendererBase::getShaderObjectLayout( slang::TypeReflection* type, ShaderObjectContainerType container, -- cgit v1.2.3