Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-03-16 10:24:54 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-03-18 22:54:27 +0300
commit054957659f671910e1967fec83768affbbff060c (patch)
tree234b11d5ceb76189795925bd025719818ec737a2 /source/blender/gpu/opengl
parent935136f844afc057be91d3538191219a321f4b52 (diff)
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.
Diffstat (limited to 'source/blender/gpu/opengl')
-rw-r--r--source/blender/gpu/opengl/gl_shader.hh5
-rw-r--r--source/blender/gpu/opengl/gl_texture.cc5
2 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_shader.hh b/source/blender/gpu/opengl/gl_shader.hh
index 86281d231a8..9c21d0c6230 100644
--- a/source/blender/gpu/opengl/gl_shader.hh
+++ b/source/blender/gpu/opengl/gl_shader.hh
@@ -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);
diff --git a/source/blender/gpu/opengl/gl_texture.cc b/source/blender/gpu/opengl/gl_texture.cc
index 0a5c7f8e79e..9d070088802 100644
--- a/source/blender/gpu/opengl/gl_texture.cc
+++ b/source/blender/gpu/opengl/gl_texture.cc
@@ -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) {