From de83628070614ec37349c9f334ed72a54a6889da Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 30 Aug 2024 12:03:23 -0700 Subject: Support specialization constants. (#4963) * Support specialization constants. * Fix. * Fix. * Fix. * Fix. * Make sure specialization constants have names. * Clean up and support the dxc [vk::constant_id] syntax. * Fix. * Fix. * Fix. --- source/slang/slang-emit-c-like.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/slang/slang-emit-c-like.cpp') diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp index fadf76dd2..ad365581a 100644 --- a/source/slang/slang-emit-c-like.cpp +++ b/source/slang/slang-emit-c-like.cpp @@ -4178,6 +4178,9 @@ void CLikeSourceEmitter::emitGlobalParam(IRGlobalParam* varDecl) emitLayoutSemantics(varDecl, "register"); + // If the parameter has a default value, we may need to emit it. + emitGlobalParamDefaultVal(varDecl); + // A shader parameter cannot have an initializer, // so we do need to consider emitting one here. -- cgit v1.2.3