aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony-LunarG <tony@lunarg.com>2019-08-21 10:11:35 -0600
committerTony Barbour <tony@lunarg.com>2019-08-23 09:59:56 -0600
commit7564b38794406ae37838bc3e5b8abcf291b09e6c (patch)
treec300262570a71ceeed246214dc4b961254ec797b
parenta26d3c8a461eb1aa767bb1be10fc7964cee20cdd (diff)
downloadvulkan-validation-layers-7564b38794406ae37838bc3e5b8abcf291b09e6c.tar.gz
gpu: Don't validate inline uniform blocks
Change-Id: I09ff4d07c6de3f7820d58c8edc8cbe13987113ea
-rw-r--r--docs/gpu_validation.md2
-rw-r--r--layers/gpu_validation.cpp23
2 files changed, 23 insertions, 2 deletions
diff --git a/docs/gpu_validation.md b/docs/gpu_validation.md
index 8aabb2f0b..99520d9cf 100644
--- a/docs/gpu_validation.md
+++ b/docs/gpu_validation.md
@@ -87,6 +87,8 @@ array elements, those elements are not required to have been written.
The instrumentation code needs to know which elements of a descriptor array have been written, so that it can tell if one is used
that has not been written.
+Note that currently, VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT validation is not working and all accesses are reported as valid.
+
## GPU-Assisted Validation Options
diff --git a/layers/gpu_validation.cpp b/layers/gpu_validation.cpp
index 1d5815948..38737a956 100644
--- a/layers/gpu_validation.cpp
+++ b/layers/gpu_validation.cpp
@@ -1354,7 +1354,15 @@ void CoreChecks::GpuAllocateValidationResources(const VkCommandBuffer cmd_buffer
if (bindings.size() > 0) {
binding_count += desc->GetLayout()->GetMaxBinding() + 1;
for (auto binding : bindings) {
- if (binding == desc->GetLayout()->GetMaxBinding() && desc->IsVariableDescriptorCount(binding)) {
+ // Shader instrumentation is tracking inline uniform blocks as scalers. Don't try to validate inline uniform
+ // blocks
+ if (VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT == desc->GetLayout()->GetTypeFromBinding(binding)) {
+ descriptor_count++;
+ log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
+ VK_NULL_HANDLE, "UNASSIGNED-GPU-Assisted Validation Warning",
+ "VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT descriptors will not be validated by GPU assisted "
+ "validation");
+ } else if (binding == desc->GetLayout()->GetMaxBinding() && desc->IsVariableDescriptorCount(binding)) {
descriptor_count += desc->GetVariableDescriptorCount();
} else {
descriptor_count += desc->GetDescriptorCountFromBinding(binding);
@@ -1410,7 +1418,11 @@ void CoreChecks::GpuAllocateValidationResources(const VkCommandBuffer cmd_buffer
*sets_to_bindings++ = bindCounter + number_of_sets + binding_count;
for (auto binding : bindings) {
// For each binding, fill in its size in the sizes array
- if (binding == layout->GetMaxBinding() && desc->IsVariableDescriptorCount(binding)) {
+ // Shader instrumentation is tracking inline uniform blocks as scalers. Don't try to validate inline uniform
+ // blocks
+ if (VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT == desc->GetLayout()->GetTypeFromBinding(binding)) {
+ sizes[binding] = 1;
+ } else if (binding == layout->GetMaxBinding() && desc->IsVariableDescriptorCount(binding)) {
sizes[binding] = desc->GetVariableDescriptorCount();
} else {
sizes[binding] = desc->GetDescriptorCountFromBinding(binding);
@@ -1418,6 +1430,13 @@ void CoreChecks::GpuAllocateValidationResources(const VkCommandBuffer cmd_buffer
// Fill in the starting index for this binding in the written array in the bindings_to_written array
bindings_to_written[binding] = written_index;
+ // Shader instrumentation is tracking inline uniform blocks as scalers. Don't try to validate inline uniform
+ // blocks
+ if (VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT == desc->GetLayout()->GetTypeFromBinding(binding)) {
+ pData[written_index++] = 1;
+ continue;
+ }
+
auto index_range = desc->GetGlobalIndexRangeFromBinding(binding, true);
// For each array element in the binding, update the written array with whether it has been written
for (uint32_t i = index_range.start; i < index_range.end; ++i) {