Mesa (master): glsl: Make vertex ID lowering declare gl_BaseVertex as hidden.

Kenneth Graunke kwg at kemper.freedesktop.org
Sat Apr 2 05:05:33 UTC 2016


Module: Mesa
Branch: master
Commit: 2c5afe1fa98d01eb90577c8dbe785fc408f8608f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c5afe1fa98d01eb90577c8dbe785fc408f8608f

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Apr  1 20:52:33 2016 -0700

glsl: Make vertex ID lowering declare gl_BaseVertex as hidden.

If the GL_ARB_shader_draw_parameters extension is enabled, we'll already
have a gl_BaseVertex variable.  It will have var->how_declared set to
ir_var_declared_implicitly, and will appear in the program resource
list.

If not, we make one for internal use.  We don't want it to be listed
in the program resource list, as the application won't be expecting
it.  Marking it hidden will properly exclude it.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/compiler/glsl/lower_vertex_id.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl/lower_vertex_id.cpp b/src/compiler/glsl/lower_vertex_id.cpp
index 3da7a2f..6f46945 100644
--- a/src/compiler/glsl/lower_vertex_id.cpp
+++ b/src/compiler/glsl/lower_vertex_id.cpp
@@ -100,7 +100,7 @@ lower_vertex_id_visitor::visit(ir_dereference_variable *ir)
       if (gl_BaseVertex == NULL) {
          gl_BaseVertex = new(mem_ctx) ir_variable(int_t, "gl_BaseVertex",
                                                   ir_var_system_value);
-         gl_BaseVertex->data.how_declared = ir_var_declared_implicitly;
+         gl_BaseVertex->data.how_declared = ir_var_hidden;
          gl_BaseVertex->data.read_only = true;
          gl_BaseVertex->data.location = SYSTEM_VALUE_BASE_VERTEX;
          gl_BaseVertex->data.explicit_location = true;




More information about the mesa-commit mailing list