From 78a6389aa4b01cfe4f8b4ec34d48b2cbfc092865 Mon Sep 17 00:00:00 2001 From: cheneym2 Date: Tue, 4 Feb 2025 16:58:54 -0500 Subject: Fix warning about push constants, shaderRecordEXT (#6269) * Fix warning about push constants, shaderRecordEXT These resources should not warn about missing vk::binding. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- source/slang/slang-parameter-binding.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source') diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp index 61226f898..67ce46e8f 100644 --- a/source/slang/slang-parameter-binding.cpp +++ b/source/slang/slang-parameter-binding.cpp @@ -1073,6 +1073,13 @@ static void _maybeDiagnoseMissingVulkanLayoutModifier( ParameterBindingContext* context, DeclRef const& varDecl) { + // Don't warn if the declaration is a vk::push_constant or shaderRecordEXT + if (varDecl.getDecl()->hasModifier() || + varDecl.getDecl()->hasModifier()) + { + return; + } + // If the user didn't specify a `binding` (and optional `set`) for Vulkan, // but they *did* specify a `register` for D3D, then that is probably an // oversight on their part. -- cgit v1.2.3