Mesa (master): intel: silence unused var warnings in release builds

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 25 09:11:22 UTC 2021


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

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Sun Jan 24 17:03:40 2021 +0200

intel: silence unused var warnings in release builds

v2: Use ASSERTED

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4162
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8681>

---

 src/intel/compiler/brw_fs.cpp      | 2 +-
 src/intel/vulkan/anv_image.c       | 2 +-
 src/intel/vulkan/genX_cmd_buffer.c | 2 +-
 src/intel/vulkan/genX_pipeline.c   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index f9f24d27884..e5691e35923 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -5488,7 +5488,7 @@ static void
 setup_surface_descriptors(const fs_builder &bld, fs_inst *inst, uint32_t desc,
                           const fs_reg &surface, const fs_reg &surface_handle)
 {
-   const gen_device_info *devinfo = bld.shader->devinfo;
+   const ASSERTED gen_device_info *devinfo = bld.shader->devinfo;
 
    /* We must have exactly one of surface and surface_handle */
    assert((surface.file == BAD_FILE) != (surface_handle.file == BAD_FILE));
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 21c5d5c3eef..cd46d68e106 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -553,7 +553,7 @@ add_shadow_surface(struct anv_device *device,
                    uint32_t stride,
                    VkImageUsageFlags vk_plane_usage)
 {
-   bool ok;
+   ASSERTED bool ok;
 
    ok = isl_surf_init(&device->isl_dev,
                       &image->planes[plane].shadow_surface.isl,
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 285169eeb78..42159ad6330 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -3221,7 +3221,7 @@ cmd_buffer_emit_push_constant_all(struct anv_cmd_buffer *cmd_buffer,
    const struct anv_cmd_graphics_state *gfx_state = &cmd_buffer->state.gfx;
    const struct anv_graphics_pipeline *pipeline = gfx_state->pipeline;
 
-   static const uint32_t push_constant_opcodes[] = {
+   static const UNUSED uint32_t push_constant_opcodes[] = {
       [MESA_SHADER_VERTEX]                      = 21,
       [MESA_SHADER_TESS_CTRL]                   = 25, /* HS */
       [MESA_SHADER_TESS_EVAL]                   = 26, /* DS */
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c
index 404d80ae225..ed34ff469f0 100644
--- a/src/intel/vulkan/genX_pipeline.c
+++ b/src/intel/vulkan/genX_pipeline.c
@@ -2354,7 +2354,7 @@ emit_compute_state(struct anv_compute_pipeline *pipeline,
 
    const uint32_t subslices = MAX2(device->physical->subslice_total, 1);
 
-   const struct anv_shader_bin *cs_bin = pipeline->cs;
+   const UNUSED struct anv_shader_bin *cs_bin = pipeline->cs;
    const struct gen_device_info *devinfo = &device->info;
 
    anv_batch_emit(&pipeline->base.batch, GENX(CFE_STATE), cfe) {



More information about the mesa-commit mailing list