glthread: add an option to make glCheckFramebufferStatus a no-op

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13403>
This commit is contained in:
Marek Olšák 2021-10-18 08:16:23 -04:00 committed by Marge Bot
parent f4348ef60d
commit c14d755f3d
8 changed files with 18 additions and 1 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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;

View File

@ -220,7 +220,8 @@
<glx vendorpriv="1426" always_array="true"/>
</function>
<function name="CheckFramebufferStatus" es2="2.0" no_error="true">
<function name="CheckFramebufferStatus" es2="2.0" no_error="true"
marshal_call_before="if (ctx->Const.GLThreadNopCheckFramebufferStatus) return GL_FRAMEBUFFER_COMPLETE;">
<param name="target" type="GLenum"/>
<return type="GLenum"/>
<glx vendorpriv="1427"/>

View File

@ -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;
};

View File

@ -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);

View File

@ -766,6 +766,7 @@ TODO: document the other workarounds.
<option name="radeonsi_zerovram" value="true" />
</application>
<application name="SPECviewperf13" executable="viewperf">
<option name="glthread_nop_check_framebuffer_status" value="true" />
<option name="radeonsi_sync_compile" value="true" />
<option name="radeonsi_clamp_div_by_zero" value="true" />
<option name="radeonsi_tc_max_cpu_storage_size" value="1000" />

View File

@ -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.")