GL: Check texture framebuffer feedback only if not using compute pipeline.

This was getting in the way in multiple instances. Compute shaders dispatch
are still made in the presence of the last bound framebuffer even if they
do not interact with it.
This commit is contained in:
2022-03-16 08:24:54 +01:00
parent 935136f844
commit 054957659f
2 changed files with 10 additions and 0 deletions

View File

@@ -72,6 +72,11 @@ class GLShader : public Shader {
/** DEPRECATED: Kept only because of BGL API. */
int program_handle_get() const override;
bool is_compute() const
{
return compute_shader_ != 0;
}
private:
char *glsl_patch_get(GLenum gl_stage);

View File

@@ -688,6 +688,11 @@ void GLTexture::check_feedback_loop()
if (GPU_mip_render_workaround()) {
return;
}
/* Do not check if using compute shader. */
GLShader *sh = dynamic_cast<GLShader *>(Context::get()->shader);
if (sh && sh->is_compute()) {
return;
}
GLFrameBuffer *fb = static_cast<GLFrameBuffer *>(GLContext::get()->active_fb);
for (int i = 0; i < ARRAY_SIZE(fb_); i++) {
if (fb_[i] == fb) {