summaryrefslogtreecommitdiffstats
path: root/src/glsl/lower_packed_varyings.cpp
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-04-06 10:33:25 -0700
committerPaul Berry <stereotype441@gmail.com>2013-04-09 10:25:19 -0700
commit8687c40c2dde6cd64f67396333765f6aa9c82f6a (patch)
tree5a36ca5c7c709f05f30ce82ba0fdf5215a4292c7 /src/glsl/lower_packed_varyings.cpp
parent7862bde8af1f63cfe921977ecb112f88885c92a9 (diff)
downloadexternal_mesa3d-8687c40c2dde6cd64f67396333765f6aa9c82f6a.zip
external_mesa3d-8687c40c2dde6cd64f67396333765f6aa9c82f6a.tar.gz
external_mesa3d-8687c40c2dde6cd64f67396333765f6aa9c82f6a.tar.bz2
glsl: Document lower_packed_varyings' "flat" requirement with an assert.
To minimize the variety of type conversions that lower_packed_varyings needs to perform, it assumes that integral varyings are always qualified as "flat". link_varyings.cpp takes care of ensuring that this is the case (even in the circumstances where GLSL doesn't require it). This patch documents the assumption with an assertion, for ease in future debugging. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'src/glsl/lower_packed_varyings.cpp')
-rw-r--r--src/glsl/lower_packed_varyings.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/lower_packed_varyings.cpp b/src/glsl/lower_packed_varyings.cpp
index b4cc5cd..cdf2289 100644
--- a/src/glsl/lower_packed_varyings.cpp
+++ b/src/glsl/lower_packed_varyings.cpp
@@ -178,6 +178,14 @@ lower_packed_varyings_visitor::run(exec_list *instructions)
!this->needs_lowering(var))
continue;
+ /* This lowering pass is only capable of packing floats and ints
+ * together when their interpolation mode is "flat". Therefore, to be
+ * safe, caller should ensure that integral varyings always use flat
+ * interpolation, even when this is not required by GLSL.
+ */
+ assert(var->interpolation == INTERP_QUALIFIER_FLAT ||
+ !var->type->contains_integer());
+
/* Change the old varying into an ordinary global. */
var->mode = ir_var_auto;