mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 19:58:09 +02:00
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>
(cherry picked from commit 8687c40c2d)
This commit is contained in:
parent
bd8d257ef3
commit
0b2fa0eec6
1 changed files with 8 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue