Lines Matching refs:ctx

51 memoryobj_alloc(struct gl_context *ctx, GLuint name)
63 import_memoryobj_fd(struct gl_context *ctx,
69 struct pipe_screen *screen = ctx->pipe->screen;
88 import_memoryobj_win32(struct gl_context *ctx,
94 struct pipe_screen *screen = ctx->pipe->screen;
118 _mesa_delete_memory_object(struct gl_context *ctx,
121 struct pipe_screen *screen = ctx->pipe->screen;
130 GET_CURRENT_CONTEXT(ctx);
133 _mesa_debug(ctx, "glDeleteMemoryObjectsEXT(%d, %p)\n", n,
137 if (!ctx->Extensions.EXT_memory_object) {
138 _mesa_error(ctx, GL_INVALID_OPERATION,
144 _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteMemoryObjectsEXT(n < 0)");
151 _mesa_HashLockMutex(ctx->Shared->MemoryObjects);
155 = _mesa_lookup_memory_object_locked(ctx, memoryObjects[i]);
158 _mesa_HashRemoveLocked(ctx->Shared->MemoryObjects,
160 _mesa_delete_memory_object(ctx, delObj);
164 _mesa_HashUnlockMutex(ctx->Shared->MemoryObjects);
170 GET_CURRENT_CONTEXT(ctx);
172 if (!ctx->Extensions.EXT_memory_object) {
173 _mesa_error(ctx, GL_INVALID_OPERATION,
179 _mesa_lookup_memory_object(ctx, memoryObject);
187 GET_CURRENT_CONTEXT(ctx);
192 _mesa_debug(ctx, "%s(%d, %p)", func, n, memoryObjects);
194 if (!ctx->Extensions.EXT_memory_object) {
195 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
200 _mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", func);
207 _mesa_HashLockMutex(ctx->Shared->MemoryObjects);
208 if (_mesa_HashFindFreeKeys(ctx->Shared->MemoryObjects, memoryObjects, n)) {
213 memObj = memoryobj_alloc(ctx, memoryObjects[i]);
215 _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s()", func);
216 _mesa_HashUnlockMutex(ctx->Shared->MemoryObjects);
221 _mesa_HashInsertLocked(ctx->Shared->MemoryObjects,
227 _mesa_HashUnlockMutex(ctx->Shared->MemoryObjects);
235 GET_CURRENT_CONTEXT(ctx);
240 if (!ctx->Extensions.EXT_memory_object) {
241 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
245 memObj = _mesa_lookup_memory_object(ctx, memoryObject);
250 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(memoryObject is immutable", func);
267 _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=0x%x)", func, pname);
275 GET_CURRENT_CONTEXT(ctx);
280 if (!ctx->Extensions.EXT_memory_object) {
281 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
285 memObj = _mesa_lookup_memory_object(ctx, memoryObject);
302 _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=0x%x)", func, pname);
306 lookup_memory_object_err(struct gl_context *ctx, unsigned memory,
310 _mesa_error(ctx, GL_INVALID_VALUE, "%s(memory=0)", func);
314 struct gl_memory_object *memObj = _mesa_lookup_memory_object(ctx, memory);
319 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(no associated memory)",
339 GET_CURRENT_CONTEXT(ctx);
341 if (!ctx->Extensions.EXT_memory_object) {
342 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
346 if (!_mesa_is_legal_tex_storage_target(ctx, dims, target)) {
347 _mesa_error(ctx, GL_INVALID_ENUM,
354 if (!_mesa_is_legal_tex_storage_format(ctx, internalFormat)) {
355 _mesa_error(ctx, GL_INVALID_ENUM,
361 texObj = _mesa_get_current_tex_object(ctx, target);
365 memObj = lookup_memory_object_err(ctx, memory, func);
369 _mesa_texture_storage_memory(ctx, dims, texObj, memObj, target,
383 GET_CURRENT_CONTEXT(ctx);
385 if (!ctx->Extensions.EXT_memory_object) {
386 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
390 texObj = _mesa_get_current_tex_object(ctx, target);
394 memObj = lookup_memory_object_err(ctx, memory, func);
398 _mesa_texture_storage_ms_memory(ctx, dims, texObj, memObj, target, samples,
415 GET_CURRENT_CONTEXT(ctx);
417 if (!ctx->Extensions.EXT_memory_object) {
418 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
423 if (!_mesa_is_legal_tex_storage_format(ctx, internalFormat)) {
424 _mesa_error(ctx, GL_INVALID_ENUM,
430 texObj = _mesa_lookup_texture(ctx, texture);
434 if (!_mesa_is_legal_tex_storage_target(ctx, dims, texObj->Target)) {
435 _mesa_error(ctx, GL_INVALID_OPERATION,
441 memObj = lookup_memory_object_err(ctx, memory, func);
445 _mesa_texture_storage_memory(ctx, dims, texObj, memObj, texObj->Target,
459 GET_CURRENT_CONTEXT(ctx);
461 if (!ctx->Extensions.EXT_memory_object) {
462 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
466 texObj = _mesa_lookup_texture(ctx, texture);
470 memObj = lookup_memory_object_err(ctx, memory, func);
474 _mesa_texture_storage_ms_memory(ctx, dims, texObj, memObj, texObj->Target,
620 semaphoreobj_alloc(struct gl_context *ctx, GLuint name)
631 import_semaphoreobj_fd(struct gl_context *ctx,
635 struct pipe_context *pipe = ctx->pipe;
646 import_semaphoreobj_win32(struct gl_context *ctx,
652 struct pipe_context *pipe = ctx->pipe;
659 server_wait_semaphore(struct gl_context *ctx,
667 struct st_context *st = ctx->st;
668 struct pipe_context *pipe = ctx->pipe;
707 server_signal_semaphore(struct gl_context *ctx,
715 struct st_context *st = ctx->st;
716 struct pipe_context *pipe = ctx->pipe;
754 _mesa_delete_semaphore_object(struct gl_context *ctx,
764 GET_CURRENT_CONTEXT(ctx);
769 _mesa_debug(ctx, "%s(%d, %p)", func, n, semaphores);
771 if (!ctx->Extensions.EXT_semaphore) {
772 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
777 _mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", func);
784 _mesa_HashLockMutex(ctx->Shared->SemaphoreObjects);
785 if (_mesa_HashFindFreeKeys(ctx->Shared->SemaphoreObjects, semaphores, n)) {
787 _mesa_HashInsertLocked(ctx->Shared->SemaphoreObjects,
792 _mesa_HashUnlockMutex(ctx->Shared->SemaphoreObjects);
798 GET_CURRENT_CONTEXT(ctx);
803 _mesa_debug(ctx, "%s(%d, %p)\n", func, n, semaphores);
806 if (!ctx->Extensions.EXT_semaphore) {
807 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
812 _mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", func);
819 _mesa_HashLockMutex(ctx->Shared->SemaphoreObjects);
823 = _mesa_lookup_semaphore_object_locked(ctx, semaphores[i]);
826 _mesa_HashRemoveLocked(ctx->Shared->SemaphoreObjects,
828 _mesa_delete_semaphore_object(ctx, delObj);
832 _mesa_HashUnlockMutex(ctx->Shared->SemaphoreObjects);
838 GET_CURRENT_CONTEXT(ctx);
840 if (!ctx->Extensions.EXT_semaphore) {
841 _mesa_error(ctx, GL_INVALID_OPERATION, "glIsSemaphoreEXT(unsupported)");
846 _mesa_lookup_semaphore_object(ctx, semaphore);
865 GET_CURRENT_CONTEXT(ctx);
868 if (!ctx->Extensions.EXT_semaphore) {
869 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
874 _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=0x%x)", func, pname);
878 struct gl_semaphore_object *semObj = _mesa_lookup_semaphore_object(ctx,
884 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(Not a D3D12 fence)", func);
889 ctx->screen->set_fence_timeline_value(ctx->screen, semObj->fence, params[0]);
897 GET_CURRENT_CONTEXT(ctx);
900 if (!ctx->Extensions.EXT_semaphore) {
901 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
906 _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=0x%x)", func, pname);
910 struct gl_semaphore_object *semObj = _mesa_lookup_semaphore_object(ctx,
916 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(Not a D3D12 fence)", func);
931 GET_CURRENT_CONTEXT(ctx);
938 if (!ctx->Extensions.EXT_semaphore) {
939 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
943 ASSERT_OUTSIDE_BEGIN_END(ctx);
945 semObj = _mesa_lookup_semaphore_object(ctx, semaphore);
949 FLUSH_VERTICES(ctx, 0, 0);
953 _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s(numBufferBarriers=%u)",
959 bufObjs[i] = _mesa_lookup_bufferobj(ctx, buffers[i]);
964 _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s(numTextureBarriers=%u)",
970 texObjs[i] = _mesa_lookup_texture(ctx, textures[i]);
973 server_wait_semaphore(ctx, semObj,
991 GET_CURRENT_CONTEXT(ctx);
998 if (!ctx->Extensions.EXT_semaphore) {
999 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
1003 ASSERT_OUTSIDE_BEGIN_END(ctx);
1005 semObj = _mesa_lookup_semaphore_object(ctx, semaphore);
1009 FLUSH_VERTICES(ctx, 0, 0);
1013 _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s(numBufferBarriers=%u)",
1019 bufObjs[i] = _mesa_lookup_bufferobj(ctx, buffers[i]);
1024 _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s(numTextureBarriers=%u)",
1030 texObjs[i] = _mesa_lookup_texture(ctx, textures[i]);
1033 server_signal_semaphore(ctx, semObj,
1049 GET_CURRENT_CONTEXT(ctx);
1053 if (!ctx->Extensions.EXT_memory_object_fd) {
1054 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
1059 _mesa_error(ctx, GL_INVALID_ENUM, "%s(handleType=%u)", func, handleType);
1063 struct gl_memory_object *memObj = _mesa_lookup_memory_object(ctx, memory);
1067 import_memoryobj_fd(ctx, memObj, size, fd);
1077 GET_CURRENT_CONTEXT(ctx);
1081 if (!ctx->Extensions.EXT_memory_object_win32) {
1082 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
1090 _mesa_error(ctx, GL_INVALID_ENUM, "%s(handleType=%u)", func, handleType);
1094 struct gl_memory_object *memObj = _mesa_lookup_memory_object(ctx, memory);
1098 import_memoryobj_win32(ctx, memObj, size, handle, NULL);
1108 GET_CURRENT_CONTEXT(ctx);
1112 if (!ctx->Extensions.EXT_memory_object_win32) {
1113 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
1121 _mesa_error(ctx, GL_INVALID_ENUM, "%s(handleType=%u)", func, handleType);
1125 struct gl_memory_object *memObj = _mesa_lookup_memory_object(ctx, memory);
1129 import_memoryobj_win32(ctx, memObj, size, NULL, name);
1138 GET_CURRENT_CONTEXT(ctx);
1142 if (!ctx->Extensions.EXT_semaphore_fd) {
1143 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
1148 _mesa_error(ctx, GL_INVALID_ENUM, "%s(handleType=%u)", func, handleType);
1152 struct gl_semaphore_object *semObj = _mesa_lookup_semaphore_object(ctx,
1158 semObj = semaphoreobj_alloc(ctx, semaphore);
1160 _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
1163 _mesa_HashInsert(ctx->Shared->SemaphoreObjects, semaphore, semObj, true);
1166 import_semaphoreobj_fd(ctx, semObj, fd);
1174 GET_CURRENT_CONTEXT(ctx);
1178 if (!ctx->Extensions.EXT_semaphore_win32) {
1179 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
1185 _mesa_error(ctx, GL_INVALID_ENUM, "%s(handleType=%u)", func, handleType);
1190 !ctx->screen->get_param(ctx->screen, PIPE_CAP_TIMELINE_SEMAPHORE_IMPORT)) {
1191 _mesa_error(ctx, GL_INVALID_ENUM, "%s(handleType=%u)", func, handleType);
1194 struct gl_semaphore_object *semObj = _mesa_lookup_semaphore_object(ctx,
1200 semObj = semaphoreobj_alloc(ctx, semaphore);
1202 _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
1205 _mesa_HashInsert(ctx->Shared->SemaphoreObjects, semaphore, semObj, true);
1210 import_semaphoreobj_win32(ctx, semObj, handle, NULL, type);
1218 GET_CURRENT_CONTEXT(ctx);
1222 if (!ctx->Extensions.EXT_semaphore_win32) {
1223 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
1229 _mesa_error(ctx, GL_INVALID_ENUM, "%s(handleType=%u)", func, handleType);
1234 !ctx->screen->get_param(ctx->screen, PIPE_CAP_TIMELINE_SEMAPHORE_IMPORT)) {
1235 _mesa_error(ctx, GL_INVALID_ENUM, "%s(handleType=%u)", func, handleType);
1238 struct gl_semaphore_object *semObj = _mesa_lookup_semaphore_object(ctx,
1244 semObj = semaphoreobj_alloc(ctx, semaphore);
1246 _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
1249 _mesa_HashInsert(ctx->Shared->SemaphoreObjects, semaphore, semObj, true);
1254 import_semaphoreobj_win32(ctx, semObj, NULL, name, type);