- if (deps[i]->effect->is_compute_shader()) {
- // Only one compute shader per phase; we should have been stopped
- // already due to the fact that compute shaders are not one-to-one.
- assert(!phase->is_compute_shader);
-
- // If all nodes so far are strong one-to-one, we can put them after
- // the compute shader (ie., process them on the output).
- start_new_phase = !node->strong_one_to_one_sampling;
- } else if (deps[i]->effect->sets_virtual_output_size()) {
- assert(deps[i]->effect->changes_output_size());
+ if (dep->effect->is_compute_shader()) {
+ if (phase->is_compute_shader) {
+ // Only one compute shader per phase.
+ start_new_phase = true;
+ } else if (!node->strong_one_to_one_sampling) {
+ // If all nodes so far are strong one-to-one, we can put them after
+ // the compute shader (ie., process them on the output).
+ start_new_phase = true;
+ } else if (!start_new_phase) {
+ phase->is_compute_shader = true;
+ phase->compute_shader_node = dep;
+ }
+ } else if (dep->effect->sets_virtual_output_size()) {
+ assert(dep->effect->changes_output_size());