- glFramebufferTexture2D(
- GL_FRAMEBUFFER,
- GL_COLOR_ATTACHMENT0 + i,
- GL_TEXTURE_2D,
- texnum[i],
- 0);
+ 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);