From 746ba9f2d2156cc143edd12b84b9c91d8a08876c Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 7 Jan 2025 10:17:02 +0100 Subject: [PATCH] gallium/vl: Fix sampler view components for Y8_400 format Copy sampler view for last component to remaining components. Fixes sampling from Y8_400 luma-only format. Fixes: 8a20e634ce5 ("gallium/vl: Add plane order for Y8_400 format") Reviewed-by: Thong Thai Part-of: --- src/gallium/auxiliary/vl/vl_video_buffer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c index 55057475b49..f2e086fdfaf 100644 --- a/src/gallium/auxiliary/vl/vl_video_buffer.c +++ b/src/gallium/auxiliary/vl/vl_video_buffer.c @@ -328,6 +328,11 @@ vl_video_buffer_sampler_view_components(struct pipe_video_buffer *buffer) } } + assert(component != 0); + + for (i = component; i < VL_NUM_COMPONENTS; ++i) + pipe_sampler_view_reference(&buf->sampler_view_components[i], buf->sampler_view_components[component - 1]); + return buf->sampler_view_components; error: