X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=effect_chain.cpp;h=fe07a3f909d0f3a3caaf1c41058329ce2f4f12bc;hb=c220f1f515ce115e049dfff990b08b2592bd8f8d;hp=0e20ce097be8a29ff85ff9b4fbe089a273ddbe75;hpb=b4ec29a251e118f463ce940ffaf0945188bf6894;p=movit diff --git a/effect_chain.cpp b/effect_chain.cpp index 0e20ce0..fe07a3f 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -1993,6 +1993,16 @@ void EffectChain::execute_phase(Phase *phase, bool last_phase, GLuint tex_num = resource_pool->create_2d_texture(intermediate_format, phase->output_width, phase->output_height); output_textures->insert(make_pair(phase, tex_num)); + + // The output texture needs to have valid state to be written to by a compute shader. + if (phase->is_compute_shader) { + glActiveTexture(GL_TEXTURE0); + check_error(); + glBindTexture(GL_TEXTURE_2D, (*output_textures)[phase]); + check_error(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + check_error(); + } } // Set up RTT inputs for this phase.