From c6f6ce12ec522b193b42bcd12d3a2540c7a6ff92 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 28 Jul 2021 12:24:12 -0700 Subject: Experimental DXR1.0 support in gfx. (#1915) * Experimental DXR1.0 support in gfx. - Add `dispatchRays` command. - Add `createRayTracingPipelineState` method to construct a D3D ray tracing state object from a linked slang program and user specified shader table. Limitations/simplifications: no local root signature support, shader table entries contains only shader identifiers and is specified at pipeline creation time, owned by the pipeline state object. * Root object binding for raytracing pipelines. * `maybeSpecializePipeline` implementation for raytracing pipelines. * Add ray-tracing-pipeline example. * Fixes. * Update README.md * Update comments on the lifespan of specialized pipelines Co-authored-by: Yong He Co-authored-by: jsmall-nvidia --- tools/gfx/debug-layer.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tools/gfx/debug-layer.cpp') diff --git a/tools/gfx/debug-layer.cpp b/tools/gfx/debug-layer.cpp index 067581559..50cacc6c2 100644 --- a/tools/gfx/debug-layer.cpp +++ b/tools/gfx/debug-layer.cpp @@ -705,6 +705,7 @@ DebugCommandBuffer::DebugCommandBuffer() m_renderCommandEncoder.commandBuffer = this; m_computeCommandEncoder.commandBuffer = this; m_resourceCommandEncoder.commandBuffer = this; + m_rayTracingCommandEncoder.commandBuffer = this; } void DebugCommandBuffer::encodeRenderCommands( @@ -1084,6 +1085,25 @@ void DebugRayTracingCommandEncoder::memoryBarrier( baseObject->memoryBarrier(count, innerAS.getBuffer(), sourceAccess, destAccess); } +void DebugRayTracingCommandEncoder::bindPipeline( + IPipelineState* state, IShaderObject** outRootObject) +{ + SLANG_GFX_API_FUNC; + auto innerPipeline = getInnerObj(state); + baseObject->bindPipeline(innerPipeline, commandBuffer->rootObject.baseObject.writeRef()); + *outRootObject = &commandBuffer->rootObject; +} + +void DebugRayTracingCommandEncoder::dispatchRays( + const char* rayGenShaderName, + int32_t width, + int32_t height, + int32_t depth) +{ + SLANG_GFX_API_FUNC; + baseObject->dispatchRays(rayGenShaderName, width, height, depth); +} + const ICommandQueue::Desc& DebugCommandQueue::getDesc() { SLANG_GFX_API_FUNC; -- cgit v1.2.3