diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/glsl/gl_nir_link_uniforms.c | 5 | ||||
-rw-r--r-- | src/compiler/glsl/gl_nir_linker.c | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c b/src/compiler/glsl/gl_nir_link_uniforms.c index f729fa988e2..1573e30c41e 100644 --- a/src/compiler/glsl/gl_nir_link_uniforms.c +++ b/src/compiler/glsl/gl_nir_link_uniforms.c @@ -365,6 +365,10 @@ nir_link_uniform(struct gl_context *ctx, uniform->remap_location = UNMAPPED_UNIFORM_LOC; } + uniform->hidden = state->current_var->data.how_declared == nir_var_hidden; + if (uniform->hidden) + state->num_hidden_uniforms++; + /* @FIXME: the initialization of the following will be done as we * implement support for their specific features, like SSBO, atomics, * etc. @@ -374,7 +378,6 @@ nir_link_uniform(struct gl_context *ctx, uniform->matrix_stride = -1; uniform->array_stride = -1; uniform->row_major = false; - uniform->hidden = false; uniform->builtin = false; uniform->is_shader_storage = false; uniform->atomic_buffer_index = -1; diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c index d09a2c0a6c5..547549bc4e0 100644 --- a/src/compiler/glsl/gl_nir_linker.c +++ b/src/compiler/glsl/gl_nir_linker.c @@ -56,6 +56,10 @@ nir_build_program_resource_list(struct gl_context *ctx, for (unsigned i = 0; i < prog->data->NumUniformStorage; i++) { struct gl_uniform_storage *uniform = &prog->data->UniformStorage[i]; + /* Do not add uniforms internally used by Mesa. */ + if (uniform->hidden) + continue; + if (!link_util_add_program_resource(prog, resource_set, GL_UNIFORM, uniform, uniform->active_shader_mask)) { return; |