summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shared.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: switch to c11 mutex functionsBrian Paul2014-03-031-8/+8
| | | | Reviewed-by: José Fonseca <[email protected]>
* mesa: allow buffers to be mapped multiple timesMarek Olšák2014-02-251-4/+2
| | | | | | | | | | | | | | | | | | | OpenGL allows a buffer to be mapped only once, but we also map buffers internally, e.g. in the software primitive restart fallback, for PBOs, vbo_get_minmax_index, etc. This has always been a problem, but it will be a bigger problem with persistent buffer mappings, which will prevent all Mesa functions from mapping buffers for internal purposes. This adds a driver interface to core Mesa which supports multiple buffer mappings and allows 2 mappings: one for the GL user and one for Mesa. Note that Gallium supports an unlimited number of buffer and texture mappings, so it's not really an issue for Gallium. v2: fix unmapping in xm_dd.c, remove the GL errors there v3: fix the intel driver (by Fredrik) Reviewed-by: Fredrik Höglund <[email protected]>
* mesa: use _mesa_validate_shader_target() more frequently.Paul Berry2014-01-211-2/+2
| | | | | | | | | | | | | This patch replaces code in _mesa_new_shader() and delete_shader_cb() that checks the type of a shader with calls to _mesa_validate_shader_target(). This has two advantages: it allows for a more thorough check (since _mesa_validate_shader_target() doesn't permit shader targets that aren't supported by the back-end), and it reduces the amount of code that will need to be modified when adding new shader stages. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* main: Fix delete_shader_cb() for geometry shadersPaul Berry2013-08-011-1/+2
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove outdated version lines in commentsRico Schüller2013-06-051-1/+0
| | | | Signed-off-by: Brian Paul <[email protected]>
* mesa: Restore 78-column wrapping of license text in C-style comments.Kenneth Graunke2013-04-231-3/+4
| | | | | | | | | | | | | | The previous commit introduced extra words, breaking the formatting. This text transformation was done automatically via the following shell command: $ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript where 'vimscript' is a file containing: /THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/\*\// !fmt -w 78 -p ' * ' :wq Reviewed-by: Brian Paul <[email protected]>
* mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | This brings the license text in line with the MIT License as published on the Open Source Initiative website: http://opensource.org/licenses/mit-license.php Generated automatically be the following shell command: $ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {} This introduces some wrapping issues, to be fixed in the next commit. Reviewed-by: Brian Paul <[email protected]>
* mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | | Generated automatically be the following shell command: $ git grep 'BRIAN PAUL BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/BRIAN PAUL/THE AUTHORS/' {} The intention here is to protect all authors, not just Brian Paul. I believe that was already the sensible interpretation, but spelling it out is probably better. More practically, it also prevents people from accidentally copy & pasting the license into a new file which says Brian is not liable when he isn't even one of the authors. Reviewed-by: Brian Paul <[email protected]>
* mesa: remove #include "mfeatures.h" from numerous source filesBrian Paul2013-04-171-1/+0
| | | | | | None of the remaining FEATURE_x symbols in mfeatures.h are used anymore. Reviewed-by: Jordan Justen <[email protected]>
* mesa: add texobj support for ARB_texture_multisampleChris Forbes2013-03-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the new texture targets, and per-image state for GL_TEXTURE_SAMPLES and GL_TEXTURE_FIXED_SAMPLE_LOCATIONS. V2: - Allow multisample texture targets in glInvalidateTexSubImage too. This was already partly there, but I missed it the first time around since the interaction is defined in a newer extension. Fixed weird indentation. - Allow multisample array textures in glFramebufferTextureLayer. This was overlooked as the tests originally only used 2d multisample textures. V3: - Set min/mag filters sensibly for multisample textures. This can't actually be changed by the user, so it's more sensible to initialize it correctly than to hack around it being bogus later. V4: - Tidy up initial min/mag filter setup. Setup in _mesa_initialize_texture_object was bogus, but benign since finish_texture_init() clobbered everything with correct values. For V4, just do the setup in finish_texture_init(). V5: - Don't break glPopAttrib(GL_TEXTURE_BIT) Signed-off-by: Chris Forbes <[email protected]> [V2] Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: validate that sync objects were created by mesaJordan Justen2012-12-061-5/+7
| | | | | | | | | | | | | | Previously, the user could send in a pointer that was not created by mesa. When we dereferenced that pointer, there would be an exception. Now we keep a set of pointers and verify that the pointer exists in that set before dereferencing it. Note: This fixes several crashing gles3conform tests. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: pass context parameter to gl_renderbuffer::Delete()Brian Paul2012-11-301-1/+2
| | | | | | | | | | We sometimes need a rendering context when deleting renderbuffers. Pass it explicitly instead of trying to grab a current context (which might be NULL). The next patch will make use of this. Note: this is a candidate for the stable branches. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: add fbo/texture support for ARB_texture_cube_map_array (v2)Dave Airlie2012-11-091-0/+1
| | | | | | | | | | | | | | | This adds the mesa core + texture + fbo support for the texture cube map array extension. v2: add comment to _mesa_num_tex_faces related to cube map arrays (Brian) drop wrong comment cut-n-paste (Brian) fix / 6 maximum check issue (Kenneth) coalsece some array case statements (Kenneth) Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: remove array size so the static assert can workBrian Paul2012-10-291-1/+1
| | | | | | | | With the explit NUM_TEXTURE_TARGETS array size, the assertion that Elements(targets) == NUM_TEXTURE_TARGETS would pass even if elements were missing. Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove FEATURE_ATI_fragment_shader define.Oliver McFadden2012-09-151-8/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_ARB_sampler_objects define.Oliver McFadden2012-09-151-8/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_ARB_(fragment|vertex)_program defines.Oliver McFadden2012-09-151-10/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_EXT_framebuffer_object define.Oliver McFadden2012-09-151-4/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_ARB_shader_objects and related defines.Oliver McFadden2012-09-151-4/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: use gl_program cast wrappersBrian Paul2012-07-181-4/+6
| | | | | | | In a few cases, remove unneeded casts. And fix a few other const-correctness issues. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix _mesa_get_fallback_texture() to handle all texture targetsBrian Paul2012-02-151-3/+5
| | | | | | | | | | | | Previously, this function only handled 2D textures. The fallback texture is used when we try to sample from an incomplete texture object. GLSL says sampling an incomplete texture should return (0,0,0,1). v2: use a 1-texel texture image, per José. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: use new _mesa_reference_shared_state() functionBrian Paul2012-02-011-18/+30
| | | | | | | | | This cleans up the reference counting of shared context state. The next patch will use this to fix an actual bug. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: use STATIC_ASSERT in a few more placesBrian Paul2012-01-101-1/+1
|
* mesa: Remove remaining FEATURE_ARB_vertex_buffer_object guards.Mathias Fröhlich2011-12-281-6/+0
| | | | | | | | | Since commit 82b9661894315362f857192439bdcbc9db090387 and 34eae1c72a9b3a8eb0634cda52fca0208cd2f40d vbo support is mandatory for all drivers. So, remove the remaining FEATURE_ARB_vertex_buffer_object guards. Signed-off-by: Mathias Froehlich <[email protected]>
* mesa: add support for GL_OES_EGL_image_externalChia-I Wu2011-11-031-0/+1
| | | | | | | | | This is an OpenGL ES specific extension. External textures are textures that may be sampled from, but not be updated (no glTexSubImage* and etc.). The image data are taken from an EGLImage. Reviewed-by: Brian Paul <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]>
* mesa: Remove target parameter from dd_function_table::UnmapBufferIan Romanick2011-08-231-1/+1
| | | | | | | | | | No driver used that parameter, and most drivers ended up with a bunch of unused-parameter warnings because it was there. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: 80-column wrapping and whitespace fixesBrian Paul2011-04-131-3/+3
|
* mesa: alloc/free shared sampler objectsBrian Paul2011-04-101-0/+27
|
* mesa: core support for GL_ARB_texture_buffer_objectBrian Paul2011-04-051-0/+2
| | | | No GLSL or driver support yet.
* mesa: Directly include mfeatures.h in files that perform feature tests.Vinson Lee2011-01-071-0/+1
|
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-10/+10
|
* mesa: Less FEATURE_ARB_sync tests.Chia-I Wu2010-09-141-6/+0
| | | | | Add dummy static inline definitions to syncobj.h when FEATURE_ARB_sync is 0, and remove most FEATURE_ARB_sync tests.
* mesa: free the fallback texture object in free_shared_state()Brian Paul2010-08-271-0/+4
|
* mesa: Remove unnecessary headers.Vinson Lee2010-07-291-1/+0
|
* mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul2010-06-101-1/+1
|
* mesa: move atifragshader.[ch] to main/Brian Paul2010-06-101-3/+3
|
* mesa: refactor shader api / object codeBrian Paul2010-06-101-3/+3
| | | | | Remove the unneeded ctx->Driver hooks for shader-related functions. Move state and API-related things into main/.
* Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versionsKristian Høgsberg2010-02-191-1/+1
|
* mesa: Enable true refcounting for NullBufferObj.Michal Krol2010-02-091-6/+0
| | | | | | | | This object can be shared with another context, so we cannot just delete it when the owning context is being destroyed. Ensuring that buffer objects are properly refcounted guarantees NullBufferObj is destroyed when all references to it are removed.
* mesa: Fix null buffer object reference counting.José Fonseca2010-02-091-6/+8
| | | | | | | | Always use _mesa_reference_buffer_object, and never call ctx->Driver.DeleteBuffer() directly to prevent dangling pointers to the null buffer object. This fixes crash/assertions in sharedtex_mt and Autodesk Mudbox.
* mesa: Always do proper ref counting of shared state.José Fonseca2010-02-091-2/+29
|
* mesa/main: Make FEATURE_dlist follow feature conventions.Chia-I Wu2009-09-301-4/+0
| | | | | As shown in mfeatures.h, this allows users of dlist.h to work without knowing if the feature is available.
* ARB sync: Fix delete behavior and context destruction behaviorIan Romanick2009-09-031-1/+18
| | | | | | | I believe this resolves the outstanding issues WRT sync object deletetion. I have also added a large comment at the top of syncobj.c describing the expected memory management behavior. I'm still a little uncertain about the locking on ctx->Shared.
* mesa: use _mesa_bufferobj_mapped()Brian Paul2009-08-081-1/+1
|
* mesa: move vertex array objects from shared state to per-contextBrian Paul2009-06-191-17/+0
| | | | | The ARB version requires VAOs to be per-context while the Apple extension was ambiguous.
* mesa: create/destroy buffer objects via driver functionsBrian Paul2009-06-191-2/+2
|
* mesa: use larger initial refcount for NullBufferObjBrian Paul2009-06-121-1/+1
| | | | | Refcounting of the null/default buffer object isn't perfect yet so be extra safe.
* mesa: move the NullBufferObj from GLcontext to gl_shared_stateBrian Paul2009-05-071-0/+12
| | | | | Since shared array objects may point to the null/default buffer object, the null/default buffer object should be part of the shared state.
* mesa: unmap buffer objects during context tear-downBrian Paul2009-05-071-0/+4
|
* mesa: Don't attempt to free the dummy program.José Fonseca2009-04-081-3/+5
|