From 3b010a9e6036ab7110fe3f48462300afbd0d1c25 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 10 Dec 2024 17:21:56 +0100 Subject: [PATCH] radv: disable alphaToOne except for Zink It's just completely broken if alpha-to-coverage is also used. Given this is a requirement for Zink and no known GL apps are affected, let's disable for everything except Zink. This is going to be fixed but the fixes aren't small enough for backporting. This fixes a rendering issue with XPlane 12. Cc: mesa-stable Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_physical_device.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index f874ffe4235..c2f2b57818a 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -786,6 +786,7 @@ radv_physical_device_get_features(const struct radv_physical_device *pdev, struc bool has_shader_image_float_minmax = pdev->info.gfx_level != GFX8 && pdev->info.gfx_level != GFX9 && pdev->info.gfx_level != GFX11 && pdev->info.gfx_level != GFX11_5; bool has_fragment_shader_interlock = radv_has_pops(pdev); + const bool is_zink = instance->vk.app_info.engine_name && !strcmp(instance->vk.app_info.engine_name, "mesa zink"); *features = (struct vk_features){ /* Vulkan 1.0 */ @@ -806,7 +807,11 @@ radv_physical_device_get_features(const struct radv_physical_device *pdev, struc .depthBounds = true, .wideLines = true, .largePoints = true, - .alphaToOne = true, + /* FIXME: alpha-to-one is performed before alpha-to-coverage but it should be after. + * This is currently broken on RADV and the fixes aren't trivial to backport. Let's disable it + * for everything except Zink because it's a requirement and no application seems affected. + */ + .alphaToOne = is_zink, .multiViewport = true, .samplerAnisotropy = true, .textureCompressionETC2 = pdev->info.has_etc_support || pdev->emulate_etc2, @@ -1190,7 +1195,7 @@ radv_physical_device_get_features(const struct radv_physical_device *pdev, struc .extendedDynamicState3SampleLocationsEnable = pdev->info.gfx_level < GFX10, .extendedDynamicState3LineRasterizationMode = true, .extendedDynamicState3ExtraPrimitiveOverestimationSize = false, - .extendedDynamicState3AlphaToOneEnable = !pdev->use_llvm, + .extendedDynamicState3AlphaToOneEnable = is_zink && !pdev->use_llvm, .extendedDynamicState3RasterizationStream = false, .extendedDynamicState3ColorBlendAdvanced = false, .extendedDynamicState3ViewportWScalingEnable = false,