OSDN Git Service

glsl: do not add unnamed struct types to the symbol table
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sun, 14 May 2017 17:59:27 +0000 (19:59 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 13 Jun 2017 07:35:32 +0000 (09:35 +0200)
We removed the need for lookups, and we will assign them all the same
name in the future.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/ast_to_hir.cpp

index c67dfe5..b1e490e 100644 (file)
@@ -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))