void GLAPIENTRY _mesa_VDPAUUnregisterSurfaceNV(GLintptr surface) { struct vdp_surface *surf = (struct vdp_surface *)surface; struct set_entry *entry; int i; GET_CURRENT_CONTEXT(ctx); if (!ctx->vdpDevice || !ctx->vdpGetProcAddress || !ctx->vdpSurfaces) { _mesa_error(ctx, GL_INVALID_OPERATION, "VDPAUUnregisterSurfaceNV"); return; } /* according to the spec it's ok when this is zero */ if (surface == 0) return; entry = _mesa_set_search(ctx->vdpSurfaces, surf); if (!entry) { _mesa_error(ctx, GL_INVALID_VALUE, "VDPAUUnregisterSurfaceNV"); return; } for (i = 0; i < MAX_TEXTURES; i++) { if (surf->textures[i]) { surf->textures[i]->Immutable = GL_FALSE; _mesa_reference_texobj(&surf->textures[i], NULL); } } _mesa_set_remove(ctx->vdpSurfaces, entry); free(surf); }
virtual ir_visitor_status visit(ir_dereference_variable *ir) { struct set_entry *entry = _mesa_set_search(variables, ir->var); /* If a variable is dereferenced at all, remove it from the set of * variables that are candidates for removal. */ if (entry != NULL) _mesa_set_remove(variables, entry); return visit_continue; }
static void unregister_surface(struct set_entry *entry) { struct vdp_surface *surf = (struct vdp_surface *)entry->key; GET_CURRENT_CONTEXT(ctx); if (surf->state == GL_SURFACE_MAPPED_NV) { GLintptr surfaces[] = { (GLintptr)surf }; _mesa_VDPAUUnmapSurfacesNV(1, surfaces); } _mesa_set_remove(ctx->vdpSurfaces, entry); free(surf); }
void _mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj) { struct set_entry *entry; mtx_lock(&ctx->Shared->Mutex); syncObj->RefCount--; if (syncObj->RefCount == 0) { entry = _mesa_set_search(ctx->Shared->SyncObjects, syncObj); assert (entry != NULL); _mesa_set_remove(ctx->Shared->SyncObjects, entry); mtx_unlock(&ctx->Shared->Mutex); ctx->Driver.DeleteSyncObject(ctx, syncObj); } else { mtx_unlock(&ctx->Shared->Mutex); } }
void _mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj) { struct set_entry *entry; _glthread_LOCK_MUTEX(ctx->Shared->Mutex); syncObj->RefCount--; if (syncObj->RefCount == 0) { entry = _mesa_set_search(ctx->Shared->SyncObjects, _mesa_hash_pointer(syncObj), syncObj); assert (entry != NULL); _mesa_set_remove(ctx->Shared->SyncObjects, entry); _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); ctx->Driver.DeleteSyncObject(ctx, syncObj); } else { _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); } }