glsl: binding point is a texture unit, which is a combined space
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 23 Jun 2015 04:16:59 +0000 (00:16 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 23 Jun 2015 16:08:34 +0000 (12:08 -0400)
This fixes compilation failures in Dota 2 Reborn where a texture unit
binding point was used that was numerically higher than the max
per stage.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Tested-by: Nick Sarnie <commendsarnex@gmail.com>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
src/glsl/ast_to_hir.cpp

index 259e01e0ca433924103710c64c4f1532691ff629..8cb46beab1ecea34e42c21405fea23de10baca89 100644 (file)
@@ -2086,7 +2086,7 @@ validate_binding_qualifier(struct _mesa_glsl_parse_state *state,
        *  with an array of size N, all elements of the array from binding
        *  through binding + N - 1 must be within this range."
        */
-      unsigned limit = ctx->Const.Program[state->stage].MaxTextureImageUnits;
+      unsigned limit = ctx->Const.MaxCombinedTextureImageUnits;
 
       if (max_index >= limit) {
          _mesa_glsl_error(loc, state, "layout(binding = %d) for %d samplers "