Mesa (master): glsl: Don' t allow invalid identifiers as interface block instance names.

Paul Berry stereotype441 at kemper.freedesktop.org
Thu Oct 10 21:46:57 UTC 2013


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

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Fri Sep 27 17:41:07 2013 -0700

glsl: Don't allow invalid identifiers as interface block instance names.

Note: we need to make an exception for the gl_PerVertex interface
block, since in geometry shaders it is allowed to be redeclared with
the instance name gl_in.  Future patches will make redeclaration of
gl_PerVertex work properly.

Fixes piglit test
spec/glsl-1.50/compiler/interface-block-instance-name-uses-gl-prefix.vert.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/glsl/ast_to_hir.cpp |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 1d7539d..1a5df71 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -4692,6 +4692,9 @@ ast_interface_block::hir(exec_list *instructions,
     *     field selector ( . ) operator (analogously to structures)."
     */
    if (this->instance_name) {
+      if (!redeclaring_per_vertex)
+         validate_identifier(this->instance_name, loc, state);
+
       ir_variable *var;
 
       if (this->is_array) {




More information about the mesa-commit mailing list