diff options
Diffstat (limited to 'source/val')
-rw-r--r-- | source/val/validate_decorations.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/val/validate_decorations.cpp b/source/val/validate_decorations.cpp index cccf6912..f75c3af1 100644 --- a/source/val/validate_decorations.cpp +++ b/source/val/validate_decorations.cpp @@ -909,6 +909,13 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) { : (push_constant ? "PushConstant" : "StorageBuffer"); if (spvIsVulkanEnv(vstate.context()->target_env)) { + if (storage_buffer && + hasDecoration(id, SpvDecorationBufferBlock, vstate)) { + return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id)) + << "Storage buffer id '" << var_id + << " In Vulkan, BufferBlock is disallowed on variables in " + "the StorageBuffer storage class"; + } // Vulkan 14.5.1: Check Block decoration for PushConstant variables. if (push_constant && !hasDecoration(id, SpvDecorationBlock, vstate)) { return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id)) |