diff options
| author | Mike Schuchardt <mikes@lunarg.com> | 2017-10-26 14:05:52 -0600 |
|---|---|---|
| committer | Mike Schuchardt <mikes@lunarg.com> | 2017-10-30 13:59:11 -0600 |
| commit | d8955f1862d3622ffb9125845612750374a3564e (patch) | |
| tree | 82aac703ea6036f79eedfe2e22c6a1210bef1168 /layers/core_validation.cpp | |
| parent | ba367602f9c058f32a98b84f016cb9209bbd6e86 (diff) | |
| download | usermoji-d8955f1862d3622ffb9125845612750374a3564e.tar.xz | |
layers: Remove warning for imported memory
Flag imported memory as valid to suppress warnings about uninitialized
buffers and images that use external memory
Change-Id: Id286dfde41a02652767202a31758f44202d9875a
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 3702870d..124e0f2e 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -358,6 +358,18 @@ static void add_mem_obj_info(layer_data *dev_data, void *object, const VkDeviceM assert(object != NULL); dev_data->memObjMap[mem] = unique_ptr<DEVICE_MEM_INFO>(new DEVICE_MEM_INFO(object, mem, pAllocateInfo)); + + if (pAllocateInfo->pNext) { + auto struct_header = reinterpret_cast<const GENERIC_HEADER *>(pAllocateInfo->pNext); + while (struct_header) { + if (VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR == struct_header->sType || + VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR == struct_header->sType) { + dev_data->memObjMap[mem]->global_valid = true; + break; + } + struct_header = reinterpret_cast<const GENERIC_HEADER *>(struct_header->pNext); + } + } } // For given bound_object_handle, bound to given mem allocation, verify that the range for the bound object is valid |
