[Mesa-dev] [PATCH 10/19] glsl: Don't allow invalid identifiers as interface block instance names.
Paul Berry
stereotype441 at gmail.com
Wed Oct 2 17:45:23 PDT 2013
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.
---
src/glsl/ast_to_hir.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index aabf201..bb14fc9 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)
+ check_valid_identifier(this->instance_name, loc, state);
+
ir_variable *var;
if (this->is_array) {
--
1.8.4
More information about the mesa-dev
mailing list