From 89f67d9c626fa193dba4adafcb54e46b13aa5e98 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 25 May 2021 15:22:39 -0700 Subject: Rework shader object specialization control interface. (#1857) --- tools/gfx/debug-layer.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'tools/gfx/debug-layer.cpp') 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 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 -- cgit v1.2.3