[Mesa-dev] glsl: binding point is a texture unit, which is a combined space

Submitted by Ilia Mirkin on June 23, 2015, 4:22 a.m.

Details

Message ID 1435033368-32547-1-git-send-email-imirkin@alum.mit.edu
State Accepted
Commit fccf012adc0d3aad877de095244324aa1d2d046a
Headers show

Commit Message

Ilia Mirkin June 23, 2015, 4:22 a.m.
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>
Tested-by: Nick Sarnie <commendsarnex@gmail.com>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
---
 src/glsl/ast_to_hir.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 259e01e..8cb46be 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -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 "

Comments

Timothy Arceri June 23, 2015, 6:32 a.m.
Looks good to me as well.

Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>

Since you already looking around in there did you want to take a look
at this patch: 
http://lists.freedesktop.org/archives/mesa-dev/2015-June/086925.html

I submitted it earlier this month but no one seems to keen to review
it.

On Tue, 2015-06-23 at 00:22 -0400, Ilia Mirkin wrote:
> 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>
> Tested-by: Nick Sarnie <commendsarnex@gmail.com>
> Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
> ---
>  src/glsl/ast_to_hir.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
> index 259e01e..8cb46be 100644
> --- a/src/glsl/ast_to_hir.cpp
> +++ b/src/glsl/ast_to_hir.cpp
> @@ -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 "
Timothy Arceri June 23, 2015, 6:46 a.m.
This also probably explains why my max binding test for arrays of
arrays was failing on the Nvidia blob. Guess I should have looked into
that failure a little harder.

On Tue, 2015-06-23 at 00:22 -0400, Ilia Mirkin wrote:
> 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>
> Tested-by: Nick Sarnie <commendsarnex@gmail.com>
> Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
> ---
>  src/glsl/ast_to_hir.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
> index 259e01e..8cb46be 100644
> --- a/src/glsl/ast_to_hir.cpp
> +++ b/src/glsl/ast_to_hir.cpp
> @@ -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 "