nir: remove nir_state_slot::swizzle
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 21 Apr 2023 07:39:18 +0000 (09:39 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 26 Apr 2023 05:51:39 +0000 (05:51 +0000)
This is only ever written to, never read from. Let's just get rid of it!

This also saves us a few needless includes.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22620>

src/compiler/glsl/glsl_to_nir.cpp
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_patch_vertices.c
src/compiler/nir/nir_lower_pntc_ytransform.c
src/compiler/nir/nir_lower_point_size_mov.c
src/compiler/nir/nir_lower_wpos_ytransform.c

index 1cc3477..00b6afa 100644 (file)
@@ -707,7 +707,6 @@ nir_visitor::visit(ir_variable *ir)
       for (unsigned i = 0; i < var->num_state_slots; i++) {
          for (unsigned j = 0; j < 4; j++)
             var->state_slots[i].tokens[j] = state_slots[i].tokens[j];
-         var->state_slots[i].swizzle = state_slots[i].swizzle;
       }
    } else {
       var->state_slots = NULL;
index 753b882..02f94e0 100644 (file)
@@ -171,7 +171,6 @@ struct nir_xfb_info;
  */
 typedef struct {
    gl_state_index16 tokens[STATE_LENGTH];
-   uint16_t swizzle;
 } nir_state_slot;
 
 typedef enum {
index 3f6ccfb..476f1b0 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 #include "nir_builder.h"
-#include "program/prog_instruction.h"
 
 static nir_variable *
 make_uniform(nir_shader *nir, const gl_state_index16 *tokens)
@@ -36,7 +35,6 @@ make_uniform(nir_shader *nir, const gl_state_index16 *tokens)
    var->num_state_slots = 1;
    var->state_slots = ralloc_array(var, nir_state_slot, var->num_state_slots);
    memcpy(var->state_slots[0].tokens, tokens, sizeof(*tokens) * STATE_LENGTH);
-   var->state_slots[0].swizzle = SWIZZLE_XXXX;
 
    return var;
 }
index e7b12b4..18f0f32 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "nir.h"
 #include "nir_builder.h"
-#include "program/prog_instruction.h"
 
 /* Lower gl_PointCoord to account for user requested point-coord origin
  * and for whether draw buffer is flipped.
@@ -50,7 +49,6 @@ get_pntc_transform(lower_pntc_ytransform_state *state)
 
       var->num_state_slots = 1;
       var->state_slots = ralloc_array(var, nir_state_slot, 1);
-      var->state_slots[0].swizzle = SWIZZLE_XYZW;
       memcpy(var->state_slots[0].tokens, state->pntc_state_tokens,
              sizeof(var->state_slots[0].tokens));
       var->data.how_declared = nir_var_hidden;
index beedf33..6c1c16c 100644 (file)
@@ -46,7 +46,6 @@ lower_impl(nir_function_impl *impl,
                             glsl_vec4_type(), "gl_PointSizeClampedMESA");
    in->num_state_slots = 1;
    in->state_slots = ralloc_array(in, nir_state_slot, 1);
-   in->state_slots[0].swizzle = BITFIELD_MASK(4);
    memcpy(in->state_slots[0].tokens,
          pointsize_state_tokens,
          sizeof(in->state_slots[0].tokens));
index 63c9a0b..3e70b1d 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "nir.h"
 #include "nir_builder.h"
-#include "program/prog_instruction.h"
 
 /* Lower gl_FragCoord (and fddy) to account for driver's requested coordinate-
  * origin and pixel-center vs. shader.  If transformation is required, a
@@ -56,7 +55,6 @@ get_transform(lower_wpos_ytransform_state *state)
 
       var->num_state_slots = 1;
       var->state_slots = ralloc_array(var, nir_state_slot, 1);
-      var->state_slots[0].swizzle = SWIZZLE_XYZW;
       memcpy(var->state_slots[0].tokens, state->options->state_tokens,
              sizeof(var->state_slots[0].tokens));
       var->data.how_declared = nir_var_hidden;