Mesa (master): glsl: do not add unnamed struct types to the symbol table

Nicolai Hähnle nh at kemper.freedesktop.org
Tue Jun 13 07:36:29 UTC 2017


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

Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date:   Sun May 14 19:59:27 2017 +0200

glsl: do not add unnamed struct types to the symbol table

We removed the need for lookups, and we will assign them all the same
name in the future.

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

---

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

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index c67dfe5e88..b1e490eefd 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -7509,7 +7509,7 @@ ast_struct_specifier::hir(exec_list *instructions,
 
    type = glsl_type::get_record_instance(fields, decl_count, this->name);
 
-   if (!state->symbols->add_type(name, type)) {
+   if (!type->is_anonymous() && !state->symbols->add_type(name, type)) {
       const glsl_type *match = state->symbols->get_type(name);
       /* allow struct matching for desktop GL - older UE4 does this */
       if (match != NULL && state->is_version(130, 0) && match->record_compare(type, false))




More information about the mesa-commit mailing list