Mesa (master): d3d12: Fix implicit fallthrough warnings

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Jan 3 23:24:44 UTC 2021


Module: Mesa
Branch: master
Commit: 1fb192d5b248cd887745590596158afdafade1f6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1fb192d5b248cd887745590596158afdafade1f6

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Mon Dec 28 10:48:54 2020 -0800

d3d12: Fix implicit fallthrough warnings

Changes comments to use FALLTHROUGH macro, to silence warnings
from both GCC and clang.

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8248>

---

 src/gallium/drivers/d3d12/d3d12_compiler.cpp       | 6 +++---
 src/gallium/drivers/d3d12/d3d12_format.c           | 3 ++-
 src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/d3d12/d3d12_compiler.cpp b/src/gallium/drivers/d3d12/d3d12_compiler.cpp
index b6f903f04e3..208ddfc7d59 100644
--- a/src/gallium/drivers/d3d12/d3d12_compiler.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_compiler.cpp
@@ -915,7 +915,7 @@ get_prev_shader(struct d3d12_context *ctx, pipe_shader_type current)
    case PIPE_SHADER_FRAGMENT:
       if (ctx->gfx_stages[PIPE_SHADER_GEOMETRY])
          return ctx->gfx_stages[PIPE_SHADER_GEOMETRY];
-      /* fallthrough */
+      FALLTHROUGH;
    case PIPE_SHADER_GEOMETRY:
       return ctx->gfx_stages[PIPE_SHADER_VERTEX];
    default:
@@ -932,7 +932,7 @@ get_next_shader(struct d3d12_context *ctx, pipe_shader_type current)
    case PIPE_SHADER_VERTEX:
       if (ctx->gfx_stages[PIPE_SHADER_GEOMETRY])
          return ctx->gfx_stages[PIPE_SHADER_GEOMETRY];
-      /* fallthrough */
+      FALLTHROUGH;
    case PIPE_SHADER_GEOMETRY:
       return ctx->gfx_stages[PIPE_SHADER_FRAGMENT];
    case PIPE_SHADER_FRAGMENT:
@@ -963,7 +963,7 @@ scan_texture_use(nir_shader *nir)
                case nir_texop_txd:
                   if (tex->is_shadow)
                      result |= TEX_CMP_WITH_LOD_BIAS_GRAD;
-                  /* fallthrough */
+                  FALLTHROUGH;
                case nir_texop_tex:
                   if (tex->dest_type & (nir_type_int | nir_type_uint))
                      result |= TEX_SAMPLE_INTEGER_TEXTURE;
diff --git a/src/gallium/drivers/d3d12/d3d12_format.c b/src/gallium/drivers/d3d12/d3d12_format.c
index 89a617a6dd7..209d82d0f1d 100644
--- a/src/gallium/drivers/d3d12/d3d12_format.c
+++ b/src/gallium/drivers/d3d12/d3d12_format.c
@@ -26,6 +26,7 @@
 #include "pipe/p_format.h"
 #include "util/format/u_format.h"
 #include "util/u_math.h"
+#include "util/compiler.h"
 
 static const DXGI_FORMAT formats[PIPE_FORMAT_COUNT] = {
 #define MAP_FORMAT_NORM(FMT) \
@@ -180,7 +181,7 @@ d3d12_get_resource_srv_format(enum pipe_format f, enum pipe_texture_target targe
    case PIPE_FORMAT_A8_UNORM:
       if (target == PIPE_BUFFER)
          return DXGI_FORMAT_R8_UNORM; /* A8_UNORM is not supported for buffer SRV */
-      /* passthrough */
+      FALLTHROUGH;
    default:
       return d3d12_get_format(f);
    }
diff --git a/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp b/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp
index 3d9e7aa6a74..6743f618a7c 100644
--- a/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp
@@ -64,7 +64,7 @@ get_semantic_name(int slot, unsigned *index)
 
    case VARYING_SLOT_CLIP_DIST1:
       *index = 1;
-      /* fallthrough */
+      FALLTHROUGH;
    case VARYING_SLOT_CLIP_DIST0:
       return "SV_ClipDistance";
 



More information about the mesa-commit mailing list