glsl: handle same struct redeclaration (v2)
authorDave Airlie <airlied@redhat.com>
Tue, 17 May 2016 00:58:53 +0000 (10:58 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 20 May 2016 01:22:52 +0000 (11:22 +1000)
commit3ca1c2216d38970bb067c7d94dc701bfc33d983e
tree188a37546d2d55a178990c33e049a02db348711b
parent8a65b5135a167d4f12cef19408e0ca52fffe06bc
glsl: handle same struct redeclaration (v2)

This works around a bug in older version of UE4, where a shader
defines the same structure twice. Although we aren't sure this is correct
GLSL (it most likely isn't) there are enough UE4 based things out there
we should deal with this.

This drops the error to a warning if the struct names and contents match.

v1.1: do better C++ on record_compare declaration (Rob)
v2: restrict this to desktop GL only (Ian)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95005
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/compiler/glsl/ast_to_hir.cpp
src/compiler/glsl_types.cpp
src/compiler/glsl_types.h