summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp13
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 "