summaryrefslogtreecommitdiff
path: root/tools/gfx/debug-layer.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-10-18 12:19:45 -0700
committerGitHub <noreply@github.com>2021-10-18 12:19:45 -0700
commit2f44d9e01234911dd563f0456b9d861fd8db286d (patch)
treee2727f31654ebc93bae6a1de4b25586be6fb9d10 /tools/gfx/debug-layer.h
parent87e7c49fbfccd54be0d1cee61fba8f309b1f792e (diff)
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 <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/debug-layer.h')
-rw-r--r--tools/gfx/debug-layer.h45
1 files changed, 27 insertions, 18 deletions
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<IShaderObject>
{
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;