radv: Expose VK_KHX_multiview.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 16 Aug 2017 07:20:53 +0000 (09:20 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 24 Aug 2017 17:20:47 +0000 (19:20 +0200)
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_pipeline.c

index 1a7831e89c9c73ab27ba53c140804aca0402b6ae..fec965c622588fb35a9cecebbd65f45e5c652bb0 100644 (file)
@@ -178,6 +178,10 @@ static const VkExtensionProperties ext_sema_device_extensions[] = {
                .extensionName = VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME,
                .specVersion = 1,
        },
+       {
+               .extensionName = VK_KHX_MULTIVIEW_EXTENSION_NAME,
+               .specVersion = 1,
+       },
 };
 
 static VkResult
@@ -628,6 +632,13 @@ void radv_GetPhysicalDeviceFeatures2KHR(
                        features->variablePointers = false;
                        break;
                }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX: {
+                       VkPhysicalDeviceMultiviewFeaturesKHX *features = (VkPhysicalDeviceMultiviewFeaturesKHX*)ext;
+                       features->multiview = true;
+                       features->multiviewGeometryShader = true;
+                       features->multiviewTessellationShader = true;
+                       break;
+               }
                default:
                        break;
                }
@@ -804,6 +815,12 @@ void radv_GetPhysicalDeviceProperties2KHR(
                        properties->deviceLUIDValid = false;
                        break;
                }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHX: {
+                       VkPhysicalDeviceMultiviewPropertiesKHX *properties = (VkPhysicalDeviceMultiviewPropertiesKHX*)ext;
+                       properties->maxMultiviewViewCount = MAX_VIEWS;
+                       properties->maxMultiviewInstanceIndex = INT_MAX;
+                       break;
+               }
                default:
                        break;
                }
index 31bdc8c46437cd48ae9dee1823053f84794d63c5..637fed625f1598a829d5d190b01583eeed5595ec 100644 (file)
@@ -230,6 +230,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
                        .image_write_without_format = true,
                        .tessellation = true,
                        .int64 = true,
+                       .multiview = true,
                        .variable_pointers = true,
                };
                entry_point = spirv_to_nir(spirv, module->size / 4,