Lines Matching refs:shared
49 free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared);
63 struct gl_shared_state *shared; in _mesa_alloc_shared_state() local
66 shared = CALLOC_STRUCT(gl_shared_state); in _mesa_alloc_shared_state()
67 if (!shared) in _mesa_alloc_shared_state()
70 simple_mtx_init(&shared->Mutex, mtx_plain); in _mesa_alloc_shared_state()
72 shared->DisplayList = _mesa_NewHashTable(); in _mesa_alloc_shared_state()
73 shared->BitmapAtlas = _mesa_NewHashTable(); in _mesa_alloc_shared_state()
74 shared->TexObjects = _mesa_NewHashTable(); in _mesa_alloc_shared_state()
75 shared->Programs = _mesa_NewHashTable(); in _mesa_alloc_shared_state()
77 shared->DefaultVertexProgram = in _mesa_alloc_shared_state()
79 shared->DefaultFragmentProgram = in _mesa_alloc_shared_state()
82 shared->ATIShaders = _mesa_NewHashTable(); in _mesa_alloc_shared_state()
83 shared->DefaultFragmentShader = _mesa_new_ati_fragment_shader(ctx, 0); in _mesa_alloc_shared_state()
85 shared->ShaderObjects = _mesa_NewHashTable(); in _mesa_alloc_shared_state()
87 shared->BufferObjects = _mesa_NewHashTable(); in _mesa_alloc_shared_state()
90 shared->SamplerObjects = _mesa_NewHashTable(); in _mesa_alloc_shared_state()
93 _mesa_init_shared_handles(shared); in _mesa_alloc_shared_state()
96 _mesa_init_shader_includes(shared); in _mesa_alloc_shared_state()
97 mtx_init(&shared->ShaderIncludeMutex, mtx_plain); in _mesa_alloc_shared_state()
117 shared->DefaultTex[i] = ctx->Driver.NewTextureObject(ctx, 0, targets[i]); in _mesa_alloc_shared_state()
122 shared->DefaultTex[i]->TargetIndex = i; in _mesa_alloc_shared_state()
126 assert(shared->DefaultTex[TEXTURE_1D_INDEX]->RefCount == 1); in _mesa_alloc_shared_state()
129 mtx_init(&shared->TexMutex, mtx_recursive); in _mesa_alloc_shared_state()
130 shared->TextureStateStamp = 0; in _mesa_alloc_shared_state()
132 shared->FrameBuffers = _mesa_NewHashTable(); in _mesa_alloc_shared_state()
133 shared->RenderBuffers = _mesa_NewHashTable(); in _mesa_alloc_shared_state()
135 shared->SyncObjects = _mesa_set_create(NULL, _mesa_hash_pointer, in _mesa_alloc_shared_state()
138 shared->MemoryObjects = _mesa_NewHashTable(); in _mesa_alloc_shared_state()
139 shared->SemaphoreObjects = _mesa_NewHashTable(); in _mesa_alloc_shared_state()
141 return shared; in _mesa_alloc_shared_state()
341 free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared) in free_shared_state() argument
347 if (shared->FallbackTex[i]) in free_shared_state()
348 ctx->Driver.DeleteTexture(ctx, shared->FallbackTex[i]); in free_shared_state()
354 if (shared->DisplayList) { in free_shared_state()
355 _mesa_HashDeleteAll(shared->DisplayList, delete_displaylist_cb, ctx); in free_shared_state()
356 _mesa_DeleteHashTable(shared->DisplayList); in free_shared_state()
359 if (shared->BitmapAtlas) { in free_shared_state()
360 _mesa_HashDeleteAll(shared->BitmapAtlas, delete_bitmap_atlas_cb, ctx); in free_shared_state()
361 _mesa_DeleteHashTable(shared->BitmapAtlas); in free_shared_state()
364 if (shared->ShaderObjects) { in free_shared_state()
365 _mesa_HashWalk(shared->ShaderObjects, free_shader_program_data_cb, ctx); in free_shared_state()
366 _mesa_HashDeleteAll(shared->ShaderObjects, delete_shader_cb, ctx); in free_shared_state()
367 _mesa_DeleteHashTable(shared->ShaderObjects); in free_shared_state()
370 if (shared->Programs) { in free_shared_state()
371 _mesa_HashDeleteAll(shared->Programs, delete_program_cb, ctx); in free_shared_state()
372 _mesa_DeleteHashTable(shared->Programs); in free_shared_state()
375 if (shared->DefaultVertexProgram) in free_shared_state()
376 _mesa_reference_program(ctx, &shared->DefaultVertexProgram, NULL); in free_shared_state()
378 if (shared->DefaultFragmentProgram) in free_shared_state()
379 _mesa_reference_program(ctx, &shared->DefaultFragmentProgram, NULL); in free_shared_state()
381 if (shared->DefaultFragmentShader) in free_shared_state()
382 _mesa_delete_ati_fragment_shader(ctx, shared->DefaultFragmentShader); in free_shared_state()
384 if (shared->ATIShaders) { in free_shared_state()
385 _mesa_HashDeleteAll(shared->ATIShaders, delete_fragshader_cb, ctx); in free_shared_state()
386 _mesa_DeleteHashTable(shared->ATIShaders); in free_shared_state()
389 if (shared->BufferObjects) { in free_shared_state()
390 _mesa_HashDeleteAll(shared->BufferObjects, delete_bufferobj_cb, ctx); in free_shared_state()
391 _mesa_DeleteHashTable(shared->BufferObjects); in free_shared_state()
394 if (shared->FrameBuffers) { in free_shared_state()
395 _mesa_HashDeleteAll(shared->FrameBuffers, delete_framebuffer_cb, ctx); in free_shared_state()
396 _mesa_DeleteHashTable(shared->FrameBuffers); in free_shared_state()
399 if (shared->RenderBuffers) { in free_shared_state()
400 _mesa_HashDeleteAll(shared->RenderBuffers, delete_renderbuffer_cb, ctx); in free_shared_state()
401 _mesa_DeleteHashTable(shared->RenderBuffers); in free_shared_state()
404 if (shared->SyncObjects) { in free_shared_state()
405 set_foreach(shared->SyncObjects, entry) { in free_shared_state()
409 _mesa_set_destroy(shared->SyncObjects, NULL); in free_shared_state()
412 if (shared->SamplerObjects) { in free_shared_state()
413 _mesa_HashDeleteAll(shared->SamplerObjects, delete_sampler_object_cb, in free_shared_state()
415 _mesa_DeleteHashTable(shared->SamplerObjects); in free_shared_state()
425 if (shared->DefaultTex[i]) in free_shared_state()
426 ctx->Driver.DeleteTexture(ctx, shared->DefaultTex[i]); in free_shared_state()
430 if (shared->TexObjects) { in free_shared_state()
431 _mesa_HashDeleteAll(shared->TexObjects, delete_texture_cb, ctx); in free_shared_state()
432 _mesa_DeleteHashTable(shared->TexObjects); in free_shared_state()
435 _mesa_free_shared_handles(shared); in free_shared_state()
438 _mesa_destroy_shader_includes(shared); in free_shared_state()
439 mtx_destroy(&shared->ShaderIncludeMutex); in free_shared_state()
441 if (shared->MemoryObjects) { in free_shared_state()
442 _mesa_HashDeleteAll(shared->MemoryObjects, delete_memory_object_cb, ctx); in free_shared_state()
443 _mesa_DeleteHashTable(shared->MemoryObjects); in free_shared_state()
446 if (shared->SemaphoreObjects) { in free_shared_state()
447 _mesa_HashDeleteAll(shared->SemaphoreObjects, delete_semaphore_object_cb, ctx); in free_shared_state()
448 _mesa_DeleteHashTable(shared->SemaphoreObjects); in free_shared_state()
451 simple_mtx_destroy(&shared->Mutex); in free_shared_state()
452 mtx_destroy(&shared->TexMutex); in free_shared_state()
454 free(shared); in free_shared_state()