diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
index 3b630f77698..d93856dd35d 100644
--- a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
+++ b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
@@ -31,6 +31,7 @@ DRI_CONF_SECTION_DEBUG
DRI_CONF_GLSL_CORRECT_DERIVATIVES_AFTER_DISCARD(false)
DRI_CONF_GLSL_IGNORE_WRITE_TO_READONLY_VAR(false)
DRI_CONF_ALLOW_DRAW_OUT_OF_ORDER(false)
+ DRI_CONF_GLTHREAD_NOP_CHECK_FRAMEBUFFER_STATUS(false)
DRI_CONF_FORCE_COMPAT_PROFILE(false)
DRI_CONF_FORCE_GL_NAMES_REUSE(false)
DRI_CONF_TRANSCODE_ETC(false)
diff --git a/src/gallium/auxiliary/util/u_driconf.c b/src/gallium/auxiliary/util/u_driconf.c
index 8ace8474766..531a55c2753 100644
--- a/src/gallium/auxiliary/util/u_driconf.c
+++ b/src/gallium/auxiliary/util/u_driconf.c
@@ -58,6 +58,7 @@ u_driconf_fill_st_options(struct st_config_options *options,
query_bool_option(force_glsl_abs_sqrt);
query_bool_option(allow_glsl_cross_stage_interpolation_mismatch);
query_bool_option(allow_draw_out_of_order);
+ query_bool_option(glthread_nop_check_framebuffer_status);
query_bool_option(ignore_map_unsynchronized);
query_bool_option(force_gl_names_reuse);
query_bool_option(transcode_etc);
diff --git a/src/gallium/include/frontend/api.h b/src/gallium/include/frontend/api.h
index 5b9f9c63d6d..6514d87d81a 100644
--- a/src/gallium/include/frontend/api.h
+++ b/src/gallium/include/frontend/api.h
@@ -234,6 +234,7 @@ struct st_config_options
bool force_glsl_abs_sqrt;
bool allow_glsl_cross_stage_interpolation_mismatch;
bool allow_draw_out_of_order;
+ bool glthread_nop_check_framebuffer_status;
bool ignore_map_unsynchronized;
bool force_integer_tex_nearest;
bool force_gl_names_reuse;
diff --git a/src/mapi/glapi/gen/ARB_framebuffer_object.xml b/src/mapi/glapi/gen/ARB_framebuffer_object.xml
index 295175c8816..44f274691c1 100644
--- a/src/mapi/glapi/gen/ARB_framebuffer_object.xml
+++ b/src/mapi/glapi/gen/ARB_framebuffer_object.xml
@@ -220,7 +220,8 @@
-
+
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 4bb2d8844d5..f8f12c03152 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4305,6 +4305,13 @@ struct gl_constants
* produce 0 instead of leaving the texture content undefined).
*/
bool NoClippingOnCopyTex;
+
+ /**
+ * Force glthread to always return GL_FRAMEBUFFER_COMPLETE to prevent
+ * synchronization. Used for apps that call it every frame or multiple times
+ * a frame, but always getting framebuffer completeness.
+ */
+ bool GLThreadNopCheckFramebufferStatus;
};
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index f27051115d1..5e731bec413 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -1840,6 +1840,7 @@ void st_init_extensions(struct pipe_screen *screen,
}
consts->AllowDrawOutOfOrder = options->allow_draw_out_of_order;
+ consts->GLThreadNopCheckFramebufferStatus = options->glthread_nop_check_framebuffer_status;
bool prefer_nir = PIPE_SHADER_IR_NIR ==
screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_PREFERRED_IR);
diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf
index 9809352c9b3..8fe9a8941bd 100644
--- a/src/util/00-mesa-defaults.conf
+++ b/src/util/00-mesa-defaults.conf
@@ -766,6 +766,7 @@ TODO: document the other workarounds.
+
diff --git a/src/util/driconf.h b/src/util/driconf.h
index b1faacca096..a2ed0f82d5b 100644
--- a/src/util/driconf.h
+++ b/src/util/driconf.h
@@ -216,6 +216,10 @@
DRI_CONF_OPT_B(allow_draw_out_of_order, def, \
"Allow out-of-order draw optimizations. Set when Z fighting doesn't have to be accurate.")
+#define DRI_CONF_GLTHREAD_NOP_CHECK_FRAMEBUFFER_STATUS(def) \
+ DRI_CONF_OPT_B(glthread_nop_check_framebuffer_status, def, \
+ "glthread always returns GL_FRAMEBUFFER_COMPLETE to prevent synchronization.")
+
#define DRI_CONF_FORCE_GL_VENDOR() \
DRI_CONF_OPT_S_NODEF(force_gl_vendor, "Override GPU vendor string.")