mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
mesa: remove isGenName parameter from _mesa_HashInsert
Make it behave like it's always true. There is no disadvantage in keeping it always true, but when it's incorrectly false, things break. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27494>
This commit is contained in:
parent
1acfc0fc8e
commit
19111ea8e6
19 changed files with 48 additions and 68 deletions
|
|
@ -79,7 +79,6 @@ lookup_or_create_program(GLuint id, GLenum target, const char* caller)
|
|||
/* Bind a user program */
|
||||
newProg = _mesa_lookup_program(ctx, id);
|
||||
if (!newProg || newProg == &_mesa_DummyProgram) {
|
||||
bool isGenName = newProg != NULL;
|
||||
/* allocate a new program now */
|
||||
newProg = ctx->Driver.NewProgram(ctx, _mesa_program_enum_to_shader_stage(target),
|
||||
id, true);
|
||||
|
|
@ -87,7 +86,7 @@ lookup_or_create_program(GLuint id, GLenum target, const char* caller)
|
|||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", caller);
|
||||
return NULL;
|
||||
}
|
||||
_mesa_HashInsert(&ctx->Shared->Programs, id, newProg, isGenName);
|
||||
_mesa_HashInsert(&ctx->Shared->Programs, id, newProg);
|
||||
}
|
||||
else if (newProg->Target != target) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
|
|
@ -239,7 +238,7 @@ _mesa_GenProgramsARB(GLsizei n, GLuint *ids)
|
|||
/* Insert pointer to dummy program as placeholder */
|
||||
for (i = 0; i < (GLuint) n; i++) {
|
||||
_mesa_HashInsertLocked(&ctx->Shared->Programs, ids[i],
|
||||
&_mesa_DummyProgram, true);
|
||||
&_mesa_DummyProgram);
|
||||
}
|
||||
|
||||
_mesa_HashUnlockMutex(&ctx->Shared->Programs);
|
||||
|
|
|
|||
|
|
@ -1048,7 +1048,7 @@ gen_vertex_arrays(struct gl_context *ctx, GLsizei n, GLuint *arrays,
|
|||
return;
|
||||
}
|
||||
obj->EverBound = create;
|
||||
_mesa_HashInsertLocked(&ctx->Array.Objects, obj->Name, obj, true);
|
||||
_mesa_HashInsertLocked(&ctx->Array.Objects, obj->Name, obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ _mesa_GenFragmentShadersATI(GLuint range)
|
|||
|
||||
first = _mesa_HashFindFreeKeyBlock(&ctx->Shared->ATIShaders, range);
|
||||
for (i = 0; i < range; i++) {
|
||||
_mesa_HashInsertLocked(&ctx->Shared->ATIShaders, first + i, &DummyShader, true);
|
||||
_mesa_HashInsertLocked(&ctx->Shared->ATIShaders, first + i, &DummyShader);
|
||||
}
|
||||
|
||||
_mesa_HashUnlockMutex(&ctx->Shared->ATIShaders);
|
||||
|
|
@ -259,10 +259,8 @@ _mesa_BindFragmentShaderATI(GLuint id)
|
|||
newProg = ctx->Shared->DefaultFragmentShader;
|
||||
}
|
||||
else {
|
||||
bool isGenName;
|
||||
newProg = (struct ati_fragment_shader *)
|
||||
_mesa_HashLookup(&ctx->Shared->ATIShaders, id);
|
||||
isGenName = newProg != NULL;
|
||||
if (!newProg || newProg == &DummyShader) {
|
||||
/* allocate a new program now */
|
||||
newProg = _mesa_new_ati_fragment_shader(ctx, id);
|
||||
|
|
@ -270,7 +268,7 @@ _mesa_BindFragmentShaderATI(GLuint id)
|
|||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindFragmentShaderATI");
|
||||
return;
|
||||
}
|
||||
_mesa_HashInsert(&ctx->Shared->ATIShaders, id, newProg, isGenName);
|
||||
_mesa_HashInsert(&ctx->Shared->ATIShaders, id, newProg);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1298,7 +1298,7 @@ handle_bind_buffer_gen(struct gl_context *ctx,
|
|||
_mesa_HashLockMaybeLocked(&ctx->Shared->BufferObjects,
|
||||
ctx->BufferObjectsLocked);
|
||||
_mesa_HashInsertLocked(&ctx->Shared->BufferObjects, buffer,
|
||||
*buf_handle, buf != NULL);
|
||||
*buf_handle);
|
||||
/* If one context only creates buffers and another context only deletes
|
||||
* buffers, buffers don't get released because it only produces zombie
|
||||
* buffers. Only the context that has created the buffers can release
|
||||
|
|
@ -1981,7 +1981,7 @@ create_buffers(struct gl_context *ctx, GLsizei n, GLuint *buffers, bool dsa)
|
|||
else
|
||||
buf = &DummyBufferObject;
|
||||
|
||||
_mesa_HashInsertLocked(&ctx->Shared->BufferObjects, buffers[i], buf, true);
|
||||
_mesa_HashInsertLocked(&ctx->Shared->BufferObjects, buffers[i], buf);
|
||||
}
|
||||
|
||||
_mesa_HashUnlockMaybeLocked(&ctx->Shared->BufferObjects,
|
||||
|
|
|
|||
|
|
@ -13147,7 +13147,7 @@ _mesa_GenLists(GLsizei range)
|
|||
GLint i;
|
||||
for (i = 0; i < range; i++) {
|
||||
_mesa_HashInsertLocked(&ctx->Shared->DisplayList, base + i,
|
||||
make_list(base + i, 1), true);
|
||||
make_list(base + i, 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -13401,7 +13401,7 @@ _mesa_EndList(void)
|
|||
/* Install the new list */
|
||||
_mesa_HashInsertLocked(&ctx->Shared->DisplayList,
|
||||
ctx->ListState.CurrentList->Name,
|
||||
ctx->ListState.CurrentList, false);
|
||||
ctx->ListState.CurrentList);
|
||||
|
||||
if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
|
||||
mesa_print_display_list(ctx->ListState.CurrentList->Name);
|
||||
|
|
|
|||
|
|
@ -218,9 +218,8 @@ _mesa_CreateMemoryObjectsEXT(GLsizei n, GLuint *memoryObjects)
|
|||
}
|
||||
|
||||
/* insert into hash table */
|
||||
_mesa_HashInsertLocked(&ctx->Shared->MemoryObjects,
|
||||
memoryObjects[i],
|
||||
memObj, true);
|
||||
_mesa_HashInsertLocked(&ctx->Shared->MemoryObjects, memoryObjects[i],
|
||||
memObj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -787,8 +786,8 @@ _mesa_GenSemaphoresEXT(GLsizei n, GLuint *semaphores)
|
|||
_mesa_HashLockMutex(&ctx->Shared->SemaphoreObjects);
|
||||
if (_mesa_HashFindFreeKeys(&ctx->Shared->SemaphoreObjects, semaphores, n)) {
|
||||
for (GLsizei i = 0; i < n; i++) {
|
||||
_mesa_HashInsertLocked(&ctx->Shared->SemaphoreObjects,
|
||||
semaphores[i], &DummySemaphoreObject, true);
|
||||
_mesa_HashInsertLocked(&ctx->Shared->SemaphoreObjects, semaphores[i],
|
||||
&DummySemaphoreObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1163,7 +1162,7 @@ _mesa_ImportSemaphoreFdEXT(GLuint semaphore,
|
|||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
|
||||
return;
|
||||
}
|
||||
_mesa_HashInsert(&ctx->Shared->SemaphoreObjects, semaphore, semObj, true);
|
||||
_mesa_HashInsert(&ctx->Shared->SemaphoreObjects, semaphore, semObj);
|
||||
}
|
||||
|
||||
import_semaphoreobj_fd(ctx, semObj, fd);
|
||||
|
|
@ -1205,7 +1204,7 @@ _mesa_ImportSemaphoreWin32HandleEXT(GLuint semaphore,
|
|||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
|
||||
return;
|
||||
}
|
||||
_mesa_HashInsert(&ctx->Shared->SemaphoreObjects, semaphore, semObj, true);
|
||||
_mesa_HashInsert(&ctx->Shared->SemaphoreObjects, semaphore, semObj);
|
||||
}
|
||||
|
||||
enum pipe_fd_type type = handleType == GL_HANDLE_TYPE_D3D12_FENCE_EXT ?
|
||||
|
|
@ -1249,7 +1248,7 @@ _mesa_ImportSemaphoreWin32NameEXT(GLuint semaphore,
|
|||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
|
||||
return;
|
||||
}
|
||||
_mesa_HashInsert(&ctx->Shared->SemaphoreObjects, semaphore, semObj, true);
|
||||
_mesa_HashInsert(&ctx->Shared->SemaphoreObjects, semaphore, semObj);
|
||||
}
|
||||
|
||||
enum pipe_fd_type type = handleType == GL_HANDLE_TYPE_D3D12_FENCE_EXT ?
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ _mesa_lookup_framebuffer_dsa(struct gl_context *ctx, GLuint id,
|
|||
/* Name exists but buffer is not initialized */
|
||||
if (fb == &DummyFramebuffer) {
|
||||
fb = _mesa_new_framebuffer(ctx, id);
|
||||
_mesa_HashInsert(&ctx->Shared->FrameBuffers, id, fb, true);
|
||||
_mesa_HashInsert(&ctx->Shared->FrameBuffers, id, fb);
|
||||
}
|
||||
/* Name doesn't exist */
|
||||
else if (!fb) {
|
||||
|
|
@ -187,7 +187,7 @@ _mesa_lookup_framebuffer_dsa(struct gl_context *ctx, GLuint id,
|
|||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
|
||||
return NULL;
|
||||
}
|
||||
_mesa_HashInsert(&ctx->Shared->FrameBuffers, id, fb, false);
|
||||
_mesa_HashInsert(&ctx->Shared->FrameBuffers, id, fb);
|
||||
}
|
||||
return fb;
|
||||
}
|
||||
|
|
@ -1736,7 +1736,6 @@ _mesa_IsRenderbuffer(GLuint renderbuffer)
|
|||
|
||||
static struct gl_renderbuffer *
|
||||
allocate_renderbuffer_locked(struct gl_context *ctx, GLuint renderbuffer,
|
||||
bool isGenName,
|
||||
const char *func)
|
||||
{
|
||||
struct gl_renderbuffer *newRb;
|
||||
|
|
@ -1749,7 +1748,7 @@ allocate_renderbuffer_locked(struct gl_context *ctx, GLuint renderbuffer,
|
|||
}
|
||||
assert(newRb->AllocStorage);
|
||||
_mesa_HashInsertLocked(&ctx->Shared->RenderBuffers, renderbuffer,
|
||||
newRb, isGenName);
|
||||
newRb);
|
||||
|
||||
return newRb;
|
||||
}
|
||||
|
|
@ -1771,12 +1770,10 @@ bind_renderbuffer(GLenum target, GLuint renderbuffer)
|
|||
*/
|
||||
|
||||
if (renderbuffer) {
|
||||
bool isGenName = false;
|
||||
newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
|
||||
if (newRb == &DummyRenderbuffer) {
|
||||
/* ID was reserved, but no real renderbuffer object made yet */
|
||||
newRb = NULL;
|
||||
isGenName = true;
|
||||
}
|
||||
else if (!newRb && _mesa_is_desktop_gl_core(ctx)) {
|
||||
/* All RB IDs must be Gen'd */
|
||||
|
|
@ -1788,7 +1785,7 @@ bind_renderbuffer(GLenum target, GLuint renderbuffer)
|
|||
if (!newRb) {
|
||||
_mesa_HashLockMutex(&ctx->Shared->RenderBuffers);
|
||||
newRb = allocate_renderbuffer_locked(ctx, renderbuffer,
|
||||
isGenName, "glBindRenderbufferEXT");
|
||||
"glBindRenderbufferEXT");
|
||||
_mesa_HashUnlockMutex(&ctx->Shared->RenderBuffers);
|
||||
}
|
||||
}
|
||||
|
|
@ -2256,11 +2253,11 @@ create_render_buffers(struct gl_context *ctx, GLsizei n, GLuint *renderbuffers,
|
|||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (dsa) {
|
||||
allocate_renderbuffer_locked(ctx, renderbuffers[i], true, func);
|
||||
allocate_renderbuffer_locked(ctx, renderbuffers[i], func);
|
||||
} else {
|
||||
/* insert a dummy renderbuffer into the hash table */
|
||||
_mesa_HashInsertLocked(&ctx->Shared->RenderBuffers, renderbuffers[i],
|
||||
&DummyRenderbuffer, true);
|
||||
&DummyRenderbuffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3013,7 +3010,7 @@ _mesa_NamedRenderbufferStorageEXT(GLuint renderbuffer, GLenum internalformat,
|
|||
struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
|
||||
if (!rb || rb == &DummyRenderbuffer) {
|
||||
_mesa_HashLockMutex(&ctx->Shared->RenderBuffers);
|
||||
rb = allocate_renderbuffer_locked(ctx, renderbuffer, rb != NULL,
|
||||
rb = allocate_renderbuffer_locked(ctx, renderbuffer,
|
||||
"glNamedRenderbufferStorageEXT");
|
||||
_mesa_HashUnlockMutex(&ctx->Shared->RenderBuffers);
|
||||
}
|
||||
|
|
@ -3042,7 +3039,7 @@ _mesa_NamedRenderbufferStorageMultisampleEXT(GLuint renderbuffer, GLsizei sample
|
|||
struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
|
||||
if (!rb || rb == &DummyRenderbuffer) {
|
||||
_mesa_HashLockMutex(&ctx->Shared->RenderBuffers);
|
||||
rb = allocate_renderbuffer_locked(ctx, renderbuffer, rb != NULL,
|
||||
rb = allocate_renderbuffer_locked(ctx, renderbuffer,
|
||||
"glNamedRenderbufferStorageMultisampleEXT");
|
||||
_mesa_HashUnlockMutex(&ctx->Shared->RenderBuffers);
|
||||
}
|
||||
|
|
@ -3160,7 +3157,7 @@ _mesa_GetNamedRenderbufferParameterivEXT(GLuint renderbuffer, GLenum pname,
|
|||
struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
|
||||
if (!rb || rb == &DummyRenderbuffer) {
|
||||
_mesa_HashLockMutex(&ctx->Shared->RenderBuffers);
|
||||
rb = allocate_renderbuffer_locked(ctx, renderbuffer, rb != NULL,
|
||||
rb = allocate_renderbuffer_locked(ctx, renderbuffer,
|
||||
"glGetNamedRenderbufferParameterivEXT");
|
||||
_mesa_HashUnlockMutex(&ctx->Shared->RenderBuffers);
|
||||
}
|
||||
|
|
@ -3255,13 +3252,11 @@ bind_framebuffer(GLenum target, GLuint framebuffer)
|
|||
}
|
||||
|
||||
if (framebuffer) {
|
||||
bool isGenName = false;
|
||||
/* Binding a user-created framebuffer object */
|
||||
newDrawFb = _mesa_lookup_framebuffer(ctx, framebuffer);
|
||||
if (newDrawFb == &DummyFramebuffer) {
|
||||
/* ID was reserved, but no real framebuffer object made yet */
|
||||
newDrawFb = NULL;
|
||||
isGenName = true;
|
||||
}
|
||||
else if (!newDrawFb && _mesa_is_desktop_gl_core(ctx)) {
|
||||
/* All FBO IDs must be Gen'd */
|
||||
|
|
@ -3277,7 +3272,7 @@ bind_framebuffer(GLenum target, GLuint framebuffer)
|
|||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindFramebufferEXT");
|
||||
return;
|
||||
}
|
||||
_mesa_HashInsert(&ctx->Shared->FrameBuffers, framebuffer, newDrawFb, isGenName);
|
||||
_mesa_HashInsert(&ctx->Shared->FrameBuffers, framebuffer, newDrawFb);
|
||||
}
|
||||
newReadFb = newDrawFb;
|
||||
}
|
||||
|
|
@ -3446,8 +3441,7 @@ create_framebuffers(GLsizei n, GLuint *framebuffers, bool dsa)
|
|||
else
|
||||
fb = &DummyFramebuffer;
|
||||
|
||||
_mesa_HashInsertLocked(&ctx->Shared->FrameBuffers, framebuffers[i],
|
||||
fb, true);
|
||||
_mesa_HashInsertLocked(&ctx->Shared->FrameBuffers, framebuffers[i], fb);
|
||||
}
|
||||
|
||||
_mesa_HashUnlockMutex(&ctx->Shared->FrameBuffers);
|
||||
|
|
@ -5050,7 +5044,7 @@ lookup_named_framebuffer_ext_dsa(struct gl_context *ctx, GLuint framebuffer, con
|
|||
/* Then, make sure it's initialized */
|
||||
if (fb == &DummyFramebuffer) {
|
||||
fb = _mesa_new_framebuffer(ctx, framebuffer);
|
||||
_mesa_HashInsert(&ctx->Shared->FrameBuffers, framebuffer, fb, true);
|
||||
_mesa_HashInsert(&ctx->Shared->FrameBuffers, framebuffer, fb);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ _mesa_glthread_GenVertexArrays(struct gl_context *ctx,
|
|||
|
||||
vao->Name = id;
|
||||
_mesa_glthread_reset_vao(vao);
|
||||
_mesa_HashInsertLocked(&glthread->VAOs, id, vao, true);
|
||||
_mesa_HashInsertLocked(&glthread->VAOs, id, vao);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -212,11 +212,9 @@ _mesa_HashLookup(struct _mesa_HashTable *table, GLuint key)
|
|||
* \param table the hash table.
|
||||
* \param key the key (not zero).
|
||||
* \param data pointer to user data.
|
||||
* \param isGenName true if the key has been generated by a HashFindFreeKey* function
|
||||
*/
|
||||
void
|
||||
_mesa_HashInsertLocked(struct _mesa_HashTable *table, GLuint key, void *data,
|
||||
GLboolean isGenName)
|
||||
_mesa_HashInsertLocked(struct _mesa_HashTable *table, GLuint key, void *data)
|
||||
{
|
||||
uint32_t hash = uint_hash(key);
|
||||
struct hash_entry *entry;
|
||||
|
|
@ -237,8 +235,7 @@ _mesa_HashInsertLocked(struct _mesa_HashTable *table, GLuint key, void *data,
|
|||
}
|
||||
}
|
||||
|
||||
if (!isGenName)
|
||||
util_idalloc_reserve(&table->id_alloc, key);
|
||||
util_idalloc_reserve(&table->id_alloc, key);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -248,14 +245,12 @@ _mesa_HashInsertLocked(struct _mesa_HashTable *table, GLuint key, void *data,
|
|||
* \param table the hash table.
|
||||
* \param key the key (not zero).
|
||||
* \param data pointer to user data.
|
||||
* \param isGenName true if the key has been generated by a HashFindFreeKey* function
|
||||
*/
|
||||
void
|
||||
_mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data,
|
||||
GLboolean isGenName)
|
||||
_mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data)
|
||||
{
|
||||
_mesa_HashLockMutex(table);
|
||||
_mesa_HashInsertLocked(table, key, data, isGenName);
|
||||
_mesa_HashInsertLocked(table, key, data);
|
||||
_mesa_HashUnlockMutex(table);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,8 +64,7 @@ void *
|
|||
_mesa_HashLookup(struct _mesa_HashTable *table, GLuint key);
|
||||
|
||||
void
|
||||
_mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data,
|
||||
GLboolean isGenName);
|
||||
_mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data);
|
||||
|
||||
void
|
||||
_mesa_HashRemove(struct _mesa_HashTable *table, GLuint key);
|
||||
|
|
@ -74,8 +73,7 @@ void *
|
|||
_mesa_HashLookupLocked(struct _mesa_HashTable *table, GLuint key);
|
||||
|
||||
void
|
||||
_mesa_HashInsertLocked(struct _mesa_HashTable *table,
|
||||
GLuint key, void *data, GLboolean isGenName);
|
||||
_mesa_HashInsertLocked(struct _mesa_HashTable *table, GLuint key, void *data);
|
||||
|
||||
void
|
||||
_mesa_HashRemoveLocked(struct _mesa_HashTable *table, GLuint key);
|
||||
|
|
|
|||
|
|
@ -743,7 +743,7 @@ _mesa_GenPerfMonitorsAMD(GLsizei n, GLuint *monitors)
|
|||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenPerfMonitorsAMD");
|
||||
return;
|
||||
}
|
||||
_mesa_HashInsert(&ctx->PerfMonitor.Monitors, monitors[i], m, true);
|
||||
_mesa_HashInsert(&ctx->PerfMonitor.Monitors, monitors[i], m);
|
||||
}
|
||||
} else {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenPerfMonitorsAMD");
|
||||
|
|
|
|||
|
|
@ -512,7 +512,7 @@ _mesa_CreatePerfQueryINTEL(GLuint queryId, GLuint *queryHandle)
|
|||
obj->Active = false;
|
||||
obj->Ready = false;
|
||||
|
||||
_mesa_HashInsert(&ctx->PerfQuery.Objects, id, obj, true);
|
||||
_mesa_HashInsert(&ctx->PerfQuery.Objects, id, obj);
|
||||
*queryHandle = id;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ static void
|
|||
save_pipeline_object(struct gl_context *ctx, struct gl_pipeline_object *obj)
|
||||
{
|
||||
if (obj->Name > 0) {
|
||||
_mesa_HashInsertLocked(&ctx->Pipeline.Objects, obj->Name, obj, true);
|
||||
_mesa_HashInsertLocked(&ctx->Pipeline.Objects, obj->Name, obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -598,7 +598,7 @@ create_queries(struct gl_context *ctx, GLenum target, GLsizei n, GLuint *ids,
|
|||
q->Target = target;
|
||||
q->EverBound = GL_TRUE;
|
||||
}
|
||||
_mesa_HashInsertLocked(&ctx->Query.QueryObjects, ids[i], q, true);
|
||||
_mesa_HashInsertLocked(&ctx->Query.QueryObjects, ids[i], q);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -768,7 +768,7 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
|
|||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBeginQuery{Indexed}");
|
||||
return;
|
||||
}
|
||||
_mesa_HashInsertLocked(&ctx->Query.QueryObjects, id, q, false);
|
||||
_mesa_HashInsertLocked(&ctx->Query.QueryObjects, id, q);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -910,7 +910,7 @@ _mesa_QueryCounter(GLuint id, GLenum target)
|
|||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glQueryCounter");
|
||||
return;
|
||||
}
|
||||
_mesa_HashInsertLocked(&ctx->Query.QueryObjects, id, q, false);
|
||||
_mesa_HashInsertLocked(&ctx->Query.QueryObjects, id, q);
|
||||
}
|
||||
else {
|
||||
if (q->Target && q->Target != GL_TIMESTAMP) {
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ create_samplers(struct gl_context *ctx, GLsizei count, GLuint *samplers,
|
|||
}
|
||||
|
||||
_mesa_HashInsertLocked(&ctx->Shared->SamplerObjects, samplers[i],
|
||||
sampObj, true);
|
||||
sampObj);
|
||||
}
|
||||
|
||||
_mesa_HashUnlockMutex(&ctx->Shared->SamplerObjects);
|
||||
|
|
|
|||
|
|
@ -416,7 +416,7 @@ create_shader(struct gl_context *ctx, GLenum type)
|
|||
name = _mesa_HashFindFreeKeyBlock(&ctx->Shared->ShaderObjects, 1);
|
||||
sh = _mesa_new_shader(name, _mesa_shader_enum_to_shader_stage(type));
|
||||
sh->Type = type;
|
||||
_mesa_HashInsertLocked(&ctx->Shared->ShaderObjects, name, sh, true);
|
||||
_mesa_HashInsertLocked(&ctx->Shared->ShaderObjects, name, sh);
|
||||
_mesa_HashUnlockMutex(&ctx->Shared->ShaderObjects);
|
||||
|
||||
return name;
|
||||
|
|
@ -448,7 +448,7 @@ create_shader_program(struct gl_context *ctx)
|
|||
|
||||
shProg = _mesa_new_shader_program(name);
|
||||
|
||||
_mesa_HashInsertLocked(&ctx->Shared->ShaderObjects, name, shProg, true);
|
||||
_mesa_HashInsertLocked(&ctx->Shared->ShaderObjects, name, shProg);
|
||||
|
||||
assert(shProg->RefCount == 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -3065,9 +3065,7 @@ lookup_texture_ext_dsa(struct gl_context *ctx, GLenum target, GLuint texture,
|
|||
texObj = ctx->Shared->DefaultTex[targetIndex];
|
||||
assert(texObj);
|
||||
} else {
|
||||
bool isGenName;
|
||||
texObj = _mesa_lookup_texture(ctx, texture);
|
||||
isGenName = texObj != NULL;
|
||||
if (!texObj && _mesa_is_desktop_gl_core(ctx)) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-gen name)", caller);
|
||||
return NULL;
|
||||
|
|
@ -3081,7 +3079,7 @@ lookup_texture_ext_dsa(struct gl_context *ctx, GLenum target, GLuint texture,
|
|||
}
|
||||
|
||||
/* insert into hash table */
|
||||
_mesa_HashInsert(&ctx->Shared->TexObjects, texObj->Name, texObj, isGenName);
|
||||
_mesa_HashInsert(&ctx->Shared->TexObjects, texObj->Name, texObj);
|
||||
}
|
||||
|
||||
if (texObj->Target != boundTarget) {
|
||||
|
|
|
|||
|
|
@ -1295,7 +1295,7 @@ create_textures(struct gl_context *ctx, GLenum target,
|
|||
}
|
||||
|
||||
/* insert into hash table */
|
||||
_mesa_HashInsertLocked(&ctx->Shared->TexObjects, texObj->Name, texObj, true);
|
||||
_mesa_HashInsertLocked(&ctx->Shared->TexObjects, texObj->Name, texObj);
|
||||
}
|
||||
|
||||
_mesa_HashUnlockMutex(&ctx->Shared->TexObjects);
|
||||
|
|
@ -1792,7 +1792,7 @@ _mesa_lookup_or_create_texture(struct gl_context *ctx, GLenum target,
|
|||
}
|
||||
|
||||
/* and insert it into hash table */
|
||||
_mesa_HashInsert(&ctx->Shared->TexObjects, texName, newTexObj, false);
|
||||
_mesa_HashInsert(&ctx->Shared->TexObjects, texName, newTexObj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1076,8 +1076,7 @@ create_transform_feedbacks(struct gl_context *ctx, GLsizei n, GLuint *ids,
|
|||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
|
||||
return;
|
||||
}
|
||||
_mesa_HashInsertLocked(&ctx->TransformFeedback.Objects, ids[i],
|
||||
obj, true);
|
||||
_mesa_HashInsertLocked(&ctx->TransformFeedback.Objects, ids[i], obj);
|
||||
if (dsa) {
|
||||
/* this is normally done at bind time in the non-dsa case */
|
||||
obj->EverBound = GL_TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue