Update VK_KHR_performance_query enumerate
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 15 Oct 2019 15:22:38 +0000 (18:22 +0300)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 14 Nov 2019 16:26:19 +0000 (11:26 -0500)
Components: Vulkan
Affects: dEQP-VK.query_pool.performance_query.enumerate*

Change-Id: I443c1c9b7a1903063b27b77fc47cbb88259aa407
(cherry picked from commit bc519fecec3d1b27e0e5ee1a4947257260202eff)

external/vulkancts/framework/vulkan/vkConcreteInstanceInterface.inl
external/vulkancts/framework/vulkan/vkFunctionPointerTypes.inl
external/vulkancts/framework/vulkan/vkInstanceDriverImpl.inl
external/vulkancts/framework/vulkan/vkNullDriverImpl.inl
external/vulkancts/framework/vulkan/vkVirtualInstanceInterface.inl
external/vulkancts/framework/vulkan/vkVulkan_c.inl
external/vulkancts/modules/vulkan/query_pool/vktQueryPoolPerformanceTests.cpp
external/vulkancts/scripts/src/vulkan_core.h

index 103b894..2d40ced 100644 (file)
@@ -37,7 +37,7 @@ virtual VkResult      getDisplayModePropertiesKHR                                                                             (VkPhysicalDevice physical
 virtual VkResult       createDisplayModeKHR                                                                                    (VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode) const;
 virtual VkResult       getDisplayPlaneCapabilitiesKHR                                                                  (VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, deUint32 planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities) const;
 virtual VkResult       createDisplayPlaneSurfaceKHR                                                                    (VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const;
-virtual void           enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR   (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions) const;
+virtual VkResult       enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR   (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions) const;
 virtual void           getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR                   (VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, deUint32* pNumPasses) const;
 virtual VkResult       getPhysicalDeviceSurfaceCapabilities2KHR                                                (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities) const;
 virtual VkResult       getPhysicalDeviceSurfaceFormats2KHR                                                             (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, deUint32* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats) const;
index 10597bc..3dab768 100644 (file)
@@ -219,7 +219,7 @@ typedef VKAPI_ATTR VkResult                         (VKAPI_CALL* GetSwapchainStatusKHRFunc)
 typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDeviceExternalFencePropertiesKHRFunc)                                           (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties);
 typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* ImportFenceFdKHRFunc)                                                                                                      (VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo);
 typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetFenceFdKHRFunc)                                                                                                         (VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHRFunc)         (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHRFunc)         (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions);
 typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHRFunc)                         (VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, deUint32* pNumPasses);
 typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* AcquireProfilingLockKHRFunc)                                                                                       (VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo);
 typedef VKAPI_ATTR void                                        (VKAPI_CALL* ReleaseProfilingLockKHRFunc)                                                                                       (VkDevice device);
index bce6932..05b8657 100644 (file)
@@ -232,9 +232,9 @@ VkResult InstanceDriver::createDisplayPlaneSurfaceKHR (VkInstance instance, cons
        return m_vk.createDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
 }
 
-void InstanceDriver::enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions) const
+VkResult InstanceDriver::enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions) const
 {
-       m_vk.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueFamilyIndex, pCounterCount, pCounters, pCounterDescriptions);
+       return m_vk.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueFamilyIndex, pCounterCount, pCounters, pCounterDescriptions);
 }
 
 void InstanceDriver::getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR (VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, deUint32* pNumPasses) const
index c1de301..a0dff63 100644 (file)
@@ -1461,13 +1461,14 @@ VKAPI_ATTR VkResult VKAPI_CALL getFenceFdKHR (VkDevice device, const VkFenceGetF
        return VK_SUCCESS;
 }
 
-VKAPI_ATTR void VKAPI_CALL enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions)
+VKAPI_ATTR VkResult VKAPI_CALL enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions)
 {
        DE_UNREF(physicalDevice);
        DE_UNREF(queueFamilyIndex);
        DE_UNREF(pCounterCount);
        DE_UNREF(pCounters);
        DE_UNREF(pCounterDescriptions);
+       return VK_SUCCESS;
 }
 
 VKAPI_ATTR void VKAPI_CALL getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR (VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, deUint32* pNumPasses)
index 772de00..078a169 100644 (file)
@@ -37,7 +37,7 @@ virtual VkResult      getDisplayModePropertiesKHR                                                                             (VkPhysicalDevice physical
 virtual VkResult       createDisplayModeKHR                                                                                    (VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode) const = 0;
 virtual VkResult       getDisplayPlaneCapabilitiesKHR                                                                  (VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, deUint32 planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities) const = 0;
 virtual VkResult       createDisplayPlaneSurfaceKHR                                                                    (VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const = 0;
-virtual void           enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR   (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions) const = 0;
+virtual VkResult       enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR   (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions) const = 0;
 virtual void           getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR                   (VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, deUint32* pNumPasses) const = 0;
 virtual VkResult       getPhysicalDeviceSurfaceCapabilities2KHR                                                (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities) const = 0;
 virtual VkResult       getPhysicalDeviceSurfaceFormats2KHR                                                             (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, deUint32* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats) const = 0;
index 20d6188..3994a61 100644 (file)
@@ -6042,13 +6042,13 @@ typedef struct VkPerformanceQuerySubmitInfoKHR {
     deUint32           counterPassIndex;
 } VkPerformanceQuerySubmitInfoKHR;
 
-typedef void (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)(VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions);
+typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)(VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions);
 typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR)(VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, deUint32* pNumPasses);
 typedef VkResult (VKAPI_PTR *PFN_vkAcquireProfilingLockKHR)(VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo);
 typedef void (VKAPI_PTR *PFN_vkReleaseProfilingLockKHR)(VkDevice device);
 
 #ifndef VK_NO_PROTOTYPES
-VKAPI_ATTR void VKAPI_CALL vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
+VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
     VkPhysicalDevice                            physicalDevice,
     deUint32                                    queueFamilyIndex,
     deUint32*                                   pCounterCount,
index 7b57413..836d960 100644 (file)
@@ -124,7 +124,8 @@ tcu::TestStatus EnumerateAndValidateTest::iterate (void)
                        continue;
 
                deUint32 counterCount = 0;
-               vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueNdx, &counterCount, DE_NULL, DE_NULL);
+               VK_CHECK(vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueNdx, &counterCount, DE_NULL, DE_NULL));
+
                if (counterCount == 0)
                        continue;
 
@@ -133,7 +134,17 @@ tcu::TestStatus EnumerateAndValidateTest::iterate (void)
                        deUint32                                                                counterCountRead        = counterCount;
                        std::map<std::string, size_t>                   uuidValidator;
 
-                       vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueNdx, &counterCountRead, &counters[0], DE_NULL);
+                       if (counterCount > 1)
+                       {
+                               deUint32        incompleteCounterCount  = counterCount - 1;
+                               VkResult        result;
+
+                               result = vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueNdx, &incompleteCounterCount, &counters[0], DE_NULL);
+                               if (result != VK_INCOMPLETE)
+                                       TCU_FAIL("VK_INCOMPLETE not returned");
+                       }
+
+                       VK_CHECK(vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueNdx, &counterCountRead, &counters[0], DE_NULL));
 
                        if (counterCountRead != counterCount)
                                TCU_FAIL("Number of counters read (" + de::toString(counterCountRead) + ") is not equal to number of counters reported (" + de::toString(counterCount) + ")");
@@ -162,7 +173,7 @@ tcu::TestStatus EnumerateAndValidateTest::iterate (void)
                        std::vector<VkPerformanceCounterDescriptionKHR> counterDescriptors      (counterCount);
                        deUint32                                                                                counterCountRead        = counterCount;
 
-                       vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueNdx, &counterCountRead, DE_NULL, &counterDescriptors[0]);
+                       VK_CHECK(vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueNdx, &counterCountRead, DE_NULL, &counterDescriptors[0]));
 
                        if (counterCountRead != counterCount)
                                TCU_FAIL("Number of counters read (" + de::toString(counterCountRead) + ") is not equal to number of counters reported (" + de::toString(counterCount) + ")");
@@ -223,13 +234,14 @@ void QueryTestBase::setupCounters()
                TCU_THROW(NotSupportedError, "Performance counter query pools feature not supported");
 
        // get the number of supported counters
-       vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueFamilyIndex, &counterCount, NULL, NULL);
+       VK_CHECK(vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueFamilyIndex, &counterCount, NULL, NULL));
+
        if (!counterCount)
                TCU_THROW(NotSupportedError, "QualityWarning: there are no performance counters");
 
        // get supported counters
        m_counters.resize(counterCount);
-       vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueFamilyIndex, &counterCount, &m_counters[0], DE_NULL);
+       VK_CHECK(vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueFamilyIndex, &counterCount, &m_counters[0], DE_NULL));
 }
 
 Move<VkQueryPool> QueryTestBase::createQueryPool(deUint32 enabledCounterOffset, deUint32 enabledCounterStride)
@@ -1195,4 +1207,3 @@ void QueryPoolPerformanceTests::init (void)
 
 } //QueryPool
 } //vkt
-
index 8e7784f..5560b39 100644 (file)
@@ -6039,13 +6039,13 @@ typedef struct VkPerformanceQuerySubmitInfoKHR {
     uint32_t           counterPassIndex;
 } VkPerformanceQuerySubmitInfoKHR;
 
-typedef void (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions);
+typedef VkResult (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions);
 typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR)(VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, uint32_t* pNumPasses);
 typedef VkResult (VKAPI_PTR *PFN_vkAcquireProfilingLockKHR)(VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo);
 typedef void (VKAPI_PTR *PFN_vkReleaseProfilingLockKHR)(VkDevice device);
 
 #ifndef VK_NO_PROTOTYPES
-VKAPI_ATTR void VKAPI_CALL vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
+VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
     VkPhysicalDevice                            physicalDevice,
     uint32_t                                    queueFamilyIndex,
     uint32_t*                                   pCounterCount,