diff options
author | Sarah <9856269+sarahM0@users.noreply.github.com> | 2019-02-20 11:50:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-20 11:50:57 -0500 |
commit | 76730a46a1d81bdf46f25f33684e04b429ff1718 (patch) | |
tree | 1748740d1621f6799566467835c17956224b237a /source/val/validate_decorations.cpp | |
parent | 5994ae2a045015004cce24802dc47c33736486ea (diff) | |
download | SPIRV-Tools-76730a46a1d81bdf46f25f33684e04b429ff1718.tar.gz |
In Vulkan, disallow BufferBlock on StorageBuffer variables (#2380)
To fix #2168.
Diffstat (limited to 'source/val/validate_decorations.cpp')
-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)) |