diff --git a/src/freedreno/common/freedreno_dev_info.h b/src/freedreno/common/freedreno_dev_info.h index 820a50382da..f05c130ae49 100644 --- a/src/freedreno/common/freedreno_dev_info.h +++ b/src/freedreno/common/freedreno_dev_info.h @@ -70,6 +70,8 @@ struct fd_dev_info { */ uint32_t instr_cache_size; + bool has_hw_multiview; + /* Whether the PC_MULTIVIEW_MASK register exists. */ bool supports_multiview_mask; diff --git a/src/freedreno/common/freedreno_devices.py b/src/freedreno/common/freedreno_devices.py index b63e9c38231..cfe91086564 100644 --- a/src/freedreno/common/freedreno_devices.py +++ b/src/freedreno/common/freedreno_devices.py @@ -152,6 +152,7 @@ class A6xxGPUInfo(GPUInfo): self.a6xx.has_8bpp_ubwc = True self.a6xx.has_gmem_fast_clear = True + self.a6xx.has_hw_multiview = True self.a6xx.sysmem_per_ccu_cache_size = 64 * 1024 self.a6xx.gmem_ccu_color_cache_fraction = CCUColorCacheFraction.QUARTER.value @@ -246,6 +247,7 @@ a6xx_gen1 = dict( # a605, a608, a610, 612 a6xx_gen1_low = {**a6xx_gen1, **dict( has_gmem_fast_clear = False, + has_hw_multiview = False, sysmem_per_ccu_cache_size = 8 * 1024, gmem_ccu_color_cache_fraction = CCUColorCacheFraction.HALF.value, vs_max_inputs_count = 16, diff --git a/src/freedreno/vulkan/tu_device.cc b/src/freedreno/vulkan/tu_device.cc index d7522686d86..0022f5ec6b0 100644 --- a/src/freedreno/vulkan/tu_device.cc +++ b/src/freedreno/vulkan/tu_device.cc @@ -161,7 +161,7 @@ get_device_extensions(const struct tu_physical_device *device, .KHR_maintenance2 = true, .KHR_maintenance3 = true, .KHR_maintenance4 = true, - .KHR_multiview = true, + .KHR_multiview = device->info->a6xx.has_hw_multiview, .KHR_performance_query = TU_DEBUG(PERFC), .KHR_pipeline_executable_properties = true, .KHR_pipeline_library = true, @@ -258,7 +258,7 @@ get_device_extensions(const struct tu_physical_device *device, .EXT_shader_demote_to_helper_invocation = true, .EXT_shader_module_identifier = true, .EXT_shader_stencil_export = true, - .EXT_shader_viewport_index_layer = true, + .EXT_shader_viewport_index_layer = device->info->a6xx.has_hw_multiview, .EXT_subgroup_size_control = true, .EXT_texel_buffer_alignment = true, .EXT_tooling_info = true, @@ -302,7 +302,7 @@ tu_get_features(struct tu_physical_device *pdevice, features->wideLines = false; features->largePoints = true; features->alphaToOne = true; - features->multiViewport = true; + features->multiViewport = pdevice->info->a6xx.has_hw_multiview; features->samplerAnisotropy = true; features->textureCompressionETC2 = true; features->textureCompressionASTC_LDR = true; @@ -335,7 +335,7 @@ tu_get_features(struct tu_physical_device *pdevice, features->uniformAndStorageBuffer16BitAccess = false; features->storagePushConstant16 = false; features->storageInputOutput16 = false; - features->multiview = true; + features->multiview = pdevice->info->a6xx.has_hw_multiview; features->multiviewGeometryShader = false; features->multiviewTessellationShader = false; features->variablePointersStorageBuffer = true; @@ -869,7 +869,8 @@ tu_get_physical_device_properties_1_1(struct tu_physical_device *pdevice, p->subgroupQuadOperationsInAllStages = false; p->pointClippingBehavior = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES; - p->maxMultiviewViewCount = MAX_VIEWS; + p->maxMultiviewViewCount = + pdevice->info->a6xx.has_hw_multiview ? MAX_VIEWPORTS : 1; p->maxMultiviewInstanceIndex = INT_MAX; p->protectedNoFault = false; /* Our largest descriptors are 2 texture descriptors, or a texture and @@ -1103,7 +1104,7 @@ tu_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, .maxDrawIndirectCount = UINT32_MAX, .maxSamplerLodBias = 4095.0 / 256.0, /* [-16, 15.99609375] */ .maxSamplerAnisotropy = 16, - .maxViewports = MAX_VIEWPORTS, + .maxViewports = pdevice->info->a6xx.has_hw_multiview ? MAX_VIEWPORTS : 1, .maxViewportDimensions = { MAX_VIEWPORT_SIZE, MAX_VIEWPORT_SIZE }, .viewportBoundsRange = { INT16_MIN, INT16_MAX }, .viewportSubPixelBits = 8,