OSDN Git Service

Support for device groups
authorAlexis Hetu <sugoi@google.com>
Tue, 22 Jan 2019 22:17:27 +0000 (17:17 -0500)
committerAlexis Hétu <sugoi@google.com>
Thu, 31 Jan 2019 12:36:01 +0000 (12:36 +0000)
This cl properly parses VkDeviceGroupDeviceCreateInfo,
but only allows the already supported default case.

Fixes all tests in:
dEQP-VK.api.object_management.*.device_group

Bug b/117974925

Change-Id: I42851f10bb9fc94848414bbd09b65ab8b807ae0e
Reviewed-on: https://swiftshader-review.googlesource.com/c/23968
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
src/Vulkan/libVulkan.cpp

index 926a5c3..6285653 100644 (file)
@@ -288,6 +288,17 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c
                                }
                        }
                        break;
+               case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO:
+                       {
+                               const VkDeviceGroupDeviceCreateInfo* groupDeviceCreateInfo = reinterpret_cast<const VkDeviceGroupDeviceCreateInfo*>(extensionCreateInfo);
+
+                               if((groupDeviceCreateInfo->physicalDeviceCount != 1) ||
+                                  (groupDeviceCreateInfo->pPhysicalDevices[0] != physicalDevice))
+                               {
+                                       return VK_ERROR_FEATURE_NOT_PRESENT;
+                               }
+                       }
+                       break;
                default:
                        // "the [driver] must skip over, without processing (other than reading the sType and pNext members) any structures in the chain with sType values not defined by [supported extenions]"
                        UNIMPLEMENTED();   // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here.