summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
diff options
context:
space:
mode:
authorMartin Peres <martin.peres@linux.intel.com>2015-05-21 15:51:09 +0300
committerMartin Peres <martin.peres@linux.intel.com>2015-06-04 09:25:00 +0300
commit87a4bc511811327a00f9bbc1b6870b7fa46675f7 (patch)
treec96c9d1eb9fe62a2ba0d40b62bbdd26f0614e7fe /src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
parent4fd42a7c2798d03476c84b79cb855984a15c222c (diff)
downloadexternal_mesa3d-87a4bc511811327a00f9bbc1b6870b7fa46675f7.zip
external_mesa3d-87a4bc511811327a00f9bbc1b6870b7fa46675f7.tar.gz
external_mesa3d-87a4bc511811327a00f9bbc1b6870b7fa46675f7.tar.bz2
mesa: reference built-in uniforms into gl_uniform_storage
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 <tapani.palli@intel.com> Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index d3347ec..242d007 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -683,9 +683,12 @@ vec4_visitor::setup_uniform_values(ir_variable *ir)
* order we'd walk the type, so walk the list of storage and find anything
* with our name, or the prefix of a component that starts with our name.
*/
- for (unsigned u = 0; u < shader_prog->NumUserUniformStorage; u++) {
+ for (unsigned u = 0; u < shader_prog->NumUniformStorage; u++) {
struct gl_uniform_storage *storage = &shader_prog->UniformStorage[u];
+ if (storage->builtin)
+ continue;
+
if (strncmp(ir->name, storage->name, namelen) != 0 ||
(storage->name[namelen] != 0 &&
storage->name[namelen] != '.' &&