Commit Graph

32 Commits

Author SHA1 Message Date
Brian Paul
c04db7f7fa mesa: fix _mesa_get_fallback_texture() to handle all texture targets
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 <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
361cd53a77 mesa: use new _mesa_reference_shared_state() function
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 <jfonseca@vmware.com>
2012-02-01 07:11:40 -07:00
Brian Paul
6bf5daf331 mesa: use STATIC_ASSERT in a few more places 2012-01-10 12:37:37 -07:00
Mathias Fröhlich
1ef3a94536 mesa: Remove remaining FEATURE_ARB_vertex_buffer_object guards.
Since commit 82b9661894 and
34eae1c72a vbo support
is mandatory for all drivers. So, remove the remaining
FEATURE_ARB_vertex_buffer_object guards.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-28 11:05:13 +01:00
Chia-I Wu
0c87f16817 mesa: add support for GL_OES_EGL_image_external
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 <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:45 +08:00
Ian Romanick
56f0c00f12 mesa: Remove target parameter from dd_function_table::UnmapBuffer
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 <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:08 -07:00
Brian Paul
032a7ef0a1 mesa: 80-column wrapping and whitespace fixes 2011-04-13 07:35:25 -06:00
Brian Paul
6bb4d807f7 mesa: alloc/free shared sampler objects 2011-04-10 13:12:49 -06:00
Brian Paul
874a2c0b7d mesa: core support for GL_ARB_texture_buffer_object
No GLSL or driver support yet.
2011-04-05 19:02:09 -06:00
Vinson Lee
db61b9ce39 mesa: Directly include mfeatures.h in files that perform feature tests. 2011-01-07 00:13:00 -08:00
Kristian Høgsberg
f9995b3075 Drop GLcontext typedef and use struct gl_context instead 2010-10-13 09:43:25 -04:00
Chia-I Wu
10ff2646a4 mesa: Less FEATURE_ARB_sync tests.
Add dummy static inline definitions to syncobj.h when FEATURE_ARB_sync
is 0, and remove most FEATURE_ARB_sync tests.
2010-09-14 15:49:47 +08:00
Brian Paul
c8e0970667 mesa: free the fallback texture object in free_shared_state() 2010-08-27 10:51:47 -06:00
Vinson Lee
bbe1385201 mesa: Remove unnecessary headers. 2010-07-29 17:14:32 -07:00
Brian Paul
ec2b92f98c mesa: rename src/mesa/shader/ to src/mesa/program/ 2010-06-10 23:23:13 -06:00
Brian Paul
70c8d29b6b mesa: move atifragshader.[ch] to main/ 2010-06-10 22:24:45 -06:00
Brian Paul
a37b2219d6 mesa: refactor shader api / object code
Remove the unneeded ctx->Driver hooks for shader-related functions.
Move state and API-related things into main/.
2010-06-10 20:32:57 -06:00
Kristian Høgsberg
32f2fd1c5d Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versions 2010-02-19 12:03:01 -05:00
Michal Krol
01d7e3d5a2 mesa: Enable true refcounting for NullBufferObj.
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.
2010-02-09 14:52:52 +01:00
José Fonseca
05ac187f30 mesa: Fix null buffer object reference counting.
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.
2010-02-09 11:52:05 +00:00
José Fonseca
1c39dbb90c mesa: Always do proper ref counting of shared state. 2010-02-09 11:52:02 +00:00
Chia-I Wu
a73ba2d31b mesa/main: Make FEATURE_dlist follow feature conventions.
As shown in mfeatures.h, this allows users of dlist.h to work without
knowing if the feature is available.
2009-09-30 08:31:56 -06:00
Ian Romanick
16b393d059 ARB sync: Fix delete behavior and context destruction behavior
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.
2009-09-03 11:22:46 -07:00
Brian Paul
4482f96c59 mesa: use _mesa_bufferobj_mapped() 2009-08-08 07:30:26 -06:00
Brian Paul
12cf98f5fc mesa: move vertex array objects from shared state to per-context
The ARB version requires VAOs to be per-context while the Apple extension
was ambiguous.
2009-06-19 18:11:52 -06:00
Brian Paul
6629a35559 mesa: create/destroy buffer objects via driver functions 2009-06-19 09:58:51 -06:00
Brian Paul
05f0d90962 mesa: use larger initial refcount for NullBufferObj
Refcounting of the null/default buffer object isn't perfect yet so be
extra safe.
2009-06-12 16:01:02 -06:00
Brian Paul
4f6b704f97 mesa: move the NullBufferObj from GLcontext to gl_shared_state
Since shared array objects may point to the null/default buffer object,
the null/default buffer object should be part of the shared state.
2009-05-07 14:34:09 -06:00
Brian Paul
cc71704644 mesa: unmap buffer objects during context tear-down 2009-05-07 09:36:21 -06:00
José Fonseca
629700ed7e mesa: Don't attempt to free the dummy program. 2009-04-08 11:32:43 +01:00
Vinson Lee
1eee1bac1f mesa: update/fix doxygen comments 2009-03-17 09:34:30 -06:00
Brian Paul
4045a2c7d3 mesa: move shared context state functions to new shared.c file 2009-03-07 13:14:37 -07:00