From 0632161956fc69108be38d052d0d76cae94fe19c Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sat, 21 Feb 2026 06:43:29 -0800 Subject: [PATCH] freedreno/a6xx: Hide 10_10_10_2 for opencl The alpha channel seems to be internally returned as f16 (up-converted to f32 is that is the dest type of the sam instruction). This expresses 1/3 and 2/3 with less precision than cl cts expects (f32). This may be a test bug. But the format is not required. Signed-off-by: Rob Clark Part-of: --- .../drivers/freedreno/a6xx/fd6_screen.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_screen.cc b/src/gallium/drivers/freedreno/a6xx/fd6_screen.cc index 7e2362a7423..b11655aa9cb 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_screen.cc +++ b/src/gallium/drivers/freedreno/a6xx/fd6_screen.cc @@ -41,6 +41,18 @@ valid_sample_count(unsigned sample_count, bool is_suboptimal) } } +static bool +is_cl_supported(const struct fd_dev_info *info, enum pipe_format format) +{ + if (info->chip >= A8XX) { + unsigned b = util_format_get_component_bits( + format, UTIL_FORMAT_COLORSPACE_RGB, PIPE_SWIZZLE_W); + if (b == 2) + return false; + } + return true; +} + static bool fd6_screen_is_format_supported(struct pipe_screen *pscreen, enum pipe_format format, @@ -54,7 +66,12 @@ fd6_screen_is_format_supported(struct pipe_screen *pscreen, unsigned retval = 0; usage &= ~PIPE_BIND_SAMPLER_VIEW_SUBOPTIMAL; - usage &= ~PIPE_BIND_OPENCL; + + if (usage & PIPE_BIND_OPENCL) { + if (!is_cl_supported(screen->info, format)) + return false; + usage &= ~PIPE_BIND_OPENCL; + } if ((target >= PIPE_MAX_TEXTURE_TYPES) || !valid_sample_count(sample_count, is_suboptimal)) {