From 08621f4f38fefacf3d05021be3951c121e405e1a Mon Sep 17 00:00:00 2001 From: Piers Daniell Date: Wed, 21 Jan 2026 15:52:04 -0700 Subject: [PATCH 1/2] Add support for SPV_NV_push_constant_bank --- source/val/validate_capability.cpp | 1 + source/val/validate_decorations.cpp | 2 +- source/val/validate_interfaces.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/val/validate_capability.cpp b/source/val/validate_capability.cpp index ac8f824e0e..961590c19b 100644 --- a/source/val/validate_capability.cpp +++ b/source/val/validate_capability.cpp @@ -147,6 +147,7 @@ bool IsSupportOptionalVulkan_1_0(uint32_t capability) { case spv::Capability::Int8: case spv::Capability::BFloat16TypeKHR: case spv::Capability::Float8EXT: + case spv::Capability::PushConstantBanksNV: return true; default: break; diff --git a/source/val/validate_decorations.cpp b/source/val/validate_decorations.cpp index 679ed00fd4..af4d606796 100644 --- a/source/val/validate_decorations.cpp +++ b/source/val/validate_decorations.cpp @@ -1282,7 +1282,7 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { if (spvIsVulkanEnv(vstate.context()->target_env)) { // Vulkan: There must be no more than one PushConstant block per entry // point. - if (push_constant) { + if (push_constant && !(vstate.HasCapability(spv::Capability::PushConstantBanksNV))) { auto entry_points = vstate.EntryPointReferences(var_id); for (auto ep_id : entry_points) { const bool already_used = !uses_push_constant.insert(ep_id).second; diff --git a/source/val/validate_interfaces.cpp b/source/val/validate_interfaces.cpp index cc6268667f..d3d2360497 100644 --- a/source/val/validate_interfaces.cpp +++ b/source/val/validate_interfaces.cpp @@ -617,7 +617,7 @@ spv_result_t ValidateStorageClass(ValidationState_t& _, auto storage_class = interface_var->GetOperandAs(2); switch (storage_class) { case spv::StorageClass::PushConstant: { - if (has_push_constant) { + if (has_push_constant && !(_.HasCapability(spv::Capability::PushConstantBanksNV))) { return _.diag(SPV_ERROR_INVALID_DATA, entry_point) << _.VkErrorID(6673) << "Entry-point has more than one variable with the " From 6cac504a3634ffe66b3ce97b5e296c14337482a6 Mon Sep 17 00:00:00 2001 From: Piers Daniell Date: Wed, 21 Jan 2026 16:25:17 -0700 Subject: [PATCH 2/2] Formatting fixes --- source/val/validate_decorations.cpp | 3 ++- source/val/validate_interfaces.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/val/validate_decorations.cpp b/source/val/validate_decorations.cpp index af4d606796..79b4085c33 100644 --- a/source/val/validate_decorations.cpp +++ b/source/val/validate_decorations.cpp @@ -1282,7 +1282,8 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { if (spvIsVulkanEnv(vstate.context()->target_env)) { // Vulkan: There must be no more than one PushConstant block per entry // point. - if (push_constant && !(vstate.HasCapability(spv::Capability::PushConstantBanksNV))) { + if (push_constant && + !(vstate.HasCapability(spv::Capability::PushConstantBanksNV))) { auto entry_points = vstate.EntryPointReferences(var_id); for (auto ep_id : entry_points) { const bool already_used = !uses_push_constant.insert(ep_id).second; diff --git a/source/val/validate_interfaces.cpp b/source/val/validate_interfaces.cpp index d3d2360497..3035f94bb0 100644 --- a/source/val/validate_interfaces.cpp +++ b/source/val/validate_interfaces.cpp @@ -617,7 +617,8 @@ spv_result_t ValidateStorageClass(ValidationState_t& _, auto storage_class = interface_var->GetOperandAs(2); switch (storage_class) { case spv::StorageClass::PushConstant: { - if (has_push_constant && !(_.HasCapability(spv::Capability::PushConstantBanksNV))) { + if (has_push_constant && + !(_.HasCapability(spv::Capability::PushConstantBanksNV))) { return _.diag(SPV_ERROR_INVALID_DATA, entry_point) << _.VkErrorID(6673) << "Entry-point has more than one variable with the "