diff options
| author | Michael Lentine <mlentine@google.com> | 2016-03-18 14:49:09 -0500 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-03-21 06:54:37 -0600 |
| commit | c1eb378cdd11d1a60a8fc2ded4a3b2acb5d9f3f9 (patch) | |
| tree | 29ebd970d6ec609b8aa3dfb105383bac34273268 /layers/core_validation.cpp | |
| parent | 65ce335d67c43a008ab1ccbd77ccf8db66fa56e3 (diff) | |
| download | usermoji-c1eb378cdd11d1a60a8fc2ded4a3b2acb5d9f3f9.tar.xz | |
Allow REMAINING for subresources.
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index dba39277..1454d710 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -8730,7 +8730,10 @@ VkBool32 ValidateBarriers(const char *funcName, VkCommandBuffer cmdBuffer, uint3 "VK_IMAGE_ASPECT_STENCIL_BIT set.", funcName); } - if ((mem_barrier->subresourceRange.baseArrayLayer + mem_barrier->subresourceRange.layerCount) > arrayLayers) { + int layerCount = (mem_barrier->subresourceRange.layerCount == VK_REMAINING_ARRAY_LAYERS) + ? 1 + : mem_barrier->subresourceRange.layerCount; + if ((mem_barrier->subresourceRange.baseArrayLayer + layerCount) > arrayLayers) { log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, DRAWSTATE_INVALID_BARRIER, "DS", "%s: Subresource must have the sum of the " "baseArrayLayer (%d) and layerCount (%d) be less " @@ -8738,7 +8741,10 @@ VkBool32 ValidateBarriers(const char *funcName, VkCommandBuffer cmdBuffer, uint3 funcName, mem_barrier->subresourceRange.baseArrayLayer, mem_barrier->subresourceRange.layerCount, arrayLayers); } - if ((mem_barrier->subresourceRange.baseMipLevel + mem_barrier->subresourceRange.levelCount) > mipLevels) { + int levelCount = (mem_barrier->subresourceRange.levelCount == VK_REMAINING_MIP_LEVELS) + ? 1 + : mem_barrier->subresourceRange.levelCount; + if ((mem_barrier->subresourceRange.baseMipLevel + levelCount) > mipLevels) { log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, DRAWSTATE_INVALID_BARRIER, "DS", "%s: Subresource must have the sum of the baseMipLevel " "(%d) and levelCount (%d) be less than or equal to " |
