if (radv_device_get_cache_uuid(device->rad_info.family, device->uuid)) {
radv_finish_wsi(device);
device->ws->destroy(device->ws);
+ result = vk_errorf(VK_ERROR_INITIALIZATION_FAILED,
+ "cannot generate UUID");
goto fail;
}
fprintf(stderr, "WARNING: radv is not a conformant vulkan implementation, testing use only.\n");
device->name = device->rad_info.name;
+ close(fd);
return VK_SUCCESS;
fail:
.maxGeometryTotalOutputComponents = 1024,
.maxFragmentInputComponents = 128,
.maxFragmentOutputAttachments = 8,
- .maxFragmentDualSrcAttachments = 2,
+ .maxFragmentDualSrcAttachments = 1,
.maxFragmentCombinedOutputResources = 8,
.maxComputeSharedMemorySize = 32768,
.maxComputeWorkGroupCount = { 65535, 65535, 65535 },
uint32_t* pPropertyCount,
VkExtensionProperties* pProperties)
{
- unsigned i;
if (pProperties == NULL) {
*pPropertyCount = ARRAY_SIZE(global_extensions);
return VK_SUCCESS;
}
- for (i = 0; i < *pPropertyCount; i++)
- memcpy(&pProperties[i], &global_extensions[i], sizeof(VkExtensionProperties));
+ *pPropertyCount = MIN2(*pPropertyCount, ARRAY_SIZE(global_extensions));
+ typed_memcpy(pProperties, global_extensions, *pPropertyCount);
- *pPropertyCount = i;
- if (i < ARRAY_SIZE(global_extensions))
+ if (*pPropertyCount < ARRAY_SIZE(global_extensions))
return VK_INCOMPLETE;
return VK_SUCCESS;
uint32_t* pPropertyCount,
VkExtensionProperties* pProperties)
{
- unsigned i;
-
if (pProperties == NULL) {
*pPropertyCount = ARRAY_SIZE(device_extensions);
return VK_SUCCESS;
}
- for (i = 0; i < *pPropertyCount; i++)
- memcpy(&pProperties[i], &device_extensions[i], sizeof(VkExtensionProperties));
+ *pPropertyCount = MIN2(*pPropertyCount, ARRAY_SIZE(device_extensions));
+ typed_memcpy(pProperties, device_extensions, *pPropertyCount);
- *pPropertyCount = i;
- if (i < ARRAY_SIZE(device_extensions))
+ if (*pPropertyCount < ARRAY_SIZE(device_extensions))
return VK_INCOMPLETE;
+
return VK_SUCCESS;
}