diff options
| author | Yong He <yonghe@outlook.com> | 2022-02-19 00:15:17 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-19 00:15:17 -0800 |
| commit | e272aec6a9ddb8b0af82f72c061f5393f2b2bdab (patch) | |
| tree | 11ec24a9464f5922e896bfff6e125c2d6279d4b3 /tools/gfx/vulkan/render-vk.cpp | |
| parent | e993ff5f8d21d77dd3fb579f7afc51c6dcad834c (diff) | |
Optimize d3d12 mutable shader object implementation. (#2138)
* Optimize d3d12 mutable shader object implementation.
* Disable mismatched clear value warning message from d3d sdk.
* Fix.
* Fix.
* gfx: Avoid redundant d3d12 QueryInterface call.
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/vulkan/render-vk.cpp')
| -rw-r--r-- | tools/gfx/vulkan/render-vk.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/gfx/vulkan/render-vk.cpp b/tools/gfx/vulkan/render-vk.cpp index 0a66c653b..ebf25513b 100644 --- a/tools/gfx/vulkan/render-vk.cpp +++ b/tools/gfx/vulkan/render-vk.cpp @@ -2530,6 +2530,14 @@ public: return SLANG_OK; } + Result setPipelineStateWithRootObjectImpl(IPipelineState* state, IShaderObject* inObject) + { + IShaderObject* rootObject = nullptr; + SLANG_RETURN_ON_FAIL(setPipelineStateImpl(state, &rootObject)); + static_cast<ShaderObjectBase*>(rootObject)->copyFrom(inObject, m_commandBuffer->m_transientHeap); + return SLANG_OK; + } + void flushBindingState(VkPipelineBindPoint pipelineBindPoint) { auto& api = *m_api; @@ -5098,6 +5106,12 @@ public: return setPipelineStateImpl(pipelineState, outRootObject); } + virtual SLANG_NO_THROW Result SLANG_MCALL + bindPipelineWithRootObject(IPipelineState* pipelineState, IShaderObject* rootObject) override + { + return setPipelineStateWithRootObjectImpl(pipelineState, rootObject); + } + virtual SLANG_NO_THROW void SLANG_MCALL setViewports(uint32_t count, const Viewport* viewports) override { @@ -5380,6 +5394,12 @@ public: return setPipelineStateImpl(pipelineState, outRootObject); } + virtual SLANG_NO_THROW Result SLANG_MCALL bindPipelineWithRootObject( + IPipelineState* pipelineState, IShaderObject* rootObject) override + { + return setPipelineStateWithRootObjectImpl(pipelineState, rootObject); + } + virtual SLANG_NO_THROW void SLANG_MCALL dispatchCompute(int x, int y, int z) override { auto pipeline = static_cast<PipelineStateImpl*>(m_currentPipeline.Ptr()); @@ -5653,6 +5673,13 @@ public: setPipelineStateImpl(pipeline, outRootObject); } + virtual SLANG_NO_THROW Result SLANG_MCALL bindPipelineWithRootObject( + IPipelineState* pipelineState, IShaderObject* rootObject) override + { + return setPipelineStateWithRootObjectImpl(pipelineState, rootObject); + } + + // TODO: Implement after implementing createRayTracingPipelineState virtual SLANG_NO_THROW void SLANG_MCALL dispatchRays( uint32_t raygenShaderIndex, IShaderTable* shaderTable, |
