From 4953d2a014d5511473bd3891d564c039a1b78210 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 11 Mar 2025 15:52:45 -0400 Subject: [PATCH] glsl: Use FALLTHROUGH Reported by clang's `-Wimplicit-fallthrough`. Reviewed-by: Caio Oliveira Part-of: --- src/compiler/glsl/ir.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp index da0e3fc2cfb..f9c779d2cd6 100644 --- a/src/compiler/glsl/ir.cpp +++ b/src/compiler/glsl/ir.cpp @@ -22,6 +22,7 @@ */ #include #include "ir.h" +#include "util/compiler.h" #include "util/half_float.h" #include "util/bitscan.h" #include "compiler/glsl_types.h" @@ -1793,18 +1794,21 @@ ir_swizzle::init_mask(const unsigned *comp, unsigned count) dup_mask |= (1U << comp[3]) & ((1U << comp[0]) | (1U << comp[1]) | (1U << comp[2])); this->mask.w = comp[3]; + FALLTHROUGH; case 3: assert(comp[2] <= 3); dup_mask |= (1U << comp[2]) & ((1U << comp[0]) | (1U << comp[1])); this->mask.z = comp[2]; + FALLTHROUGH; case 2: assert(comp[1] <= 3); dup_mask |= (1U << comp[1]) & ((1U << comp[0])); this->mask.y = comp[1]; + FALLTHROUGH; case 1: assert(comp[0] <= 3);