[Mesa-dev] [PATCH] radv: fix common extensions getting registered twice.

Dave Airlie airlied at gmail.com
Sun Feb 19 20:56:46 UTC 2017


From: Dave Airlie <airlied at redhat.com>

physical devices can be enumerated multiple time per instance,
this was causing the realloc to be hit for no reason, and
the CTS allocation verification would get angry.

We'd also be allocating common extensions onto the list
each time for no reason.

This hopefully fixes a bunch of CTS oom tests.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/vulkan/radv_device.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index f0cbb7b..d86e17a 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -242,12 +242,14 @@ radv_physical_device_init(struct radv_physical_device *device,
 		goto fail;
 	}
 
-	result = radv_extensions_register(instance,
-					&device->extensions,
-					common_device_extensions,
-					ARRAY_SIZE(common_device_extensions));
-	if (result != VK_SUCCESS)
-		goto fail;
+	if (device->extensions.num_ext < ARRAY_SIZE(common_device_extensions)) {
+		result = radv_extensions_register(instance,
+						  &device->extensions,
+						  common_device_extensions,
+						  ARRAY_SIZE(common_device_extensions));
+		if (result != VK_SUCCESS)
+			goto fail;
+	}
 
 	fprintf(stderr, "WARNING: radv is not a conformant vulkan implementation, testing use only.\n");
 	device->name = device->rad_info.name;
-- 
2.9.3



More information about the mesa-dev mailing list