Fix apps expecting name recycling.
https://gitlab.freedesktop.org/mesa/mesa/-/issues/3144 is an example
of such issue, SPECviewperf13 has this problem too.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6600>
DRI_CONF_ALLOW_GLSL_LAYOUT_QUALIFIER_ON_FUNCTION_PARAMETERS("false")
DRI_CONF_ALLOW_DRAW_OUT_OF_ORDER("false")
DRI_CONF_FORCE_COMPAT_PROFILE("false")
+ DRI_CONF_FORCE_GL_NAMES_REUSE("false")
DRI_CONF_FORCE_GL_VENDOR()
DRI_CONF_OVERRIDE_VRAM_SIZE()
DRI_CONF_SECTION_END
driQueryOptionb(optionCache, "allow_glsl_layout_qualifier_on_function_parameters");
options->allow_draw_out_of_order =
driQueryOptionb(optionCache, "allow_draw_out_of_order");
+ options->force_gl_names_reuse =
+ driQueryOptionb(optionCache, "force_gl_names_reuse");
char *vendor_str = driQueryOptionstr(optionCache, "force_gl_vendor");
/* not an empty string */
bool allow_glsl_layout_qualifier_on_function_parameters;
bool allow_draw_out_of_order;
bool force_integer_tex_nearest;
+ bool force_gl_names_reuse;
char *force_gl_vendor;
unsigned char config_options_sha1[20];
};
GLchar GLSLZeroInit;
/**
+ * Force GL names reuse. Needed by SPECviewperf13.
+ */
+ GLboolean ForceGLNamesReuse;
+
+ /**
* Treat integer textures using GL_LINEAR filters as GL_NEAREST.
*/
GLboolean ForceIntegerTexNearest;
st->bitmap.cache.empty = true;
+ if (ctx->Const.ForceGLNamesReuse && ctx->Shared->RefCount == 1) {
+ _mesa_HashEnableNameReuse(ctx->Shared->TexObjects);
+ _mesa_HashEnableNameReuse(ctx->Shared->ShaderObjects);
+ _mesa_HashEnableNameReuse(ctx->Shared->BufferObjects);
+ _mesa_HashEnableNameReuse(ctx->Shared->SamplerObjects);
+ _mesa_HashEnableNameReuse(ctx->Shared->FrameBuffers);
+ _mesa_HashEnableNameReuse(ctx->Shared->RenderBuffers);
+ _mesa_HashEnableNameReuse(ctx->Shared->MemoryObjects);
+ _mesa_HashEnableNameReuse(ctx->Shared->SemaphoreObjects);
+ }
+
_mesa_override_extensions(ctx);
_mesa_compute_version(ctx);
consts->GLSLZeroInit = screen->get_param(screen, PIPE_CAP_GLSL_ZERO_INIT);
}
+ consts->ForceGLNamesReuse = options->force_gl_names_reuse;
+
consts->ForceIntegerTexNearest = options->force_integer_tex_nearest;
consts->VendorOverride = options->force_gl_vendor;
<application name="SPECviewperf13" executable="viewperf">
<option name="allow_glsl_extension_directive_midshader" value="true" />
<option name="allow_glsl_120_subset_in_110" value="true" />
+ <option name="force_gl_names_reuse" value="true" />
</application>
<!-- The GL thread allowlist is below, workarounds are above.
DRI_CONF_DESC("Override the VRAM size advertised to the application in MiB (-1 = default)") \
DRI_CONF_OPT_END
+#define DRI_CONF_FORCE_GL_NAMES_REUSE(def) \
+DRI_CONF_OPT_BEGIN_B(force_gl_names_reuse, def) \
+ DRI_CONF_DESC("Force GL names reuse") \
+DRI_CONF_OPT_END
+
/**
* \brief Image quality-related options
*/