diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-07-22 10:17:30 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-07-22 10:17:30 +0000 |
commit | 73b65ddf621ec36f84c239cba7d3903b262035ef (patch) | |
tree | 766fd338c039ff6fcff6ddfe74e5de6996904b10 /lib | |
parent | 9264de6d0cee2d35b0b7673008625e49f1871131 (diff) |
Import Mesa 21.1.5
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mesa/src/util/tests/cache/cache_test.c | 134 | ||||
-rw-r--r-- | lib/mesa/src/vulkan/util/vk_cmd_copy.c | 10 | ||||
-rw-r--r-- | lib/mesa/src/vulkan/util/vk_device.c | 462 | ||||
-rw-r--r-- | lib/mesa/src/vulkan/util/vk_device.h | 14 | ||||
-rw-r--r-- | lib/mesa/src/vulkan/util/vk_instance.c | 73 | ||||
-rw-r--r-- | lib/mesa/src/vulkan/util/vk_instance.h | 11 | ||||
-rw-r--r-- | lib/mesa/src/vulkan/util/vk_object.c | 41 | ||||
-rw-r--r-- | lib/mesa/src/vulkan/util/vk_object.h | 14 | ||||
-rw-r--r-- | lib/mesa/src/vulkan/util/vk_physical_device.c | 63 | ||||
-rw-r--r-- | lib/mesa/src/vulkan/util/vk_physical_device.h | 8 | ||||
-rw-r--r-- | lib/mesa/src/vulkan/util/vk_shader_module.h | 2 |
11 files changed, 47 insertions, 785 deletions
diff --git a/lib/mesa/src/util/tests/cache/cache_test.c b/lib/mesa/src/util/tests/cache/cache_test.c index 2cb2c9a92..ec1587daa 100644 --- a/lib/mesa/src/util/tests/cache/cache_test.c +++ b/lib/mesa/src/util/tests/cache/cache_test.c @@ -192,7 +192,7 @@ cache_exists(struct disk_cache *cache) #define CACHE_TEST_TMP "./cache-test-tmp" static void -test_disk_cache_create(const char *cache_dir_name) +test_disk_cache_create(void) { struct disk_cache *cache; int err; @@ -255,10 +255,8 @@ test_disk_cache_create(const char *cache_dir_name) expect_true(cache_exists(cache), "disk_cache_create with XDG_CACHE_HOME " "set"); - char *path; - asprintf(&path, "%s%s", CACHE_TEST_TMP "/xdg-cache-home/", cache_dir_name); - check_directories_created(path); - free(path); + check_directories_created(CACHE_TEST_TMP "/xdg-cache-home/" + CACHE_DIR_NAME); disk_cache_destroy(cache); @@ -283,16 +281,14 @@ test_disk_cache_create(const char *cache_dir_name) expect_true(cache_exists(cache), "disk_cache_create with " "MESA_GLSL_CACHE_DIR set"); - asprintf(&path, "%s%s", CACHE_TEST_TMP "/mesa-glsl-cache-dir/", - cache_dir_name); - check_directories_created(path); - free(path); + check_directories_created(CACHE_TEST_TMP "/mesa-glsl-cache-dir/" + CACHE_DIR_NAME); disk_cache_destroy(cache); } static void -test_put_and_get(bool test_cache_size_limit) +test_put_and_get(void) { struct disk_cache *cache; char blob[] = "This is a blob of thirty-seven bytes"; @@ -346,9 +342,6 @@ test_put_and_get(bool test_cache_size_limit) /* Set the cache size to 1KB and add a 1KB item to force an eviction. */ disk_cache_destroy(cache); - if (!test_cache_size_limit) - return; - setenv("MESA_GLSL_CACHE_MAX_SIZE", "1K", 1); cache = disk_cache_create("test", "make_check", 0); @@ -524,127 +517,22 @@ test_put_key_and_get_key(void) disk_cache_destroy(cache); } - -/* To make sure we are not just using the inmemory cache index for the single - * file cache we test adding and retriving cache items between two different - * cache instances. - */ -static void -test_put_and_get_between_instances() -{ - char blob[] = "This is a blob of thirty-seven bytes"; - uint8_t blob_key[20]; - char string[] = "While this string has thirty-four"; - uint8_t string_key[20]; - char *result; - size_t size; - -#ifdef SHADER_CACHE_DISABLE_BY_DEFAULT - setenv("MESA_GLSL_CACHE_DISABLE", "false", 1); -#endif /* SHADER_CACHE_DISABLE_BY_DEFAULT */ - - struct disk_cache *cache1 = disk_cache_create("test_between_instances", - "make_check", 0); - struct disk_cache *cache2 = disk_cache_create("test_between_instances", - "make_check", 0); - - disk_cache_compute_key(cache1, blob, sizeof(blob), blob_key); - - /* Ensure that disk_cache_get returns nothing before anything is added. */ - result = disk_cache_get(cache1, blob_key, &size); - expect_null(result, "disk_cache_get(cache1) with non-existent item (pointer)"); - expect_equal(size, 0, "disk_cache_get(cach1) with non-existent item (size)"); - - result = disk_cache_get(cache2, blob_key, &size); - expect_null(result, "disk_cache_get(cache2) with non-existent item (pointer)"); - expect_equal(size, 0, "disk_cache_get(cache2) with non-existent item (size)"); - - /* Simple test of put and get. */ - disk_cache_put(cache1, blob_key, blob, sizeof(blob), NULL); - - /* disk_cache_put() hands things off to a thread so wait for it. */ - disk_cache_wait_for_idle(cache1); - - result = disk_cache_get(cache2, blob_key, &size); - expect_equal_str(blob, result, "disk_cache_get(cache2) of existing item (pointer)"); - expect_equal(size, sizeof(blob), "disk_cache_get of(cache2) existing item (size)"); - - free(result); - - /* Test put and get of a second item, via the opposite instances */ - disk_cache_compute_key(cache2, string, sizeof(string), string_key); - disk_cache_put(cache2, string_key, string, sizeof(string), NULL); - - /* disk_cache_put() hands things off to a thread so wait for it. */ - disk_cache_wait_for_idle(cache2); - - result = disk_cache_get(cache1, string_key, &size); - expect_equal_str(result, string, "2nd disk_cache_get(cache1) of existing item (pointer)"); - expect_equal(size, sizeof(string), "2nd disk_cache_get(cache1) of existing item (size)"); - - free(result); - - disk_cache_destroy(cache1); - disk_cache_destroy(cache2); -} #endif /* ENABLE_SHADER_CACHE */ -static void -test_multi_file_cache(void) -{ - int err; - - printf("Test multi file disk cache - Start\n"); - - test_disk_cache_create(CACHE_DIR_NAME); - - test_put_and_get(true); - - test_put_key_and_get_key(); - - printf("Test multi file disk cache - End\n"); - - err = rmrf_local(CACHE_TEST_TMP); - expect_equal(err, 0, "Removing " CACHE_TEST_TMP " again"); -} - -static void -test_single_file_cache(void) +int +main(void) { +#ifdef ENABLE_SHADER_CACHE int err; - printf("Test single file disk cache - Start\n"); - - setenv("MESA_DISK_CACHE_SINGLE_FILE", "true", 1); + test_disk_cache_create(); - test_disk_cache_create(CACHE_DIR_NAME_SF); - - /* We skip testing cache size limit as the single file cache currently - * doesn't have any functionality to enforce cache size limits. - */ - test_put_and_get(false); + test_put_and_get(); test_put_key_and_get_key(); - test_put_and_get_between_instances(); - - setenv("MESA_DISK_CACHE_SINGLE_FILE", "false", 1); - - printf("Test single file disk cache - End\n"); - err = rmrf_local(CACHE_TEST_TMP); expect_equal(err, 0, "Removing " CACHE_TEST_TMP " again"); -} - -int -main(void) -{ -#ifdef ENABLE_SHADER_CACHE - - test_multi_file_cache(); - - test_single_file_cache(); - #endif /* ENABLE_SHADER_CACHE */ return error ? 1 : 0; diff --git a/lib/mesa/src/vulkan/util/vk_cmd_copy.c b/lib/mesa/src/vulkan/util/vk_cmd_copy.c index 9fcb0c23d..5c71dbb38 100644 --- a/lib/mesa/src/vulkan/util/vk_cmd_copy.c +++ b/lib/mesa/src/vulkan/util/vk_cmd_copy.c @@ -23,7 +23,15 @@ #include "vk_common_entrypoints.h" #include "vk_device.h" -#include "vk_util.h" + +#define STACK_ARRAY_SIZE 8 + +#define STACK_ARRAY(type, name, size) \ + type _stack_##name[STACK_ARRAY_SIZE], *const name = \ + (size) <= STACK_ARRAY_SIZE ? _stack_##name : malloc((size) * sizeof(type)) + +#define STACK_ARRAY_FINISH(name) \ + if (name != _stack_##name) free(name) VKAPI_ATTR void VKAPI_CALL vk_common_CmdCopyBuffer(VkCommandBuffer commandBuffer, diff --git a/lib/mesa/src/vulkan/util/vk_device.c b/lib/mesa/src/vulkan/util/vk_device.c index e3617507b..cfaebc58d 100644 --- a/lib/mesa/src/vulkan/util/vk_device.c +++ b/lib/mesa/src/vulkan/util/vk_device.c @@ -25,10 +25,7 @@ #include "vk_common_entrypoints.h" #include "vk_instance.h" -#include "vk_log.h" #include "vk_physical_device.h" -#include "vk_queue.h" -#include "vk_util.h" #include "util/hash_table.h" #include "util/ralloc.h" @@ -63,35 +60,21 @@ vk_device_init(struct vk_device *device, } if (idx >= VK_DEVICE_EXTENSION_COUNT) - return vk_errorf(physical_device, VK_ERROR_EXTENSION_NOT_PRESENT, - "%s not supported", - pCreateInfo->ppEnabledExtensionNames[i]); + return VK_ERROR_EXTENSION_NOT_PRESENT; if (!physical_device->supported_extensions.extensions[idx]) - return vk_errorf(physical_device, VK_ERROR_EXTENSION_NOT_PRESENT, - "%s not supported", - pCreateInfo->ppEnabledExtensionNames[i]); + return VK_ERROR_EXTENSION_NOT_PRESENT; #ifdef ANDROID if (!vk_android_allowed_device_extensions.extensions[idx]) - return vk_errorf(physical_device, VK_ERROR_EXTENSION_NOT_PRESENT, - "%s not supported", - pCreateInfo->ppEnabledExtensionNames[i]); + return VK_ERROR_EXTENSION_NOT_PRESENT; #endif device->enabled_extensions.extensions[idx] = true; } - VkResult result = - vk_physical_device_check_device_features(physical_device, - pCreateInfo); - if (result != VK_SUCCESS) - return result; - p_atomic_set(&device->private_data_next_index, 0); - list_inithead(&device->queues); - #ifdef ANDROID mtx_init(&device->swapchain_private_mtx, mtx_plain); device->swapchain_private = NULL; @@ -103,9 +86,6 @@ vk_device_init(struct vk_device *device, void vk_device_finish(UNUSED struct vk_device *device) { - /* Drivers should tear down their own queues */ - assert(list_is_empty(&device->queues)); - #ifdef ANDROID if (device->swapchain_private) { hash_table_foreach(device->swapchain_private, entry) @@ -167,35 +147,6 @@ vk_common_GetDeviceQueue(VkDevice _device, } VKAPI_ATTR void VKAPI_CALL -vk_common_GetDeviceQueue2(VkDevice _device, - const VkDeviceQueueInfo2 *pQueueInfo, - VkQueue *pQueue) -{ - VK_FROM_HANDLE(vk_device, device, _device); - - struct vk_queue *queue = NULL; - vk_foreach_queue(iter, device) { - if (iter->queue_family_index == pQueueInfo->queueFamilyIndex && - iter->index_in_family == pQueueInfo->queueIndex) { - queue = iter; - break; - } - } - - /* From the Vulkan 1.1.70 spec: - * - * "The queue returned by vkGetDeviceQueue2 must have the same flags - * value from this structure as that used at device creation time in a - * VkDeviceQueueCreateInfo instance. If no matching flags were specified - * at device creation time then pQueue will return VK_NULL_HANDLE." - */ - if (queue && queue->flags == pQueueInfo->flags) - *pQueue = vk_queue_to_handle(queue); - else - *pQueue = VK_NULL_HANDLE; -} - -VKAPI_ATTR void VKAPI_CALL vk_common_GetBufferMemoryRequirements(VkDevice _device, VkBuffer buffer, VkMemoryRequirements *pMemoryRequirements) @@ -268,410 +219,3 @@ vk_common_BindImageMemory(VkDevice _device, return device->dispatch_table.BindImageMemory2(_device, 1, &bind); } - -VKAPI_ATTR void VKAPI_CALL -vk_common_GetImageSparseMemoryRequirements(VkDevice _device, - VkImage image, - uint32_t *pSparseMemoryRequirementCount, - VkSparseImageMemoryRequirements *pSparseMemoryRequirements) -{ - VK_FROM_HANDLE(vk_device, device, _device); - - VkImageSparseMemoryRequirementsInfo2 info = { - .sType = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2, - .image = image, - }; - - if (!pSparseMemoryRequirements) { - device->dispatch_table.GetImageSparseMemoryRequirements2(_device, - &info, - pSparseMemoryRequirementCount, - NULL); - return; - } - - STACK_ARRAY(VkSparseImageMemoryRequirements2, mem_reqs2, *pSparseMemoryRequirementCount); - - for (unsigned i = 0; i < *pSparseMemoryRequirementCount; ++i) { - mem_reqs2[i].sType = VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2; - mem_reqs2[i].pNext = NULL; - } - - device->dispatch_table.GetImageSparseMemoryRequirements2(_device, - &info, - pSparseMemoryRequirementCount, - mem_reqs2); - - for (unsigned i = 0; i < *pSparseMemoryRequirementCount; ++i) - pSparseMemoryRequirements[i] = mem_reqs2[i].memoryRequirements; - - STACK_ARRAY_FINISH(mem_reqs2); -} - -VKAPI_ATTR VkResult VKAPI_CALL -vk_common_DeviceWaitIdle(VkDevice _device) -{ - VK_FROM_HANDLE(vk_device, device, _device); - const struct vk_device_dispatch_table *disp = &device->dispatch_table; - - vk_foreach_queue(queue, device) { - VkResult result = disp->QueueWaitIdle(vk_queue_to_handle(queue)); - if (result != VK_SUCCESS) - return result; - } - - return VK_SUCCESS; -} - -static void -copy_vk_struct_guts(VkBaseOutStructure *dst, VkBaseInStructure *src, size_t struct_size) -{ - STATIC_ASSERT(sizeof(*dst) == sizeof(*src)); - memcpy(dst + 1, src + 1, struct_size - sizeof(VkBaseOutStructure)); -} - -#define CORE_FEATURE(feature) features->feature = core->feature - -bool -vk_get_physical_device_core_1_1_feature_ext(struct VkBaseOutStructure *ext, - const VkPhysicalDeviceVulkan11Features *core) -{ - - switch (ext->sType) { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: { - VkPhysicalDevice16BitStorageFeatures *features = (void *)ext; - CORE_FEATURE(storageBuffer16BitAccess); - CORE_FEATURE(uniformAndStorageBuffer16BitAccess); - CORE_FEATURE(storagePushConstant16); - CORE_FEATURE(storageInputOutput16); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: { - VkPhysicalDeviceMultiviewFeatures *features = (void *)ext; - CORE_FEATURE(multiview); - CORE_FEATURE(multiviewGeometryShader); - CORE_FEATURE(multiviewTessellationShader); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: { - VkPhysicalDeviceProtectedMemoryFeatures *features = (void *)ext; - CORE_FEATURE(protectedMemory); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: { - VkPhysicalDeviceSamplerYcbcrConversionFeatures *features = (void *) ext; - CORE_FEATURE(samplerYcbcrConversion); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: { - VkPhysicalDeviceShaderDrawParametersFeatures *features = (void *)ext; - CORE_FEATURE(shaderDrawParameters); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: { - VkPhysicalDeviceVariablePointersFeatures *features = (void *)ext; - CORE_FEATURE(variablePointersStorageBuffer); - CORE_FEATURE(variablePointers); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: - copy_vk_struct_guts(ext, (void *)core, sizeof(*core)); - return true; - - default: - return false; - } -} - -bool -vk_get_physical_device_core_1_2_feature_ext(struct VkBaseOutStructure *ext, - const VkPhysicalDeviceVulkan12Features *core) -{ - - switch (ext->sType) { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR: { - VkPhysicalDevice8BitStorageFeaturesKHR *features = (void *)ext; - CORE_FEATURE(storageBuffer8BitAccess); - CORE_FEATURE(uniformAndStorageBuffer8BitAccess); - CORE_FEATURE(storagePushConstant8); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR: { - VkPhysicalDeviceBufferDeviceAddressFeaturesKHR *features = (void *)ext; - CORE_FEATURE(bufferDeviceAddress); - CORE_FEATURE(bufferDeviceAddressCaptureReplay); - CORE_FEATURE(bufferDeviceAddressMultiDevice); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT: { - VkPhysicalDeviceDescriptorIndexingFeaturesEXT *features = (void *)ext; - CORE_FEATURE(shaderInputAttachmentArrayDynamicIndexing); - CORE_FEATURE(shaderUniformTexelBufferArrayDynamicIndexing); - CORE_FEATURE(shaderStorageTexelBufferArrayDynamicIndexing); - CORE_FEATURE(shaderUniformBufferArrayNonUniformIndexing); - CORE_FEATURE(shaderSampledImageArrayNonUniformIndexing); - CORE_FEATURE(shaderStorageBufferArrayNonUniformIndexing); - CORE_FEATURE(shaderStorageImageArrayNonUniformIndexing); - CORE_FEATURE(shaderInputAttachmentArrayNonUniformIndexing); - CORE_FEATURE(shaderUniformTexelBufferArrayNonUniformIndexing); - CORE_FEATURE(shaderStorageTexelBufferArrayNonUniformIndexing); - CORE_FEATURE(descriptorBindingUniformBufferUpdateAfterBind); - CORE_FEATURE(descriptorBindingSampledImageUpdateAfterBind); - CORE_FEATURE(descriptorBindingStorageImageUpdateAfterBind); - CORE_FEATURE(descriptorBindingStorageBufferUpdateAfterBind); - CORE_FEATURE(descriptorBindingUniformTexelBufferUpdateAfterBind); - CORE_FEATURE(descriptorBindingStorageTexelBufferUpdateAfterBind); - CORE_FEATURE(descriptorBindingUpdateUnusedWhilePending); - CORE_FEATURE(descriptorBindingPartiallyBound); - CORE_FEATURE(descriptorBindingVariableDescriptorCount); - CORE_FEATURE(runtimeDescriptorArray); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR: { - VkPhysicalDeviceFloat16Int8FeaturesKHR *features = (void *)ext; - CORE_FEATURE(shaderFloat16); - CORE_FEATURE(shaderInt8); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT: { - VkPhysicalDeviceHostQueryResetFeaturesEXT *features = (void *)ext; - CORE_FEATURE(hostQueryReset); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR: { - VkPhysicalDeviceImagelessFramebufferFeaturesKHR *features = (void *)ext; - CORE_FEATURE(imagelessFramebuffer); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT: { - VkPhysicalDeviceScalarBlockLayoutFeaturesEXT *features =(void *)ext; - CORE_FEATURE(scalarBlockLayout); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES_KHR: { - VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR *features = (void *)ext; - CORE_FEATURE(separateDepthStencilLayouts); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR: { - VkPhysicalDeviceShaderAtomicInt64FeaturesKHR *features = (void *)ext; - CORE_FEATURE(shaderBufferInt64Atomics); - CORE_FEATURE(shaderSharedInt64Atomics); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES_KHR: { - VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR *features = (void *)ext; - CORE_FEATURE(shaderSubgroupExtendedTypes); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR: { - VkPhysicalDeviceTimelineSemaphoreFeaturesKHR *features = (void *) ext; - CORE_FEATURE(timelineSemaphore); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR: { - VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR *features = (void *)ext; - CORE_FEATURE(uniformBufferStandardLayout); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR: { - VkPhysicalDeviceVulkanMemoryModelFeaturesKHR *features = (void *)ext; - CORE_FEATURE(vulkanMemoryModel); - CORE_FEATURE(vulkanMemoryModelDeviceScope); - CORE_FEATURE(vulkanMemoryModelAvailabilityVisibilityChains); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: - copy_vk_struct_guts(ext, (void *)core, sizeof(*core)); - return true; - - default: - return false; - } -} - -#undef CORE_FEATURE - -#define CORE_RENAMED_PROPERTY(ext_property, core_property) \ - memcpy(&properties->ext_property, &core->core_property, sizeof(core->core_property)) - -#define CORE_PROPERTY(property) CORE_RENAMED_PROPERTY(property, property) - -bool -vk_get_physical_device_core_1_1_property_ext(struct VkBaseOutStructure *ext, - const VkPhysicalDeviceVulkan11Properties *core) -{ - switch (ext->sType) { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: { - VkPhysicalDeviceIDProperties *properties = (void *)ext; - CORE_PROPERTY(deviceUUID); - CORE_PROPERTY(driverUUID); - CORE_PROPERTY(deviceLUID); - CORE_PROPERTY(deviceLUIDValid); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: { - VkPhysicalDeviceMaintenance3Properties *properties = (void *)ext; - CORE_PROPERTY(maxPerSetDescriptors); - CORE_PROPERTY(maxMemoryAllocationSize); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: { - VkPhysicalDeviceMultiviewProperties *properties = (void *)ext; - CORE_PROPERTY(maxMultiviewViewCount); - CORE_PROPERTY(maxMultiviewInstanceIndex); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: { - VkPhysicalDevicePointClippingProperties *properties = (void *) ext; - CORE_PROPERTY(pointClippingBehavior); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: { - VkPhysicalDeviceProtectedMemoryProperties *properties = (void *)ext; - CORE_PROPERTY(protectedNoFault); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: { - VkPhysicalDeviceSubgroupProperties *properties = (void *)ext; - CORE_PROPERTY(subgroupSize); - CORE_RENAMED_PROPERTY(supportedStages, - subgroupSupportedStages); - CORE_RENAMED_PROPERTY(supportedOperations, - subgroupSupportedOperations); - CORE_RENAMED_PROPERTY(quadOperationsInAllStages, - subgroupQuadOperationsInAllStages); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: - copy_vk_struct_guts(ext, (void *)core, sizeof(*core)); - return true; - - default: - return false; - } -} - -bool -vk_get_physical_device_core_1_2_property_ext(struct VkBaseOutStructure *ext, - const VkPhysicalDeviceVulkan12Properties *core) -{ - switch (ext->sType) { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR: { - VkPhysicalDeviceDepthStencilResolvePropertiesKHR *properties = (void *)ext; - CORE_PROPERTY(supportedDepthResolveModes); - CORE_PROPERTY(supportedStencilResolveModes); - CORE_PROPERTY(independentResolveNone); - CORE_PROPERTY(independentResolve); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT: { - VkPhysicalDeviceDescriptorIndexingPropertiesEXT *properties = (void *)ext; - CORE_PROPERTY(maxUpdateAfterBindDescriptorsInAllPools); - CORE_PROPERTY(shaderUniformBufferArrayNonUniformIndexingNative); - CORE_PROPERTY(shaderSampledImageArrayNonUniformIndexingNative); - CORE_PROPERTY(shaderStorageBufferArrayNonUniformIndexingNative); - CORE_PROPERTY(shaderStorageImageArrayNonUniformIndexingNative); - CORE_PROPERTY(shaderInputAttachmentArrayNonUniformIndexingNative); - CORE_PROPERTY(robustBufferAccessUpdateAfterBind); - CORE_PROPERTY(quadDivergentImplicitLod); - CORE_PROPERTY(maxPerStageDescriptorUpdateAfterBindSamplers); - CORE_PROPERTY(maxPerStageDescriptorUpdateAfterBindUniformBuffers); - CORE_PROPERTY(maxPerStageDescriptorUpdateAfterBindStorageBuffers); - CORE_PROPERTY(maxPerStageDescriptorUpdateAfterBindSampledImages); - CORE_PROPERTY(maxPerStageDescriptorUpdateAfterBindStorageImages); - CORE_PROPERTY(maxPerStageDescriptorUpdateAfterBindInputAttachments); - CORE_PROPERTY(maxPerStageUpdateAfterBindResources); - CORE_PROPERTY(maxDescriptorSetUpdateAfterBindSamplers); - CORE_PROPERTY(maxDescriptorSetUpdateAfterBindUniformBuffers); - CORE_PROPERTY(maxDescriptorSetUpdateAfterBindUniformBuffersDynamic); - CORE_PROPERTY(maxDescriptorSetUpdateAfterBindStorageBuffers); - CORE_PROPERTY(maxDescriptorSetUpdateAfterBindStorageBuffersDynamic); - CORE_PROPERTY(maxDescriptorSetUpdateAfterBindSampledImages); - CORE_PROPERTY(maxDescriptorSetUpdateAfterBindStorageImages); - CORE_PROPERTY(maxDescriptorSetUpdateAfterBindInputAttachments); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR: { - VkPhysicalDeviceDriverPropertiesKHR *properties = (void *) ext; - CORE_PROPERTY(driverID); - CORE_PROPERTY(driverName); - CORE_PROPERTY(driverInfo); - CORE_PROPERTY(conformanceVersion); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT: { - VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT *properties = (void *)ext; - CORE_PROPERTY(filterMinmaxImageComponentMapping); - CORE_PROPERTY(filterMinmaxSingleComponentFormats); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR : { - VkPhysicalDeviceFloatControlsPropertiesKHR *properties = (void *)ext; - CORE_PROPERTY(denormBehaviorIndependence); - CORE_PROPERTY(roundingModeIndependence); - CORE_PROPERTY(shaderDenormFlushToZeroFloat16); - CORE_PROPERTY(shaderDenormPreserveFloat16); - CORE_PROPERTY(shaderRoundingModeRTEFloat16); - CORE_PROPERTY(shaderRoundingModeRTZFloat16); - CORE_PROPERTY(shaderSignedZeroInfNanPreserveFloat16); - CORE_PROPERTY(shaderDenormFlushToZeroFloat32); - CORE_PROPERTY(shaderDenormPreserveFloat32); - CORE_PROPERTY(shaderRoundingModeRTEFloat32); - CORE_PROPERTY(shaderRoundingModeRTZFloat32); - CORE_PROPERTY(shaderSignedZeroInfNanPreserveFloat32); - CORE_PROPERTY(shaderDenormFlushToZeroFloat64); - CORE_PROPERTY(shaderDenormPreserveFloat64); - CORE_PROPERTY(shaderRoundingModeRTEFloat64); - CORE_PROPERTY(shaderRoundingModeRTZFloat64); - CORE_PROPERTY(shaderSignedZeroInfNanPreserveFloat64); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES_KHR: { - VkPhysicalDeviceTimelineSemaphorePropertiesKHR *properties = (void *) ext; - CORE_PROPERTY(maxTimelineSemaphoreValueDifference); - return true; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: - copy_vk_struct_guts(ext, (void *)core, sizeof(*core)); - return true; - - default: - return false; - } -} - -#undef CORE_RENAMED_PROPERTY -#undef CORE_PROPERTY - diff --git a/lib/mesa/src/vulkan/util/vk_device.h b/lib/mesa/src/vulkan/util/vk_device.h index 3bb0347e0..e31688475 100644 --- a/lib/mesa/src/vulkan/util/vk_device.h +++ b/lib/mesa/src/vulkan/util/vk_device.h @@ -27,8 +27,6 @@ #include "vk_extensions.h" #include "vk_object.h" -#include "util/list.h" - #ifdef __cplusplus extern "C" { #endif @@ -45,8 +43,6 @@ struct vk_device { /* For VK_EXT_private_data */ uint32_t private_data_next_index; - struct list_head queues; - #ifdef ANDROID mtx_t swapchain_private_mtx; struct hash_table *swapchain_private; @@ -70,16 +66,6 @@ PFN_vkVoidFunction vk_device_get_proc_addr(const struct vk_device *device, const char *name); -bool vk_get_physical_device_core_1_1_feature_ext(struct VkBaseOutStructure *ext, - const VkPhysicalDeviceVulkan11Features *core); -bool vk_get_physical_device_core_1_2_feature_ext(struct VkBaseOutStructure *ext, - const VkPhysicalDeviceVulkan12Features *core); - -bool vk_get_physical_device_core_1_1_property_ext(struct VkBaseOutStructure *ext, - const VkPhysicalDeviceVulkan11Properties *core); -bool vk_get_physical_device_core_1_2_property_ext(struct VkBaseOutStructure *ext, - const VkPhysicalDeviceVulkan12Properties *core); - #ifdef __cplusplus } #endif diff --git a/lib/mesa/src/vulkan/util/vk_instance.c b/lib/mesa/src/vulkan/util/vk_instance.c index 931071509..5787be170 100644 --- a/lib/mesa/src/vulkan/util/vk_instance.c +++ b/lib/mesa/src/vulkan/util/vk_instance.c @@ -25,9 +25,7 @@ #include "vk_alloc.h" #include "vk_common_entrypoints.h" -#include "vk_log.h" #include "vk_util.h" -#include "vk_debug_utils.h" #include "compiler/glsl_types.h" @@ -42,38 +40,6 @@ vk_instance_init(struct vk_instance *instance, vk_object_base_init(NULL, &instance->base, VK_OBJECT_TYPE_INSTANCE); instance->alloc = *alloc; - /* VK_EXT_debug_utils */ - /* These messengers will only be used during vkCreateInstance or - * vkDestroyInstance calls. We do this first so that it's safe to use - * vk_errorf and friends. - */ - list_inithead(&instance->debug_utils.instance_callbacks); - vk_foreach_struct_const(ext, pCreateInfo->pNext) { - if (ext->sType == - VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT) { - const VkDebugUtilsMessengerCreateInfoEXT *debugMessengerCreateInfo = - (const VkDebugUtilsMessengerCreateInfoEXT *)ext; - struct vk_debug_utils_messenger *messenger = - vk_alloc2(alloc, alloc, sizeof(struct vk_debug_utils_messenger), 8, - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); - - if (!messenger) - return vk_error(instance, VK_ERROR_OUT_OF_HOST_MEMORY); - - vk_object_base_init(NULL, &messenger->base, - VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT); - - messenger->alloc = *alloc; - messenger->severity = debugMessengerCreateInfo->messageSeverity; - messenger->type = debugMessengerCreateInfo->messageType; - messenger->callback = debugMessengerCreateInfo->pfnUserCallback; - messenger->data = debugMessengerCreateInfo->pUserData; - - list_addtail(&messenger->link, - &instance->debug_utils.instance_callbacks); - } - } - instance->app_info = (struct vk_app_info) { .api_version = 0 }; if (pCreateInfo->pApplicationInfo) { const VkApplicationInfo *app = pCreateInfo->pApplicationInfo; @@ -103,20 +69,14 @@ vk_instance_init(struct vk_instance *instance, } if (idx >= VK_INSTANCE_EXTENSION_COUNT) - return vk_errorf(instance, VK_ERROR_EXTENSION_NOT_PRESENT, - "%s not supported", - pCreateInfo->ppEnabledExtensionNames[i]); + return VK_ERROR_EXTENSION_NOT_PRESENT; if (!supported_extensions->extensions[idx]) - return vk_errorf(instance, VK_ERROR_EXTENSION_NOT_PRESENT, - "%s not supported", - pCreateInfo->ppEnabledExtensionNames[i]); + return VK_ERROR_EXTENSION_NOT_PRESENT; #ifdef ANDROID if (!vk_android_allowed_instance_extensions.extensions[idx]) - return vk_errorf(instance, VK_ERROR_EXTENSION_NOT_PRESENT, - "%s not supported", - pCreateInfo->ppEnabledExtensionNames[i]); + return VK_ERROR_EXTENSION_NOT_PRESENT; #endif instance->enabled_extensions.extensions[idx] = true; @@ -129,17 +89,10 @@ vk_instance_init(struct vk_instance *instance, &instance->dispatch_table, &vk_common_instance_entrypoints, false); if (mtx_init(&instance->debug_report.callbacks_mutex, mtx_plain) != 0) - return vk_error(instance, VK_ERROR_INITIALIZATION_FAILED); + return VK_ERROR_INITIALIZATION_FAILED; list_inithead(&instance->debug_report.callbacks); - if (mtx_init(&instance->debug_utils.callbacks_mutex, mtx_plain) != 0) { - mtx_destroy(&instance->debug_report.callbacks_mutex); - return vk_error(instance, VK_ERROR_INITIALIZATION_FAILED); - } - - list_inithead(&instance->debug_utils.callbacks); - glsl_type_singleton_init_or_ref(); return VK_SUCCESS; @@ -149,25 +102,7 @@ void vk_instance_finish(struct vk_instance *instance) { glsl_type_singleton_decref(); - if (unlikely(!list_is_empty(&instance->debug_utils.callbacks))) { - list_for_each_entry_safe(struct vk_debug_utils_messenger, messenger, - &instance->debug_utils.callbacks, link) { - list_del(&messenger->link); - vk_object_base_finish(&messenger->base); - vk_free2(&instance->alloc, &messenger->alloc, messenger); - } - } - if (unlikely(!list_is_empty(&instance->debug_utils.instance_callbacks))) { - list_for_each_entry_safe(struct vk_debug_utils_messenger, messenger, - &instance->debug_utils.instance_callbacks, - link) { - list_del(&messenger->link); - vk_object_base_finish(&messenger->base); - vk_free2(&instance->alloc, &messenger->alloc, messenger); - } - } mtx_destroy(&instance->debug_report.callbacks_mutex); - mtx_destroy(&instance->debug_utils.callbacks_mutex); vk_free(&instance->alloc, (char *)instance->app_info.app_name); vk_free(&instance->alloc, (char *)instance->app_info.engine_name); vk_object_base_finish(&instance->base); diff --git a/lib/mesa/src/vulkan/util/vk_instance.h b/lib/mesa/src/vulkan/util/vk_instance.h index 88af1a6b4..5f195ca0d 100644 --- a/lib/mesa/src/vulkan/util/vk_instance.h +++ b/lib/mesa/src/vulkan/util/vk_instance.h @@ -56,17 +56,6 @@ struct vk_instance { mtx_t callbacks_mutex; struct list_head callbacks; } debug_report; - - /* VK_EXT_debug_utils */ - struct { - /* These callbacks are only used while creating or destroying an - * instance - */ - struct list_head instance_callbacks; - mtx_t callbacks_mutex; - /* Persistent callbacks */ - struct list_head callbacks; - } debug_utils; }; VK_DEFINE_HANDLE_CASTS(vk_instance, base, VkInstance, diff --git a/lib/mesa/src/vulkan/util/vk_object.c b/lib/mesa/src/vulkan/util/vk_object.c index 52dbeaedd..af2c72ba9 100644 --- a/lib/mesa/src/vulkan/util/vk_object.c +++ b/lib/mesa/src/vulkan/util/vk_object.c @@ -28,28 +28,35 @@ #include "vk_device.h" #include "util/hash_table.h" #include "util/ralloc.h" -#include "vk_enum_to_str.h" + +static void +vk_object_base_reinit(struct vk_object_base *base) +{ + base->_loader_data.loaderMagic = ICD_LOADER_MAGIC; + util_sparse_array_init(&base->private_data, sizeof(uint64_t), 8); +} void vk_object_base_init(struct vk_device *device, struct vk_object_base *base, UNUSED VkObjectType obj_type) { - base->_loader_data.loaderMagic = ICD_LOADER_MAGIC; + vk_object_base_reinit(base); base->type = obj_type; base->device = device; - base->client_visible = false; - base->object_name = NULL; - util_sparse_array_init(&base->private_data, sizeof(uint64_t), 8); } void vk_object_base_finish(struct vk_object_base *base) { util_sparse_array_finish(&base->private_data); +} - if (base->object_name != NULL) - vk_free(&base->device->alloc, base->object_name); +void +vk_object_base_reset(struct vk_object_base *base) +{ + vk_object_base_finish(base); + vk_object_base_reinit(base); } void * @@ -106,11 +113,12 @@ vk_object_multizalloc(struct vk_device *device, const VkAllocationCallbacks *alloc, VkObjectType obj_type) { - void *ptr = vk_multialloc_zalloc2(ma, &device->alloc, alloc, - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + void *ptr = vk_multialloc_alloc2(ma, &device->alloc, alloc, + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); if (ptr == NULL) return NULL; + memset(ptr, 0, ma->size); vk_object_base_init(device, (struct vk_object_base *)ptr, obj_type); return ptr; @@ -315,18 +323,3 @@ vk_common_GetPrivateDataEXT(VkDevice _device, objectType, objectHandle, privateDataSlot, pData); } - -const char * -vk_object_base_name(struct vk_object_base *obj) -{ - if (obj->object_name) - return obj->object_name; - - obj->object_name = vk_asprintf(&obj->device->alloc, - VK_SYSTEM_ALLOCATION_SCOPE_DEVICE, - "%s(0x%"PRIx64")", - vk_ObjectType_to_ObjectName(obj->type), - (uint64_t)(uintptr_t)obj); - - return obj->object_name; -} diff --git a/lib/mesa/src/vulkan/util/vk_object.h b/lib/mesa/src/vulkan/util/vk_object.h index 5b968d90f..c9c751ae2 100644 --- a/lib/mesa/src/vulkan/util/vk_object.h +++ b/lib/mesa/src/vulkan/util/vk_object.h @@ -44,20 +44,15 @@ struct vk_object_base { struct vk_device *device; - /* True if this object is fully constructed and visible to the client */ - bool client_visible; - /* For VK_EXT_private_data */ struct util_sparse_array private_data; - - /* VK_EXT_debug_utils */ - char *object_name; }; void vk_object_base_init(UNUSED struct vk_device *device, struct vk_object_base *base, UNUSED VkObjectType obj_type); void vk_object_base_finish(UNUSED struct vk_object_base *base); +void vk_object_base_reset(struct vk_object_base *base); static inline void vk_object_base_assert_valid(ASSERTED struct vk_object_base *base, @@ -88,8 +83,6 @@ vk_object_base_from_u64_handle(uint64_t handle, VkObjectType obj_type) __driver_type ## _to_handle(struct __driver_type *_obj) \ { \ vk_object_base_assert_valid(&_obj->__base, __VK_TYPE); \ - if (_obj != NULL) \ - _obj->__base.client_visible = true; \ return (__VkType) _obj; \ } @@ -108,8 +101,6 @@ vk_object_base_from_u64_handle(uint64_t handle, VkObjectType obj_type) __driver_type ## _to_handle(struct __driver_type *_obj) \ { \ vk_object_base_assert_valid(&_obj->__base, __VK_TYPE); \ - if (_obj != NULL) \ - _obj->__base.client_visible = true; \ return (__VkType)(uintptr_t) _obj; \ } @@ -179,9 +170,6 @@ vk_object_base_get_private_data(struct vk_device *device, VkPrivateDataSlotEXT privateDataSlot, uint64_t *pData); -const char * -vk_object_base_name(struct vk_object_base *obj); - #ifdef __cplusplus } #endif diff --git a/lib/mesa/src/vulkan/util/vk_physical_device.c b/lib/mesa/src/vulkan/util/vk_physical_device.c index e6504c88e..18cab2e87 100644 --- a/lib/mesa/src/vulkan/util/vk_physical_device.c +++ b/lib/mesa/src/vulkan/util/vk_physical_device.c @@ -139,21 +139,7 @@ vk_common_GetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, pdevice->dispatch_table.GetPhysicalDeviceMemoryProperties2(physicalDevice, &props2); - /* dEQP-VK.api.info.get_physical_device_properties2.memory_properties memsets - * the struct to 0xcd and expects that the unused array elements are - * untouched. - */ - pMemoryProperties->memoryHeapCount = props2.memoryProperties.memoryHeapCount; - for (int i = 0; i < pMemoryProperties->memoryHeapCount; i++) { - pMemoryProperties->memoryHeaps[i].flags = props2.memoryProperties.memoryHeaps[i].flags; - pMemoryProperties->memoryHeaps[i].size = props2.memoryProperties.memoryHeaps[i].size; - } - - pMemoryProperties->memoryTypeCount = props2.memoryProperties.memoryTypeCount; - for (int i = 0; i < pMemoryProperties->memoryTypeCount; i++) { - pMemoryProperties->memoryTypes[i].heapIndex = props2.memoryProperties.memoryTypes[i].heapIndex; - pMemoryProperties->memoryTypes[i].propertyFlags = props2.memoryProperties.memoryTypes[i].propertyFlags; - } + *pMemoryProperties = props2.memoryProperties; } VKAPI_ATTR void VKAPI_CALL @@ -205,50 +191,3 @@ vk_common_GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice return result; } - -VKAPI_ATTR void VKAPI_CALL -vk_common_GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, - VkFormat format, - VkImageType type, - uint32_t samples, - VkImageUsageFlags usage, - VkImageTiling tiling, - uint32_t *pNumProperties, - VkSparseImageFormatProperties *pProperties) -{ - VK_FROM_HANDLE(vk_physical_device, pdevice, physicalDevice); - - VkPhysicalDeviceSparseImageFormatInfo2 info = { - .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2, - .format = format, - .type = type, - .samples = samples, - .usage = usage, - .tiling = tiling - }; - - if (!pProperties) { - pdevice->dispatch_table.GetPhysicalDeviceSparseImageFormatProperties2(physicalDevice, - &info, - pNumProperties, - NULL); - return; - } - - STACK_ARRAY(VkSparseImageFormatProperties2, props2, *pNumProperties); - - for (unsigned i = 0; i < *pNumProperties; ++i) { - props2[i].sType = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2; - props2[i].pNext = NULL; - } - - pdevice->dispatch_table.GetPhysicalDeviceSparseImageFormatProperties2(physicalDevice, - &info, - pNumProperties, - props2); - - for (unsigned i = 0; i < *pNumProperties; ++i) - pProperties[i] = props2[i].properties; - - STACK_ARRAY_FINISH(props2); -} diff --git a/lib/mesa/src/vulkan/util/vk_physical_device.h b/lib/mesa/src/vulkan/util/vk_physical_device.h index e66d86882..fea39ae9d 100644 --- a/lib/mesa/src/vulkan/util/vk_physical_device.h +++ b/lib/mesa/src/vulkan/util/vk_physical_device.h @@ -31,8 +31,6 @@ extern "C" { #endif -struct wsi_device; - struct vk_physical_device { struct vk_object_base base; struct vk_instance *instance; @@ -40,8 +38,6 @@ struct vk_physical_device { struct vk_device_extension_table supported_extensions; struct vk_physical_device_dispatch_table dispatch_table; - - struct wsi_device *wsi_device; }; VK_DEFINE_HANDLE_CASTS(vk_physical_device, base, VkPhysicalDevice, @@ -56,10 +52,6 @@ vk_physical_device_init(struct vk_physical_device *physical_device, void vk_physical_device_finish(struct vk_physical_device *physical_device); -VkResult -vk_physical_device_check_device_features(struct vk_physical_device *physical_device, - const VkDeviceCreateInfo *pCreateInfo); - #ifdef __cplusplus } #endif diff --git a/lib/mesa/src/vulkan/util/vk_shader_module.h b/lib/mesa/src/vulkan/util/vk_shader_module.h index 8140a49d0..d4e64dfc3 100644 --- a/lib/mesa/src/vulkan/util/vk_shader_module.h +++ b/lib/mesa/src/vulkan/util/vk_shader_module.h @@ -46,7 +46,7 @@ VK_DEFINE_NONDISP_HANDLE_CASTS(vk_shader_module, base, VkShaderModule, /* this should only be used for stack-allocated, temporary objects */ #define vk_shader_module_handle_from_nir(_nir) \ - ((VkShaderModule)(uintptr_t)&(struct vk_shader_module) { \ + vk_shader_module_to_handle(&(struct vk_shader_module) { \ .base.type = VK_OBJECT_TYPE_SHADER_MODULE, \ .nir = _nir, \ }) |