driconf: Add ignore_discard_framebuffer option
Some apps use glDiscardFramebuffer()/glInvalidateFramebuffer() when they only kidding. Add a knob to disable that. Signed-off-by: Rob Clark <robdclark@chromium.org> Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21916>
This commit is contained in:
@@ -52,6 +52,7 @@ DRI_CONF_SECTION_DEBUG
|
|||||||
DRI_CONF_FORCE_DIRECT_GLX_CONTEXT(false)
|
DRI_CONF_FORCE_DIRECT_GLX_CONTEXT(false)
|
||||||
DRI_CONF_ALLOW_INVALID_GLX_DESTROY_WINDOW(false)
|
DRI_CONF_ALLOW_INVALID_GLX_DESTROY_WINDOW(false)
|
||||||
DRI_CONF_KEEP_NATIVE_WINDOW_GLX_DRAWABLE(false)
|
DRI_CONF_KEEP_NATIVE_WINDOW_GLX_DRAWABLE(false)
|
||||||
|
DRI_CONF_IGNORE_DISCARD_FRAMEBUFFER(false)
|
||||||
DRI_CONF_SECTION_END
|
DRI_CONF_SECTION_END
|
||||||
|
|
||||||
DRI_CONF_SECTION_MISCELLANEOUS
|
DRI_CONF_SECTION_MISCELLANEOUS
|
||||||
|
@@ -64,6 +64,7 @@ u_driconf_fill_st_options(struct st_config_options *options,
|
|||||||
query_bool_option(allow_draw_out_of_order);
|
query_bool_option(allow_draw_out_of_order);
|
||||||
query_bool_option(glthread_nop_check_framebuffer_status);
|
query_bool_option(glthread_nop_check_framebuffer_status);
|
||||||
query_bool_option(ignore_map_unsynchronized);
|
query_bool_option(ignore_map_unsynchronized);
|
||||||
|
query_bool_option(ignore_discard_framebuffer);
|
||||||
query_bool_option(force_gl_names_reuse);
|
query_bool_option(force_gl_names_reuse);
|
||||||
query_bool_option(force_gl_map_buffer_synchronized);
|
query_bool_option(force_gl_map_buffer_synchronized);
|
||||||
query_bool_option(transcode_etc);
|
query_bool_option(transcode_etc);
|
||||||
|
@@ -192,6 +192,7 @@ struct st_config_options
|
|||||||
bool allow_draw_out_of_order;
|
bool allow_draw_out_of_order;
|
||||||
bool glthread_nop_check_framebuffer_status;
|
bool glthread_nop_check_framebuffer_status;
|
||||||
bool ignore_map_unsynchronized;
|
bool ignore_map_unsynchronized;
|
||||||
|
bool ignore_discard_framebuffer;
|
||||||
bool force_integer_tex_nearest;
|
bool force_integer_tex_nearest;
|
||||||
bool force_gl_names_reuse;
|
bool force_gl_names_reuse;
|
||||||
bool force_gl_map_buffer_synchronized;
|
bool force_gl_map_buffer_synchronized;
|
||||||
|
@@ -5386,6 +5386,9 @@ discard_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
|
|||||||
{
|
{
|
||||||
uint32_t mask = 0;
|
uint32_t mask = 0;
|
||||||
|
|
||||||
|
if (unlikely(ctx->st_opts->ignore_discard_framebuffer))
|
||||||
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < numAttachments; i++) {
|
for (int i = 0; i < numAttachments; i++) {
|
||||||
GLenum att = attachments[i];
|
GLenum att = attachments[i];
|
||||||
|
|
||||||
|
@@ -306,6 +306,10 @@
|
|||||||
DRI_CONF_OPT_B(no_16bit, def, \
|
DRI_CONF_OPT_B(no_16bit, def, \
|
||||||
"Disable 16-bit instructions")
|
"Disable 16-bit instructions")
|
||||||
|
|
||||||
|
#define DRI_CONF_IGNORE_DISCARD_FRAMEBUFFER(def) \
|
||||||
|
DRI_CONF_OPT_B(ignore_discard_framebuffer, def, \
|
||||||
|
"Ignore glDiscardFramebuffer/glInvalidateFramebuffer, workaround for games that use it incorrectly")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Image quality-related options
|
* \brief Image quality-related options
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user