diff options
author | Paul Berry <[email protected]> | 2014-01-08 10:17:01 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2014-01-09 09:31:19 -0800 |
commit | bce8bc0b250c7d64ac7898ba032858963dee6a37 (patch) | |
tree | 7f0bc1b886f62d2061b34237e0f184913dbb309e /src/glsl/ast_to_hir.cpp | |
parent | b539385789a95074cc53c9e16988d2384ec5c7de (diff) |
glsl: Index into ctx->Const.Program[] rather than using ad-hoc code.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 1ac60478aa7..ef8e699e02b 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1983,18 +1983,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 = 0; - switch (state->stage) { - case MESA_SHADER_VERTEX: - limit = ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits; - break; - case MESA_SHADER_GEOMETRY: - limit = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits; - break; - case MESA_SHADER_FRAGMENT: - limit = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; - break; - } + unsigned limit = ctx->Const.Program[state->stage].MaxTextureImageUnits; if (max_index >= limit) { _mesa_glsl_error(loc, state, "layout(binding = %d) for %d samplers " |