summaryrefslogtreecommitdiffstats
path: root/source/slang
diff options
context:
space:
mode:
authorcheneym2 <acheney@nvidia.com>2025-02-04 16:58:54 -0500
committerGitHub <noreply@github.com>2025-02-04 13:58:54 -0800
commit78a6389aa4b01cfe4f8b4ec34d48b2cbfc092865 (patch)
tree32653827212dc696683391ee1fe6c4b88b2666c8 /source/slang
parent77c59d4a159cc9f1d992ef096ba7fa0d9e7e548a (diff)
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>
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/slang-parameter-binding.cpp7
1 files changed, 7 insertions, 0 deletions
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<VarDeclBase> const& varDecl)
{
+ // Don't warn if the declaration is a vk::push_constant or shaderRecordEXT
+ if (varDecl.getDecl()->hasModifier<PushConstantAttribute>() ||
+ varDecl.getDecl()->hasModifier<ShaderRecordAttribute>())
+ {
+ 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.