diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h index f764916b6303a97a96fd6059af9ca44c990d6089..6975859f466e6fd90e48080911f45512a797263d 100644 --- a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h +++ b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h @@ -41,7 +41,6 @@ DRI_CONF_SECTION_DEBUG DRI_CONF_GLTHREAD_NOP_CHECK_FRAMEBUFFER_STATUS(false) DRI_CONF_FORCE_COMPAT_PROFILE(false) DRI_CONF_FORCE_COMPAT_SHADERS(false) - DRI_CONF_FORCE_GL_NAMES_REUSE(false) DRI_CONF_FORCE_GL_MAP_BUFFER_SYNCHRONIZED(false) DRI_CONF_TRANSCODE_ETC(false) DRI_CONF_TRANSCODE_ASTC(false) diff --git a/src/gallium/auxiliary/util/u_driconf.c b/src/gallium/auxiliary/util/u_driconf.c index 165de18b131c36e30103ca34485cd94118668427..497b8ac98de2f138b38d48f696d2584932409238 100644 --- a/src/gallium/auxiliary/util/u_driconf.c +++ b/src/gallium/auxiliary/util/u_driconf.c @@ -67,7 +67,6 @@ u_driconf_fill_st_options(struct st_config_options *options, query_bool_option(glthread_nop_check_framebuffer_status); query_bool_option(ignore_map_unsynchronized); query_bool_option(ignore_discard_framebuffer); - query_bool_option(force_gl_names_reuse); query_bool_option(force_gl_map_buffer_synchronized); query_bool_option(transcode_etc); query_bool_option(transcode_astc); diff --git a/src/gallium/include/frontend/api.h b/src/gallium/include/frontend/api.h index 712cbe9e47e9775966f02f1a8a665be8d93b0483..abf5d59c9c2eb0f8698177e90506fc98aa33581d 100644 --- a/src/gallium/include/frontend/api.h +++ b/src/gallium/include/frontend/api.h @@ -196,7 +196,6 @@ struct st_config_options bool ignore_map_unsynchronized; bool ignore_discard_framebuffer; bool force_integer_tex_nearest; - bool force_gl_names_reuse; bool force_gl_map_buffer_synchronized; bool transcode_etc; bool transcode_astc; diff --git a/src/mesa/main/consts_exts.h b/src/mesa/main/consts_exts.h index e0a5ed0c930be1d2c4514748ba7a10dc9dbd8f1d..94694055f28b48457969f8ea04b44534e8789889 100644 --- a/src/mesa/main/consts_exts.h +++ b/src/mesa/main/consts_exts.h @@ -677,11 +677,6 @@ struct gl_constants */ GLchar GLSLZeroInit; - /** - * Force GL names reuse. Needed by SPECviewperf13. - */ - GLboolean ForceGLNamesReuse; - /** * Treat integer textures using GL_LINEAR filters as GL_NEAREST. */ diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c index ef6df6eb63c3f3646745c1fb872b90f0f82fa3d0..96e9d651f27c6c410dac4df402bae5f39f5d7340 100644 --- a/src/mesa/main/hash.c +++ b/src/mesa/main/hash.c @@ -86,14 +86,6 @@ _mesa_DeinitHashTable(struct _mesa_HashTable *table, simple_mtx_destroy(&table->Mutex); } -void -_mesa_HashEnableNameReuse(struct _mesa_HashTable *table) -{ - _mesa_HashLockMutex(table); - table->alloc_via_idalloc = true; - _mesa_HashUnlockMutex(table); -} - /** * Insert a key/pointer pair into the hash table without locking the mutex. * If an entry with this key already exists we'll replace the existing entry. @@ -109,10 +101,6 @@ void _mesa_HashInsertLocked(struct _mesa_HashTable *table, GLuint key, void *data) { assert(key); - - if (key > table->MaxKey) - table->MaxKey = key; - *(void**)util_sparse_array_get(&table->array, key) = data; util_idalloc_sparse_reserve(&table->id_alloc, key); @@ -195,61 +183,19 @@ _mesa_HashWalk(struct _mesa_HashTable *table, * \param table the hash table. * \param numKeys number of keys needed. * - * \return Starting key of free block or 0 if failure. - * - * If there are enough free keys between the maximum key existing in the table - * (_mesa_HashTable::MaxKey) and the maximum key possible, then simply return - * the adjacent key. Otherwise do a full search for a free key block in the - * allowable key range. + * \return Starting key of a free block */ GLuint _mesa_HashFindFreeKeyBlock(struct _mesa_HashTable *table, GLuint numKeys) { - const GLuint maxKey = ~((GLuint) 0) - 1; - if (table->alloc_via_idalloc) { - return util_idalloc_sparse_alloc_range(&table->id_alloc, numKeys); - } else if (maxKey - numKeys > table->MaxKey) { - /* the quick solution */ - return table->MaxKey + 1; - } - else { - /* the slow solution */ - GLuint freeCount = 0; - GLuint freeStart = 1; - GLuint key; - for (key = 1; key != maxKey; key++) { - if (_mesa_HashLookupLocked(table, key)) { - /* darn, this key is already in use */ - freeCount = 0; - freeStart = key+1; - } - else { - /* this key not in use, check if we've found enough */ - freeCount++; - if (freeCount == numKeys) { - return freeStart; - } - } - } - /* cannot allocate a block of numKeys consecutive keys */ - return 0; - } + return util_idalloc_sparse_alloc_range(&table->id_alloc, numKeys); } bool _mesa_HashFindFreeKeys(struct _mesa_HashTable *table, GLuint* keys, GLuint numKeys) { - if (!table->alloc_via_idalloc) { - GLuint first = _mesa_HashFindFreeKeyBlock(table, numKeys); - for (int i = 0; i < numKeys; i++) { - keys[i] = first + i; - } - return first != 0; - } - - for (int i = 0; i < numKeys; i++) { + for (int i = 0; i < numKeys; i++) keys[i] = util_idalloc_sparse_alloc(&table->id_alloc); - } return true; } diff --git a/src/mesa/main/hash.h b/src/mesa/main/hash.h index f9f0afeeb3f97edd0c3d9b3fe04faa97336798d9..3c4d852dcaca7192dc63d7d85f07498ce4a0ce92 100644 --- a/src/mesa/main/hash.h +++ b/src/mesa/main/hash.h @@ -46,11 +46,8 @@ */ struct _mesa_HashTable { struct util_sparse_array array; - simple_mtx_t Mutex; - GLuint MaxKey; /**< highest key inserted so far */ - bool alloc_via_idalloc; - /* Used when name reuse is enabled */ struct util_idalloc_sparse id_alloc; + simple_mtx_t Mutex; }; void @@ -90,9 +87,6 @@ bool _mesa_HashFindFreeKeys(struct _mesa_HashTable *table, GLuint* keys, GLuint numKeys); -void -_mesa_HashEnableNameReuse(struct _mesa_HashTable *table); - /* Inline functions. */ /** diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index a13657b25d6e992aa1e2486f19325751bfad4d70..394679636a9cc47b09049862126452c8597e16ff 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -723,24 +723,6 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe, 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); - } - /* SPECviewperf13/sw-04 crashes since a56849ddda6 if Mesa is build with - * -O3 on gcc 7.5, which doesn't happen with ForceGLNamesReuse, which is - * the default setting for SPECviewperf because it simulates glGen behavior - * of closed source drivers. - */ - if (ctx->Const.ForceGLNamesReuse) - _mesa_HashEnableNameReuse(&ctx->Query.QueryObjects); - _mesa_override_extensions(ctx); _mesa_compute_version(ctx); diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 650c831f9925eabed1a5eeff4513730f92900dd5..03829a2e603e1139ee541d243bab9187951a6252 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -1326,8 +1326,6 @@ void st_init_extensions(struct pipe_screen *screen, 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; diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf index 3de1fb510087c279d228c5e9c8d7aed20be097e9..3733382db767805fce2ab6f204f46fdb703bdac3 100644 --- a/src/util/00-mesa-defaults.conf +++ b/src/util/00-mesa-defaults.conf @@ -384,7 +384,6 @@ TODO: document the other workarounds. <option name="vblank_mode" value="0" /> <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" /> <!-- This makes it use GL_NVX_gpu_memory_info to query memory info instead of non-existent GLX_AMD_gpu_association. Yes, it checks the vendor string, not the extension list. --> @@ -884,14 +883,6 @@ TODO: document the other workarounds. <option name="glsl_correct_derivatives_after_discard" value="true" /> </application> - <!-- Workaround for STAR WARS: Knights of the Old Republic relying on - non-specified OpenGL behavior (expecting texture names to be - small enough to fit in the static array). - --> - <application name="SWKOTOR (wine)" executable="swkotor.exe"> - <option name="force_gl_names_reuse" value="true"/> - </application> - <application name="Assault Android Cactus (32-bit)" executable="cactus_demo.x86"> <option name="vs_position_always_precise" value="true" /> </application> diff --git a/src/util/driconf.h b/src/util/driconf.h index 37107a11aef982d361df9186acf44d3d96acc7a8..7317f81d2ad6dc1ffd95954893831b3bf7742ba3 100644 --- a/src/util/driconf.h +++ b/src/util/driconf.h @@ -269,9 +269,6 @@ DRI_CONF_OPT_I(override_vram_size, -1, -1, 2147483647, \ "Override the VRAM size advertised to the application in MiB (-1 = default)") -#define DRI_CONF_FORCE_GL_NAMES_REUSE(def) \ - DRI_CONF_OPT_B(force_gl_names_reuse, def, "Force GL names reuse") - #define DRI_CONF_FORCE_GL_MAP_BUFFER_SYNCHRONIZED(def) \ DRI_CONF_OPT_B(force_gl_map_buffer_synchronized, def, "Override GL_MAP_UNSYNCHRONIZED_BIT.")