From 1efa35eaa2edadd6e6ceeb915625e3d9a2cf2012 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 2 Mar 2016 09:45:13 +1300 Subject: layers: Separate some variables Don't abuse maxInputAttachmentCount in the second loop which has nothing to do with input attachments. Signed-off-by: Chris Forbes --- layers/draw_state.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index eefffe33..5c874f58 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -7342,8 +7342,8 @@ bool validateSubpassCompatibility(layer_data* dev_data, VkCommandBuffer primaryB } skip_call |= validateAttachmentCompatibility(dev_data, primaryBuffer, primaryPass, primary_input_attach, secondaryBuffer, secondaryPass, secondary_input_attach, is_multi); } - maxInputAttachmentCount = std::max(primary_desc.colorAttachmentCount, secondary_desc.colorAttachmentCount); - for (uint32_t i = 0; i < maxInputAttachmentCount; ++i) { + uint32_t maxColorAttachmentCount = std::max(primary_desc.colorAttachmentCount, secondary_desc.colorAttachmentCount); + for (uint32_t i = 0; i < maxColorAttachmentCount; ++i) { uint32_t primary_color_attach = VK_ATTACHMENT_UNUSED, secondary_color_attach = VK_ATTACHMENT_UNUSED; if (i < primary_desc.colorAttachmentCount) { primary_color_attach = primary_desc.pColorAttachments[i].attachment; -- cgit v1.2.3 From e198c1c89d35a8fe6fbd1a08368227ea22dbd74b Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 2 Mar 2016 17:21:08 +1300 Subject: layers: DS: populate features correctly - Remove the redundant first fetching of the device features. This was always clobbered. - Treat pEnabledFeatures==NULL as disabling all features, as per 30.1 of the spec. Signed-off-by: Chris Forbes --- layers/draw_state.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 5c874f58..29fd3779 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -3609,7 +3609,6 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice g createDeviceRegisterExtensions(pCreateInfo, *pDevice); // Get physical device limits for this device my_instance_data->instance_dispatch_table->GetPhysicalDeviceProperties(gpu, &(my_device_data->physDevProperties.properties)); - my_instance_data->instance_dispatch_table->GetPhysicalDeviceFeatures(gpu, &(my_device_data->physDevProperties.features)); uint32_t count; my_instance_data->instance_dispatch_table->GetPhysicalDeviceQueueFamilyProperties(gpu, &count, nullptr); my_device_data->physDevProperties.queue_family_properties.resize(count); @@ -3619,8 +3618,7 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice g my_device_data->physDevProperties.features = *pCreateInfo->pEnabledFeatures; } else { - my_instance_data->instance_dispatch_table->GetPhysicalDeviceFeatures( - gpu, &my_device_data->physDevProperties.features); + memset(&my_device_data->physDevProperties.features, 0, sizeof(VkPhysicalDeviceFeatures)); } loader_platform_thread_unlock_mutex(&globalLock); return result; -- cgit v1.2.3