From 094bfbb35f1af70ef07890ac7735006cdc195cca Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 23 Nov 2017 00:59:46 +0100 Subject: [PATCH] Fix another set of test breakages on NVIDIA. This was broken by c6ee050546b6940ae19a74f92bdcc8d2b1f56d22, which stopped modifying destination textures' minification modes. --- effect_chain.h | 5 ++++- test_util.cpp | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/effect_chain.h b/effect_chain.h index 992fb58..716a970 100644 --- a/effect_chain.h +++ b/effect_chain.h @@ -400,7 +400,10 @@ public: // All destination textures must be exactly of size x , // and must either come from the same ResourcePool the effect uses, or outlive // the EffectChain (otherwise, we could be allocating FBOs that end up being - // stale). width and height can not be zero. + // stale). Textures must also have valid state; in particular, they must either + // be mipmap complete or have a non-mipmapped minification mode. + // + // width and height can not be zero. struct DestinationTexture { GLuint texnum; GLenum format; diff --git a/test_util.cpp b/test_util.cpp index ec8b146..d2ed9f8 100644 --- a/test_util.cpp +++ b/test_util.cpp @@ -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); -- 2.39.2