summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/gl_nir_linker.c
diff options
context:
space:
mode:
authorAlejandro Piñeiro <[email protected]>2018-08-08 13:41:58 +0200
committerAlejandro Piñeiro <[email protected]>2018-08-13 16:28:27 +0200
commitfe2de39fb2ef4caca2afd483c375bd0aa31fbb6d (patch)
treee707b16e89a042bb3ebdc10b465be4a9a5c32d01 /src/compiler/glsl/gl_nir_linker.c
parent5332d7582dc82fcf25cd48e9096dc98ef998453e (diff)
nir/linker: take into account hidden uniforms
So they are not exposed through the introspection API. It is worth to note that the number of hidden uniforms of GLSL linking vs SPIR-V linking would be somewhat different due the differen order of the nir lowerings/optimizations. For example: gl_FbWposYTransform. This is introduced as part of nir_lower_wpos_ytransform. On GLSL that is executed after the IR-based linking. So that means that on GLSL the UniformStorage will not include this uniform. With the SPIR-V linking, that uniform is already present, but marked as hidden. So it will be included on the UniformStorage, but as hidden. One alternative would create a special how_declared for that case, but seemed an overkill. Using hidden should be ok as far as it is used properly. Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/glsl/gl_nir_linker.c')
-rw-r--r--src/compiler/glsl/gl_nir_linker.c4
1 files changed, 4 insertions, 0 deletions
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;