v3dv: expose VK_KHR_multiview
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 20 Jul 2021 09:32:17 +0000 (11:32 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 27 Jul 2021 07:31:32 +0000 (07:31 +0000)
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12034>

src/broadcom/vulkan/v3dv_device.c
src/broadcom/vulkan/v3dv_pipeline.c

index 0b278ce..524d1dd 100644 (file)
@@ -129,6 +129,7 @@ get_device_extensions(const struct v3dv_physical_device *device,
       .KHR_maintenance1                    = true,
       .KHR_maintenance2                    = true,
       .KHR_maintenance3                    = true,
+      .KHR_multiview                       = true,
       .KHR_shader_non_semantic_info        = true,
       .KHR_sampler_mirror_clamp_to_edge    = true,
       .KHR_storage_buffer_storage_class    = true,
@@ -1057,7 +1058,7 @@ v3dv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
       .uniformAndStorageBuffer16BitAccess = false,
       .storagePushConstant16 = false,
       .storageInputOutput16 = false,
-      .multiview = false,
+      .multiview = true,
       .multiviewGeometryShader = false,
       .multiviewTessellationShader = false,
       .variablePointersStorageBuffer = true,
@@ -1435,10 +1436,8 @@ v3dv_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
       case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: {
          VkPhysicalDeviceMultiviewProperties *props =
             (VkPhysicalDeviceMultiviewProperties *)ext;
-         props->maxMultiviewViewCount = 1;
-         /* This assumes that the multiview implementation uses instancing */
-         props->maxMultiviewInstanceIndex =
-            (UINT32_MAX / props->maxMultiviewViewCount) - 1;
+         props->maxMultiviewViewCount = MAX_MULTIVIEW_VIEW_COUNT;
+         props->maxMultiviewInstanceIndex = UINT32_MAX - 1;
          break;
       }
       case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT:
index 370a4f9..d4e6731 100644 (file)
@@ -180,8 +180,9 @@ v3dv_DestroyPipeline(VkDevice _device,
 static const struct spirv_to_nir_options default_spirv_options =  {
    .caps = {
       .device_group = true,
-      .variable_pointers = true,
+      .multiview = true,
       .subgroup_basic = true,
+      .variable_pointers = true,
     },
    .ubo_addr_format = nir_address_format_32bit_index_offset,
    .ssbo_addr_format = nir_address_format_32bit_index_offset,