From 87a4bc511811327a00f9bbc1b6870b7fa46675f7 Mon Sep 17 00:00:00 2001 From: Martin Peres Date: Thu, 21 May 2015 15:51:09 +0300 Subject: mesa: reference built-in uniforms into gl_uniform_storage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change introduces a new field in gl_uniform_storage to explicitely say that a uniform is built-in. In the case where it is, no storage is defined to make it clear that it is read-only from the mesa side. I fixed all the places in the code that made use of the structure that I changed. Any place making a wrong assumption and using the storage straight away will just crash. This patch seems to implement the path of least resistance towards listing built-in uniforms in GL_ACTIVE_UNIFORM (and other APIs). Reviewed-by: Tapani Pälli Signed-off-by: Martin Peres --- src/glsl/tests/set_uniform_initializer_tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/glsl/tests') diff --git a/src/glsl/tests/set_uniform_initializer_tests.cpp b/src/glsl/tests/set_uniform_initializer_tests.cpp index d3fdeb3a844..91227d9487a 100644 --- a/src/glsl/tests/set_uniform_initializer_tests.cpp +++ b/src/glsl/tests/set_uniform_initializer_tests.cpp @@ -110,7 +110,7 @@ establish_uniform_storage(struct gl_shader_program *prog, unsigned num_storage, prog->UniformStorage = rzalloc_array(prog, struct gl_uniform_storage, num_storage); - prog->NumUserUniformStorage = num_storage; + prog->NumUniformStorage = num_storage; prog->UniformStorage[index_to_set].name = (char *) name; prog->UniformStorage[index_to_set].type = type; @@ -155,7 +155,7 @@ establish_uniform_storage(struct gl_shader_program *prog, unsigned num_storage, static void verify_initialization(struct gl_shader_program *prog, unsigned actual_index) { - for (unsigned i = 0; i < prog->NumUserUniformStorage; i++) { + for (unsigned i = 0; i < prog->NumUniformStorage; i++) { if (i == actual_index) { EXPECT_TRUE(prog->UniformStorage[actual_index].initialized); } else { -- cgit v1.2.3