X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=test_util.cpp;h=d4bfc484183d42e0aaa85cd7bec217c2c32a55ef;hp=ec8b146bae96c41e8f1fac705348a33a90fdf230;hb=8ee9712bae3cff206b3e3205748633edb33cbbcf;hpb=206d6ba316f94fdc3b7cbd16f23cdcaeb370ad9f diff --git a/test_util.cpp b/test_util.cpp index ec8b146..d4bfc48 100644 --- a/test_util.cpp +++ b/test_util.cpp @@ -59,7 +59,7 @@ EffectChainTester::EffectChainTester(const float *data, unsigned width, unsigned output_added(false), finalized(false) { - CHECK(init_movit(".", MOVIT_DEBUG_OFF)); + init_movit_for_test(); if (data != nullptr) { add_input(data, pixel_format, color_space, gamma_curve); @@ -248,10 +248,19 @@ void EffectChainTester::internal_run(T *out_data, T *out_data2, T *out_data3, T num_outputs = 1; } + glActiveTexture(GL_TEXTURE0); + check_error(); + vector textures; for (unsigned i = 0; i < num_outputs; ++i) { GLuint texnum = chain.get_resource_pool()->create_2d_texture(framebuffer_format, width, height); textures.push_back(EffectChain::DestinationTexture{texnum, framebuffer_format}); + + // The output texture needs to have valid state to be written to by a compute shader. + glBindTexture(GL_TEXTURE_2D, texnum); + check_error(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + check_error(); } chain.render_to_texture(textures, width, height);