summaryrefslogtreecommitdiffstats
path: root/tools/gfx/debug-layer.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-05-25 15:22:39 -0700
committerGitHub <noreply@github.com>2021-05-25 15:22:39 -0700
commit89f67d9c626fa193dba4adafcb54e46b13aa5e98 (patch)
tree769e11debb4194595a99e484d69af7b3704389c3 /tools/gfx/debug-layer.cpp
parentba24264275c640e0ac3732f0f5720e1f5816cded (diff)
Rework shader object specialization control interface. (#1857)
Diffstat (limited to 'tools/gfx/debug-layer.cpp')
-rw-r--r--tools/gfx/debug-layer.cpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/tools/gfx/debug-layer.cpp b/tools/gfx/debug-layer.cpp
index 3fa2eee9d..26e55ca7e 100644
--- a/tools/gfx/debug-layer.cpp
+++ b/tools/gfx/debug-layer.cpp
@@ -955,23 +955,12 @@ Result DebugShaderObject::setCombinedTextureSampler(
}
Result DebugShaderObject::setSpecializationArgs(
+ ShaderOffset const& offset,
const slang::SpecializationArg* args,
uint32_t count)
{
- ComPtr<slang::ISession> session;
- m_device->getSlangSession(session.writeRef());
- auto expectedCount = (uint32_t)session->getTypeLayout(m_slangType)
- ->getSize(SLANG_PARAMETER_CATEGORY_EXISTENTIAL_TYPE_PARAM);
- if (expectedCount != count)
- {
- GFX_DIAGNOSE_ERROR_FORMAT(
- "specialization argument count for shader object type %s mismatch: expecting %d but %d "
- "provided.",
- m_typeName.getBuffer(),
- expectedCount,
- count);
- };
- return baseObject->setSpecializationArgs(args, count);
+
+ return baseObject->setSpecializationArgs(offset, args, count);
}
DebugObjectBase::DebugObjectBase()
@@ -981,11 +970,11 @@ DebugObjectBase::DebugObjectBase()
}
Result DebugRootShaderObject::setSpecializationArgs(
+ ShaderOffset const& offset,
const slang::SpecializationArg* args,
uint32_t count)
{
- GFX_DIAGNOSE_ERROR("`setSpecializationArgs` should not be called directly on root objects.");
- return baseObject->setSpecializationArgs(args, count);
+ return baseObject->setSpecializationArgs(offset, args, count);
}
} // namespace gfx