summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2014-01-08 10:17:01 -0800
committerPaul Berry <[email protected]>2014-01-09 09:31:19 -0800
commitbce8bc0b250c7d64ac7898ba032858963dee6a37 (patch)
tree7f0bc1b886f62d2061b34237e0f184913dbb309e /src/glsl/link_varyings.cpp
parentb539385789a95074cc53c9e16988d2384ec5c7de (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/link_varyings.cpp')
-rw-r--r--src/glsl/link_varyings.cpp32
1 files changed, 6 insertions, 26 deletions
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index 6672b878018..c925c00e39a 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -1249,19 +1249,9 @@ check_against_output_limit(struct gl_context *ctx,
}
}
- unsigned max_output_components;
- switch (producer->Stage) {
- case MESA_SHADER_VERTEX:
- max_output_components = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
- break;
- case MESA_SHADER_GEOMETRY:
- max_output_components = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents;
- break;
- case MESA_SHADER_FRAGMENT:
- default:
- assert(!"Should not get here.");
- return false;
- }
+ assert(producer->Stage != MESA_SHADER_FRAGMENT);
+ unsigned max_output_components =
+ ctx->Const.Program[producer->Stage].MaxOutputComponents;
const unsigned output_components = output_vectors * 4;
if (output_components > max_output_components) {
@@ -1298,19 +1288,9 @@ check_against_input_limit(struct gl_context *ctx,
}
}
- unsigned max_input_components;
- switch (consumer->Stage) {
- case MESA_SHADER_GEOMETRY:
- max_input_components = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents;
- break;
- case MESA_SHADER_FRAGMENT:
- max_input_components = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents;
- break;
- case MESA_SHADER_VERTEX:
- default:
- assert(!"Should not get here.");
- return false;
- }
+ assert(consumer->Stage != MESA_SHADER_VERTEX);
+ unsigned max_input_components =
+ ctx->Const.Program[consumer->Stage].MaxInputComponents;
const unsigned input_components = input_vectors * 4;
if (input_components > max_input_components) {