+
+ // See if anything using this RTT input (in this phase) needs mipmaps.
+ // TODO: It could be that we get conflicting logic here, if we have
+ // multiple effects with incompatible mipmaps using the same
+ // RTT input. However, that is obscure enough that we can deal
+ // with it at some future point (preferably when we have
+ // universal support for separate sampler objects!). For now,
+ // an assert is good enough. See also the TODO at bound_sampler_num.
+ bool any_needs_mipmaps = false, any_refuses_mipmaps = false;
+ for (Node *node : phase->effects) {
+ assert(node->incoming_links.size() == node->incoming_link_type.size());
+ for (size_t i = 0; i < node->incoming_links.size(); ++i) {
+ if (node->incoming_links[i] == input->output_node &&
+ node->incoming_link_type[i] == IN_ANOTHER_PHASE) {
+ if (node->needs_mipmaps == Effect::NEEDS_MIPMAPS) {
+ any_needs_mipmaps = true;
+ } else if (node->needs_mipmaps == Effect::CANNOT_ACCEPT_MIPMAPS) {
+ any_refuses_mipmaps = true;
+ }
+ }
+ }
+ }
+ assert(!(any_needs_mipmaps && any_refuses_mipmaps));
+
+ if (any_needs_mipmaps && generated_mipmaps->count(input) == 0) {