aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-02-03 09:39:10 +1100
committerTimothy Arceri <[email protected]>2016-02-06 14:34:35 +1100
commitc1bbaff1e83f901d67d78f9e1ddfe8291dd09bfa (patch)
treef0ae24d875ab9663b45492e2584c91d3dc32068c /src/compiler/glsl/link_varyings.cpp
parente377037bef521a985dc801371f195ada327ec304 (diff)
glsl: replace unreachable code with an assert()
All interface blocks will have been lowered by this point so just use an assert. Returning false would have caused all sorts of problems if they were not lowered yet and there is an assert to catch this later anyway. We also update the tests to reflect this change. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl/link_varyings.cpp')
-rw-r--r--src/compiler/glsl/link_varyings.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index a4c730ffdcf..535c83cd0e7 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -1352,7 +1352,7 @@ private:
namespace linker {
-bool
+void
populate_consumer_input_sets(void *mem_ctx, exec_list *ir,
hash_table *consumer_inputs,
hash_table *consumer_interface_inputs,
@@ -1366,8 +1366,8 @@ populate_consumer_input_sets(void *mem_ctx, exec_list *ir,
ir_variable *const input_var = node->as_variable();
if ((input_var != NULL) && (input_var->data.mode == ir_var_shader_in)) {
- if (input_var->type->is_interface())
- return false;
+ /* All interface blocks should have been lowered by this point */
+ assert(!input_var->type->is_interface());
if (input_var->data.explicit_location) {
/* assign_varying_locations only cares about finding the
@@ -1401,8 +1401,6 @@ populate_consumer_input_sets(void *mem_ctx, exec_list *ir,
}
}
}
-
- return true;
}
/**
@@ -1626,18 +1624,11 @@ assign_varying_locations(struct gl_context *ctx,
if (producer)
canonicalize_shader_io(producer->ir, ir_var_shader_out);
- if (consumer
- && !linker::populate_consumer_input_sets(mem_ctx,
- consumer->ir,
- consumer_inputs,
- consumer_interface_inputs,
- consumer_inputs_with_locations)) {
- assert(!"populate_consumer_input_sets failed");
- hash_table_dtor(tfeedback_candidates);
- hash_table_dtor(consumer_inputs);
- hash_table_dtor(consumer_interface_inputs);
- return false;
- }
+ if (consumer)
+ linker::populate_consumer_input_sets(mem_ctx, consumer->ir,
+ consumer_inputs,
+ consumer_interface_inputs,
+ consumer_inputs_with_locations);
if (producer) {
foreach_in_list(ir_instruction, node, producer->ir) {