From 74fe2c805f9c6e13201afc0785f0c02161873fc8 Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Tue, 12 Jul 2022 14:51:14 +0200 Subject: [PATCH] util: Remove format desc null check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Konstantin Seurer Reviewed-by: Alyssa Rosenzweig Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/util/u_sampler.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/gallium/auxiliary/util/u_sampler.c b/src/gallium/auxiliary/util/u_sampler.c index 2c823d45609..7c81017f535 100644 --- a/src/gallium/auxiliary/util/u_sampler.c +++ b/src/gallium/auxiliary/util/u_sampler.c @@ -73,14 +73,11 @@ default_template(struct pipe_sampler_view *view, if (format != PIPE_FORMAT_A8_UNORM) { const struct util_format_description *desc = util_format_description(format); - assert(desc); - if (desc) { - if (desc->swizzle[1] == PIPE_SWIZZLE_0) { - view->swizzle_g = expand_green_blue; - } - if (desc->swizzle[2] == PIPE_SWIZZLE_0) { - view->swizzle_b = expand_green_blue; - } + if (desc->swizzle[1] == PIPE_SWIZZLE_0) { + view->swizzle_g = expand_green_blue; + } + if (desc->swizzle[2] == PIPE_SWIZZLE_0) { + view->swizzle_b = expand_green_blue; } } }