+ // There are some corner cases where we thought we needed to add a dummy
+ // effect, but then it turned out later we didn't (e.g. induces_compute_shader()
+ // didn't see a mipmap conflict coming, which would cause the compute shader
+ // to be split off from the inal phase); if so, remove the extra phase
+ // at the end, since it will give us some trouble during execution.
+ //
+ // TODO: Remove induces_compute_shader() and replace it with precise tracking.
+ if (has_dummy_effect && !phases[phases.size() - 2]->is_compute_shader) {
+ resource_pool->release_glsl_program(phases.back()->glsl_program_num);
+ delete phases.back();
+ phases.pop_back();
+ has_dummy_effect = false;
+ }
+
+ output_dot("step22-dummy-phase-removal.dot");
+