[Mesa-dev] [PATCH 2/6] nir: Delete nir_shader::user_structures and num_user_structures.

Kenneth Graunke kenneth at whitecape.org
Fri Mar 6 02:17:52 PST 2015


Nothing actually uses these, and the only caller of glsl_to_nir()
(brw_fs_nir.cpp) always passes NULL for the _mesa_glsl_parse_state
pointer, meaning they'll always be NULL and 0, respectively.

Just delete them.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/glsl/nir/glsl_to_nir.cpp | 11 -----------
 src/glsl/nir/nir.c           |  3 ---
 src/glsl/nir/nir.h           |  4 ----
 src/glsl/nir/nir_print.c     |  4 ----
 4 files changed, 22 deletions(-)

diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
index adef19c..b82e5c7 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -154,17 +154,6 @@ glsl_to_nir(exec_list *ir, _mesa_glsl_parse_state *state,
 
    nir_shader *shader = nir_shader_create(NULL, options);
 
-   if (state) {
-      shader->num_user_structures = state->num_user_structures;
-      shader->user_structures = ralloc_array(shader, glsl_type *,
-                                             shader->num_user_structures);
-      memcpy(shader->user_structures, state->user_structures,
-            shader->num_user_structures * sizeof(glsl_type *));
-   } else {
-      shader->num_user_structures = 0;
-      shader->user_structures = NULL;
-   }
-
    nir_visitor v1(shader, native_integers);
    nir_function_visitor v2(&v1);
    v2.run(ir);
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
index ab57fd4..abad3f8 100644
--- a/src/glsl/nir/nir.c
+++ b/src/glsl/nir/nir.c
@@ -42,9 +42,6 @@ nir_shader_create(void *mem_ctx, const nir_shader_compiler_options *options)
 
    shader->options = options;
 
-   shader->num_user_structures = 0;
-   shader->user_structures = NULL;
-
    exec_list_make_empty(&shader->functions);
    exec_list_make_empty(&shader->registers);
    exec_list_make_empty(&shader->globals);
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index d5df596..b935354 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -1400,10 +1400,6 @@ typedef struct nir_shader {
    /** list of global register in the shader */
    struct exec_list registers;
 
-   /** structures used in this shader */
-   unsigned num_user_structures;
-   struct glsl_type **user_structures;
-
    /** next available global register index */
    unsigned reg_alloc;
 
diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c
index 30d4821..f8b14a1 100644
--- a/src/glsl/nir/nir_print.c
+++ b/src/glsl/nir/nir_print.c
@@ -844,10 +844,6 @@ nir_print_shader(nir_shader *shader, FILE *fp)
    print_var_state state;
    init_print_state(&state);
 
-   for (unsigned i = 0; i < shader->num_user_structures; i++) {
-      glsl_print_struct(shader->user_structures[i], fp);
-   }
-
    struct hash_entry *entry;
 
    hash_table_foreach(shader->uniforms, entry) {
-- 
2.2.1



More information about the mesa-dev mailing list