Mesa (master): glsl: Account for location field when comparing interface blocks.
Paul Berry
stereotype441 at kemper.freedesktop.org
Thu Oct 10 21:46:57 UTC 2013
Module: Mesa
Branch: master
Commit: 6a157f2e3345faf23041eaefb47183a6debacb6b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6a157f2e3345faf23041eaefb47183a6debacb6b
Author: Paul Berry <stereotype441 at gmail.com>
Date: Sat Sep 28 11:00:26 2013 -0700
glsl: Account for location field when comparing interface blocks.
In commit e2660770731b018411fbe1620cacddaf8dff5287 (glsl: Keep track
of location for interface block fields), I neglected to update
glsl_type::record_key_compare to account for the fact that interface
types now contain location information. As a result, interface types
that differ only by their location information would not be properly
distinguished.
At the moment this is not a problem, because the only interface block
in which location information != -1 is gl_PerVertex, and gl_PerVertex
is always created in the same way. However, in the patches that
follow, we'll be adding new ways to create gl_PerVertex (by
redeclaring it), so we'll need location information to be handled
properly.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/glsl/glsl_types.cpp | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index c4c04fe..80a6e71 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -452,6 +452,9 @@ glsl_type::record_key_compare(const void *a, const void *b)
if (key1->fields.structure[i].row_major
!= key2->fields.structure[i].row_major)
return 1;
+ if (key1->fields.structure[i].location
+ != key2->fields.structure[i].location)
+ return 1;
}
return 0;
More information about the mesa-commit
mailing list