X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=effect_chain.h;h=70dc256f41f19616d4b2fce2875ec98d049e7847;hp=c3dadffca3b115bbfdab3553bdbd81050b0ed9f7;hb=d55c54cc3671c99878ec27c6a102c97a96245f6b;hpb=6ec130490868eb8316cb2cdce9fbfd237d25a00e diff --git a/effect_chain.h b/effect_chain.h index c3dadff..70dc256 100644 --- a/effect_chain.h +++ b/effect_chain.h @@ -147,6 +147,11 @@ struct Phase { 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 attribute_indexes; + bool input_needs_mipmaps; // Inputs are only inputs from other phases (ie., those that come from RTT); @@ -220,6 +225,23 @@ public: inputs.push_back(input3); return add_effect(effect, inputs); } + Effect *add_effect(Effect *effect, Effect *input1, Effect *input2, Effect *input3, Effect *input4) { + std::vector 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 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 &inputs); // Adds an RGBA output. Note that you can have at most one RGBA output and one @@ -343,7 +365,10 @@ private: Phase *construct_phase(Node *output, std::map *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 *output_textures, std::set *generated_mipmaps); + void execute_phase(Phase *phase, bool last_phase, + std::set *bound__attribute_indices, + std::map *output_textures, + std::set *generated_mipmaps); // Set up uniforms for one phase. The program must already be bound. void setup_uniforms(Phase *phase); @@ -414,6 +439,7 @@ private: unsigned num_dither_bits; OutputOrigin output_origin; bool finalized; + GLuint vbo; // Contains vertex and texture coordinate data. ResourcePool *resource_pool; bool owns_resource_pool;