From 2f44d9e01234911dd563f0456b9d861fd8db286d Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 18 Oct 2021 12:19:45 -0700 Subject: GFX: implement mutable shader objects. (#1963) * GFX: implement mutable shader objects. * Revert unnecessary changes * Revert more changes. * Fix clang errors. * Fix clang/gcc errors. * Fix clang errors. * Remove CPU test. * Fix after merge. * Fix after merge. * Remove gl test * Code review fixes. * Fixing all vk validation errors. * Flush test output more often. * Fix a crash in `specializeDynamicAssociatedTypeLookup`. * temporarily disable std-lib-serialize test to see what happens * Fix crashes. * Make sure cpu gfx unit tests are properly disabled on TeamCity. * Disable cpu test. * Fix. * Fix cuda. * Disable nv-ray-tracing-motion-blur Co-authored-by: Yong He --- tools/gfx/debug-layer.h | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'tools/gfx/debug-layer.h') diff --git a/tools/gfx/debug-layer.h b/tools/gfx/debug-layer.h index d25fbd453..aa56e5530 100644 --- a/tools/gfx/debug-layer.h +++ b/tools/gfx/debug-layer.h @@ -95,6 +95,10 @@ public: slang::TypeReflection* type, ShaderObjectContainerType container, IShaderObject** outObject) override; + virtual SLANG_NO_THROW Result SLANG_MCALL createMutableShaderObject( + slang::TypeReflection* type, + ShaderObjectContainerType container, + IShaderObject** outObject) override; virtual SLANG_NO_THROW Result SLANG_MCALL createProgram(const IShaderProgram::Desc& desc, IShaderProgram** outProgram) override; virtual SLANG_NO_THROW Result SLANG_MCALL createGraphicsPipelineState( @@ -189,6 +193,25 @@ public: ISamplerState* getInterface(const Slang::Guid& guid); }; +struct ShaderOffsetKey +{ + ShaderOffset offset; + bool operator==(ShaderOffsetKey other) + { + return offset.bindingArrayIndex == other.offset.bindingArrayIndex && + offset.bindingRangeIndex == other.offset.bindingRangeIndex && + offset.uniformOffset == other.offset.uniformOffset; + } + Slang::HashCode getHashCode() + { + return Slang::combineHash( + (Slang::HashCode)offset.uniformOffset, + Slang::combineHash( + (Slang::HashCode)offset.bindingArrayIndex, + (Slang::HashCode)offset.bindingRangeIndex)); + } +}; + class DebugShaderObject : public DebugObject { public: @@ -220,25 +243,10 @@ public: const slang::SpecializationArg* args, uint32_t count) override; + virtual SLANG_NO_THROW Result SLANG_MCALL getCurrentVersion( + ITransientResourceHeap* transientHeap, IShaderObject** outObject) override; + public: - struct ShaderOffsetKey - { - ShaderOffset offset; - bool operator==(ShaderOffsetKey other) - { - return offset.bindingArrayIndex == other.offset.bindingArrayIndex && - offset.bindingRangeIndex == other.offset.bindingRangeIndex && - offset.uniformOffset == other.offset.uniformOffset; - } - Slang::HashCode getHashCode() - { - return Slang::combineHash( - (Slang::HashCode)offset.uniformOffset, - Slang::combineHash( - (Slang::HashCode)offset.bindingArrayIndex, - (Slang::HashCode)offset.bindingRangeIndex)); - } - }; Slang::String m_typeName; slang::TypeReflection* m_slangType = nullptr; DebugDevice* m_device; @@ -257,6 +265,7 @@ public: ShaderOffset const& offset, const slang::SpecializationArg* args, uint32_t count) override; + void reset(); }; class DebugCommandBuffer; -- cgit v1.2.3