From: Bas Nieuwenhuizen Date: Tue, 26 Nov 2019 00:00:20 +0000 (+0100) Subject: radv: Enable VK_KHR_buffer_device_address. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02375b84364186681b86e957aa339284405f1e0f;p=mesa.git radv: Enable VK_KHR_buffer_device_address. Still no capture/replay or multi device support. Reviewed-by: Samuel Pitoiset --- diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index a7997cf9c20..71b529c07a5 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1058,6 +1058,14 @@ void radv_GetPhysicalDeviceFeatures2( features->bufferDeviceAddressMultiDevice = false; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR: { + VkPhysicalDeviceBufferDeviceAddressFeaturesKHR *features = + (VkPhysicalDeviceBufferDeviceAddressFeaturesKHR *)ext; + features->bufferDeviceAddress = true; + features->bufferDeviceAddressCaptureReplay = false; + features->bufferDeviceAddressMultiDevice = false; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: { VkPhysicalDeviceDepthClipEnableFeaturesEXT *features = (VkPhysicalDeviceDepthClipEnableFeaturesEXT *)ext; @@ -2687,7 +2695,8 @@ VkResult radv_CreateDevice( device->use_global_bo_list = (device->instance->perftest_flags & RADV_PERFTEST_BO_LIST) || device->enabled_extensions.EXT_descriptor_indexing || - device->enabled_extensions.EXT_buffer_device_address; + device->enabled_extensions.EXT_buffer_device_address || + device->enabled_extensions.KHR_buffer_device_address; device->robust_buffer_access = pCreateInfo->pEnabledFeatures && pCreateInfo->pEnabledFeatures->robustBufferAccess; @@ -5934,15 +5943,27 @@ void radv_DestroyBuffer( vk_free2(&device->alloc, pAllocator, buffer); } -VkDeviceAddress radv_GetBufferDeviceAddressEXT( +VkDeviceAddress radv_GetBufferDeviceAddressKHR( VkDevice device, - const VkBufferDeviceAddressInfoEXT* pInfo) + const VkBufferDeviceAddressInfoKHR* pInfo) { RADV_FROM_HANDLE(radv_buffer, buffer, pInfo->buffer); return radv_buffer_get_va(buffer->bo) + buffer->offset; } +uint64_t radv_GetBufferOpaqueCaptureAddressKHR(VkDevice device, + const VkBufferDeviceAddressInfoKHR* pInfo) +{ + return 0; +} + +uint64_t radv_GetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, + const VkDeviceMemoryOpaqueCaptureAddressInfoKHR* pInfo) +{ + return 0; +} + static inline unsigned si_tile_mode_index(const struct radv_image_plane *plane, unsigned level, bool stencil) { diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py index 265383f1456..55d9ee9f817 100644 --- a/src/amd/vulkan/radv_extensions.py +++ b/src/amd/vulkan/radv_extensions.py @@ -54,6 +54,7 @@ EXTENSIONS = [ Extension('VK_ANDROID_native_buffer', 5, 'ANDROID && device->rad_info.has_syncobj_wait_for_submit'), Extension('VK_KHR_16bit_storage', 1, '!device->use_aco'), Extension('VK_KHR_bind_memory2', 1, True), + Extension('VK_KHR_buffer_device_address', 1, True), Extension('VK_KHR_create_renderpass2', 1, True), Extension('VK_KHR_dedicated_allocation', 1, True), Extension('VK_KHR_depth_stencil_resolve', 1, True),