mesa: remove initialized field from uniform storage
authorTimothy Arceri <timothy.arceri@collabora.com>
Sun, 27 Mar 2016 03:51:02 +0000 (14:51 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Mon, 28 Mar 2016 22:59:03 +0000 (09:59 +1100)
The only place this was used was in a gallium debug function that
had to be manually enabled.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/compiler/glsl/ir_uniform.h
src/compiler/glsl/link_uniform_initializers.cpp
src/compiler/glsl/link_uniforms.cpp
src/mesa/main/shaderapi.c
src/mesa/main/uniform_query.cpp
src/mesa/state_tracker/st_draw.c

index 1854279925bf4ff8aea55a6ad6bcba3a643fc96a..e72e7b42c57735683c44acce7ed721c98d659e01 100644 (file)
@@ -105,11 +105,6 @@ struct gl_uniform_storage {
     */
    unsigned array_elements;
 
-   /**
-    * Has this uniform ever been set?
-    */
-   bool initialized;
-
    struct gl_opaque_uniform_index opaque[MESA_SHADER_STAGES];
 
    /**
index 7d280ccf7fc1992aa2c2233058f425ff592183f9..870bc5bfebd3bdf771fc3ea993a48c7532a83fea 100644 (file)
@@ -162,8 +162,6 @@ set_opaque_binding(void *mem_ctx, gl_shader_program *prog,
             }
          }
       }
-
-      storage->initialized = true;
    }
 }
 
@@ -267,8 +265,6 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog,
          }
       }
    }
-
-   storage->initialized = true;
 }
 }
 
index 807b069e3edef87fced8d96f4889bd1e0239ea3f..cd487ab6dd0e7c9f47153d1f7b511e7248c5f90c 100644 (file)
@@ -799,7 +799,6 @@ private:
 
       this->uniforms[id].name = ralloc_strdup(this->uniforms, name);
       this->uniforms[id].type = base_type;
-      this->uniforms[id].initialized = 0;
       this->uniforms[id].num_driver_storage = 0;
       this->uniforms[id].driver_storage = NULL;
       this->uniforms[id].atomic_buffer_index = -1;
index 32fad56f6517c232b0576db8d03d034e86c6d7c9..ba2607221d914314b66d823e9ec79e02f5b8e76b 100644 (file)
@@ -2568,7 +2568,6 @@ _mesa_UniformSubroutinesuiv(GLenum shadertype, GLsizei count,
       memcpy(&uni->storage[0], &indices[i],
              sizeof(GLuint) * uni_count);
 
-      uni->initialized = true;
       _mesa_propagate_uniforms_to_driver_storage(uni, 0, uni_count);
       i += uni_count;
    } while(i < count);
@@ -2742,7 +2741,7 @@ _mesa_shader_init_subroutine_defaults(struct gl_shader *sh)
 
       for (j = 0; j < uni_count; j++)
          memcpy(&uni->storage[j], &val, sizeof(int));
-      uni->initialized = true;
+
       _mesa_propagate_uniforms_to_driver_storage(uni, 0, uni_count);
    }
 }
index 2ced201ebcaa5b26e309f8fe1069ca5ef4306386..ab5c3cd92494e14292577f91e4622ec0dfa03ff3 100644 (file)
@@ -815,8 +815,6 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg,
       }
    }
 
-   uni->initialized = true;
-
    _mesa_propagate_uniforms_to_driver_storage(uni, offset, count);
 
    /* If the uniform is a sampler, do the extra magic necessary to propagate
@@ -1030,8 +1028,6 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
       }
    }
 
-   uni->initialized = true;
-
    _mesa_propagate_uniforms_to_driver_storage(uni, offset, count);
 }
 
index fdd59a383a953d3d84c77a452e3069ffc5267912..3db5749725e917a93e19d4ef545ac1820ad30e48 100644 (file)
@@ -126,35 +126,6 @@ setup_index_buffer(struct st_context *st,
 }
 
 
-/**
- * Prior to drawing, check that any uniforms referenced by the
- * current shader have been set.  If a uniform has not been set,
- * issue a warning.
- */
-static void
-check_uniforms(struct gl_context *ctx)
-{
-   struct gl_shader_program **shProg = ctx->_Shader->CurrentProgram;
-   unsigned j;
-
-   for (j = 0; j < 3; j++) {
-      unsigned i;
-
-      if (shProg[j] == NULL || !shProg[j]->LinkStatus)
-        continue;
-
-      for (i = 0; i < shProg[j]->NumUniformStorage; i++) {
-         const struct gl_uniform_storage *u = &shProg[j]->UniformStorage[i];
-         if (!u->initialized) {
-            _mesa_warning(ctx,
-                          "Using shader with uninitialized uniform: %s",
-                          u->name);
-         }
-      }
-   }
-}
-
-
 /**
  * Translate OpenGL primtive type (GL_POINTS, GL_TRIANGLE_STRIP, etc) to
  * the corresponding Gallium type.
@@ -203,14 +174,6 @@ st_draw_vbo(struct gl_context *ctx,
    /* Validate state. */
    if (st->dirty.st || st->dirty.mesa || ctx->NewDriverState) {
       st_validate_state(st, ST_PIPELINE_RENDER);
-
-#if 0
-      if (MESA_VERBOSE & VERBOSE_GLSL) {
-         check_uniforms(ctx);
-      }
-#else
-      (void) check_uniforms;
-#endif
    }
 
    if (st->vertex_array_out_of_memory) {