summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/shared.c3
-rw-r--r--src/mesa/main/syncobj.c12
-rw-r--r--src/mesa/main/vdpau.c17
3 files changed, 14 insertions, 18 deletions
diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index 2389c13159e..ccf5355f3c4 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -119,7 +119,8 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
shared->FrameBuffers = _mesa_NewHashTable();
shared->RenderBuffers = _mesa_NewHashTable();
- shared->SyncObjects = _mesa_set_create(NULL, _mesa_key_pointer_equal);
+ shared->SyncObjects = _mesa_set_create(NULL, _mesa_hash_pointer,
+ _mesa_key_pointer_equal);
return shared;
}
diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c
index 8832775ebb8..c1b2d3bed54 100644
--- a/src/mesa/main/syncobj.c
+++ b/src/mesa/main/syncobj.c
@@ -173,9 +173,7 @@ _mesa_validate_sync(struct gl_context *ctx,
const struct gl_sync_object *syncObj)
{
return (syncObj != NULL)
- && _mesa_set_search(ctx->Shared->SyncObjects,
- _mesa_hash_pointer(syncObj),
- syncObj) != NULL
+ && _mesa_set_search(ctx->Shared->SyncObjects, syncObj) != NULL
&& (syncObj->Type == GL_SYNC_FENCE)
&& !syncObj->DeletePending;
}
@@ -198,9 +196,7 @@ _mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj)
mtx_lock(&ctx->Shared->Mutex);
syncObj->RefCount--;
if (syncObj->RefCount == 0) {
- entry = _mesa_set_search(ctx->Shared->SyncObjects,
- _mesa_hash_pointer(syncObj),
- syncObj);
+ entry = _mesa_set_search(ctx->Shared->SyncObjects, syncObj);
assert (entry != NULL);
_mesa_set_remove(ctx->Shared->SyncObjects, entry);
mtx_unlock(&ctx->Shared->Mutex);
@@ -289,9 +285,7 @@ _mesa_FenceSync(GLenum condition, GLbitfield flags)
ctx->Driver.FenceSync(ctx, syncObj, condition, flags);
mtx_lock(&ctx->Shared->Mutex);
- _mesa_set_add(ctx->Shared->SyncObjects,
- _mesa_hash_pointer(syncObj),
- syncObj);
+ _mesa_set_add(ctx->Shared->SyncObjects, syncObj);
mtx_unlock(&ctx->Shared->Mutex);
return (GLsync) syncObj;
diff --git a/src/mesa/main/vdpau.c b/src/mesa/main/vdpau.c
index 89d731b6e74..0efa56e4f41 100644
--- a/src/mesa/main/vdpau.c
+++ b/src/mesa/main/vdpau.c
@@ -73,7 +73,8 @@ _mesa_VDPAUInitNV(const GLvoid *vdpDevice, const GLvoid *getProcAddress)
ctx->vdpDevice = vdpDevice;
ctx->vdpGetProcAddress = getProcAddress;
- ctx->vdpSurfaces = _mesa_set_create(NULL, _mesa_key_pointer_equal);
+ ctx->vdpSurfaces = _mesa_set_create(NULL, _mesa_hash_pointer,
+ _mesa_key_pointer_equal);
}
static void
@@ -179,7 +180,7 @@ register_surface(struct gl_context *ctx, GLboolean isOutput,
_mesa_reference_texobj(&surf->textures[i], tex);
}
- _mesa_set_add(ctx->vdpSurfaces, _mesa_hash_pointer(surf), surf);
+ _mesa_set_add(ctx->vdpSurfaces, surf);
return (GLintptr)surf;
}
@@ -227,7 +228,7 @@ _mesa_VDPAUIsSurfaceNV(GLintptr surface)
return false;
}
- if (!_mesa_set_search(ctx->vdpSurfaces, _mesa_hash_pointer(surf), surf)) {
+ if (!_mesa_set_search(ctx->vdpSurfaces, surf)) {
return false;
}
@@ -251,7 +252,7 @@ _mesa_VDPAUUnregisterSurfaceNV(GLintptr surface)
if (surface == 0)
return;
- entry = _mesa_set_search(ctx->vdpSurfaces, _mesa_hash_pointer(surf), surf);
+ entry = _mesa_set_search(ctx->vdpSurfaces, surf);
if (!entry) {
_mesa_error(ctx, GL_INVALID_VALUE, "VDPAUUnregisterSurfaceNV");
return;
@@ -280,7 +281,7 @@ _mesa_VDPAUGetSurfaceivNV(GLintptr surface, GLenum pname, GLsizei bufSize,
return;
}
- if (!_mesa_set_search(ctx->vdpSurfaces, _mesa_hash_pointer(surf), surf)) {
+ if (!_mesa_set_search(ctx->vdpSurfaces, surf)) {
_mesa_error(ctx, GL_INVALID_VALUE, "VDPAUGetSurfaceivNV");
return;
}
@@ -312,7 +313,7 @@ _mesa_VDPAUSurfaceAccessNV(GLintptr surface, GLenum access)
return;
}
- if (!_mesa_set_search(ctx->vdpSurfaces, _mesa_hash_pointer(surf), surf)) {
+ if (!_mesa_set_search(ctx->vdpSurfaces, surf)) {
_mesa_error(ctx, GL_INVALID_VALUE, "VDPAUSurfaceAccessNV");
return;
}
@@ -346,7 +347,7 @@ _mesa_VDPAUMapSurfacesNV(GLsizei numSurfaces, const GLintptr *surfaces)
for (i = 0; i < numSurfaces; ++i) {
struct vdp_surface *surf = (struct vdp_surface *)surfaces[i];
- if (!_mesa_set_search(ctx->vdpSurfaces, _mesa_hash_pointer(surf), surf)) {
+ if (!_mesa_set_search(ctx->vdpSurfaces, surf)) {
_mesa_error(ctx, GL_INVALID_VALUE, "VDPAUSurfaceAccessNV");
return;
}
@@ -400,7 +401,7 @@ _mesa_VDPAUUnmapSurfacesNV(GLsizei numSurfaces, const GLintptr *surfaces)
for (i = 0; i < numSurfaces; ++i) {
struct vdp_surface *surf = (struct vdp_surface *)surfaces[i];
- if (!_mesa_set_search(ctx->vdpSurfaces, _mesa_hash_pointer(surf), surf)) {
+ if (!_mesa_set_search(ctx->vdpSurfaces, surf)) {
_mesa_error(ctx, GL_INVALID_VALUE, "VDPAUSurfaceAccessNV");
return;
}