radv: Enable VK_KHR_buffer_device_address.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 26 Nov 2019 00:00:20 +0000 (01:00 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 26 Nov 2019 11:59:52 +0000 (11:59 +0000)
Still no capture/replay or multi device support.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_extensions.py

index a7997cf9c209c3ba8dc3dfb6245eedf6c38aa83f..71b529c07a56a19fe9a936109f97d2434c4acdef 100644 (file)
@@ -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)
 {
index 265383f14567c060b604c76dcda8a0c9e14621e4..55d9ee9f8176f1248a1ffb7d682af5d0043919ff 100644 (file)
@@ -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),