OSDN Git Service

nir/linker: take into account hidden uniforms
authorAlejandro Piñeiro <apinheiro@igalia.com>
Wed, 8 Aug 2018 11:41:58 +0000 (13:41 +0200)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Mon, 13 Aug 2018 14:28:27 +0000 (16:28 +0200)
commitfe2de39fb2ef4caca2afd483c375bd0aa31fbb6d
treee707b16e89a042bb3ebdc10b465be4a9a5c32d01
parent5332d7582dc82fcf25cd48e9096dc98ef998453e
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 <tarceri@itsqueeze.com>
src/compiler/glsl/gl_nir_link_uniforms.c
src/compiler/glsl/gl_nir_linker.c