Node *output_node;
GLuint glsl_program_num; // Owned by the resource_pool.
+
+ // Position and texcoord attribute indexes, although it doesn't matter
+ // which is which, because they contain the same data.
+ std::set<GLint> attribute_indexes;
+
bool input_needs_mipmaps;
// Inputs are only inputs from other phases (ie., those that come from RTT);
inputs.push_back(input3);
return add_effect(effect, inputs);
}
+ Effect *add_effect(Effect *effect, Effect *input1, Effect *input2, Effect *input3, Effect *input4) {
+ std::vector<Effect *> inputs;
+ inputs.push_back(input1);
+ inputs.push_back(input2);
+ inputs.push_back(input3);
+ inputs.push_back(input4);
+ return add_effect(effect, inputs);
+ }
+ Effect *add_effect(Effect *effect, Effect *input1, Effect *input2, Effect *input3, Effect *input4, Effect *input5) {
+ std::vector<Effect *> inputs;
+ inputs.push_back(input1);
+ inputs.push_back(input2);
+ inputs.push_back(input3);
+ inputs.push_back(input4);
+ inputs.push_back(input5);
+ return add_effect(effect, inputs);
+ }
Effect *add_effect(Effect *effect, const std::vector<Effect *> &inputs);
// Adds an RGBA output. Note that you can have at most one RGBA output and one
// single-sampler input, or from an RTT texture.
GLenum get_input_sampler(Node *node, unsigned input_num) const;
+ // Whether input <input_num> of <node> corresponds to a single sampler
+ // (see get_input_sampler()). Normally, you should not need to call this;
+ // however, if the input Effect has set override_texture_bounce(),
+ // this will return false, and you could be flexible and check it first
+ // if you want.
+ GLenum has_input_sampler(Node *node, unsigned input_num) const;
+
// Get the current resource pool assigned to this EffectChain.
// Primarily to let effects allocate textures as needed.
// Any resources you get from the pool must be returned to the pool
Phase *construct_phase(Node *output, std::map<Node *, Phase *> *completed_effects);
// Execute one phase, ie. set up all inputs, effects and outputs, and render the quad.
- void execute_phase(Phase *phase, bool last_phase, std::map<Phase *, GLuint> *output_textures, std::set<Phase *> *generated_mipmaps);
+ void execute_phase(Phase *phase, bool last_phase,
+ std::set<GLint> *bound__attribute_indices,
+ std::map<Phase *, GLuint> *output_textures,
+ std::set<Phase *> *generated_mipmaps);
// Set up uniforms for one phase. The program must already be bound.
void setup_uniforms(Phase *phase);
unsigned num_dither_bits;
OutputOrigin output_origin;
bool finalized;
+ GLuint vbo; // Contains vertex and texture coordinate data.
ResourcePool *resource_pool;
bool owns_resource_pool;