v3dv: enable KHR_uniform_buffer_standard_layout
authorCharlie <charlie@daft.games>
Wed, 9 Jun 2021 19:20:34 +0000 (20:20 +0100)
committerCharlie Birks <charlie@daft.games>
Thu, 10 Jun 2021 14:04:23 +0000 (15:04 +0100)
We already support this memory layout. All relevant CTS tests seem to
pass

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11276>

docs/features.txt
src/broadcom/vulkan/v3dv_device.c

index e7e764d..f0fdd5b 100644 (file)
@@ -463,7 +463,7 @@ Vulkan 1.2 -- all DONE: anv, vn
   VK_KHR_shader_subgroup_extended_types                 DONE (anv/gen8+, radv, vn)
   VK_KHR_spirv_1_4                                      DONE (anv, radv, tu, vn)
   VK_KHR_timeline_semaphore                             DONE (anv, radv, tu, vn)
-  VK_KHR_uniform_buffer_standard_layout                 DONE (anv, lvp, radv, vn)
+  VK_KHR_uniform_buffer_standard_layout                 DONE (anv, lvp, radv, v3dv, vn)
   VK_KHR_vulkan_memory_model                            DONE (anv, radv, tu, vn)
   VK_EXT_descriptor_indexing                            DONE (anv/gen9+, radv, tu, vn)
   VK_EXT_host_query_reset                               DONE (anv, lvp, radv, tu, vn)
index b6ad487..2747111 100644 (file)
@@ -125,6 +125,7 @@ get_device_extensions(const struct v3dv_physical_device *device,
       .KHR_maintenance3                    = true,
       .KHR_sampler_mirror_clamp_to_edge    = true,
       .KHR_storage_buffer_storage_class    = true,
+      .KHR_uniform_buffer_standard_layout  = true,
 #ifdef V3DV_HAS_SURFACE
       .KHR_swapchain                       = true,
       .KHR_incremental_present             = true,
@@ -1011,6 +1012,13 @@ v3dv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
 
    vk_foreach_struct(ext, pFeatures->pNext) {
       switch (ext->sType) {
+      case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR: {
+         VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR *features =
+            (VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR *)ext;
+         features->uniformBufferStandardLayout = true;
+         break;
+      }
+
       case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: {
          VkPhysicalDevicePrivateDataFeaturesEXT *features =
             (VkPhysicalDevicePrivateDataFeaturesEXT *)ext;