Commit Graph

155 Commits

Author SHA1 Message Date
Brian Paul
423860ac78 mesa: add new query/buffer targets for transform feedback 2010-03-30 20:04:04 -06:00
Chia-I Wu
066477ab22 mesa: Add missing features.
Add features tested in the code but missing from mfeatures.h.

This also fixes some tests of features.  They should be tested with
"#if", not "#ifdef".
2010-03-30 15:39:17 +08:00
Brian Paul
5cb4a3524b mesa: remove return, do as the comment says 2010-03-22 08:23:14 -06:00
Brian Paul
d6a9f5b3da mesa: added new GL3 buffer object queries
And clean up the error checking code.
2010-03-20 12:06:35 -06:00
Chris Wilson
24f9011276 Always return VOLATILE for ObjectPurgeable(VOLATILE)
Fixes fdo bug 26128.

The spec mandates that VOLATILE is returned from
ObjectPurgeable(VOLATILE) irrespective of the actual status of the
object upon completion of marking it purgeable.

Conform to the spec, even though it seems wrong.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-05 23:20:45 +00:00
Brian Paul
e176ae5f2a mesa: whitespace fixes, 80-column wrapping, etc. 2010-03-05 09:23:43 -07:00
Chris Wilson
99864d595f APPLE_object_purgeable: core
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-05 11:23:55 +00:00
Kristian Høgsberg
298be2b028 Replace the _mesa_*printf() wrappers with the plain libc versions 2010-02-19 12:32:24 -05: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
Brian Paul
6bf1ea897f mesa: replace _mesa_bzero() with memset() 2010-02-19 08:32:36 -07:00
Kenneth Graunke
c7ac486261 Remove _mesa_memcpy in favor of plain memcpy.
This may break the SUNOS4 build, but it's no longer relevant.
2010-02-19 09:18:36 -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
Michal Krol
eeec2c3d95 mesa: Protect buffer objects reference counting with a mutex. 2010-02-09 14:46:32 +01:00
Brian Paul
1fbc71937f mesa: added _mesa_GetBufferParameteri64v()
This is a new function in GL 3.2.  No dispatch for this function yet.
2010-01-02 10:32:37 -07:00
Brian Paul
dd5691e802 mesa: code refactoring to eliminate a switch stmt in bind_buffer_object() 2009-10-27 20:10:59 -06:00
Brian Paul
f338de4018 mesa: fix more buffer object error messages 2009-09-22 13:47:49 -06:00
Brian Paul
dc947c8f92 mesa: combined PBO validate/map helpers 2009-09-03 11:45:17 -06:00
Brian Paul
1b448c7a5c mesa: consolidate PBO map/unmap helpers
Instead of _mesa_map_readpix_pbo() use _mesa_map_pbo_source().

Instead of _mesa_map_drawpix_pbo() and _mesa_map_bitmap_pbo() use
_mesa_map_pbo_dest().
2009-09-03 11:45:17 -06:00
Brian Paul
2f6d2a9e27 mesa: change ctx->Driver.BufferData() to return GLboolean for success/failure
Return GL_FALSE if we failed to allocate the buffer.  Then raise
GL_OUT_OF_MEMORY in core Mesa.
2009-09-03 09:42:38 -06:00
Brian Paul
2b6ab615a4 mesa: set additional fields in _mesa_buffer_map_range() 2009-08-31 09:12:04 -06:00
Brian Paul
d1da8acd82 mesa: set Length/Offset fields in _mesa_buffer_map() 2009-08-31 09:05:28 -06:00
Brian Paul
822c796481 mesa: additional assertions for ctx->Driver.UnmapBuffer()
The Pointer, Offset and Lenght fields should be cleared by the driver function
since ctx->Driver.Unmap() may be called from VBO code, etc.
2009-08-31 09:01:58 -06:00
Brian Paul
92033a9516 mesa: new assertions, comments about buffer mapping
Since ctx->Driver.MapBuffer() and ctx->Driver.MapBufferRange() may be called
from other places in Mesa (such as VBO) it's important that the driver
callbacks set all the buffer object fields properly (Pointer, Offset, Length,
etc).  Add assertions to make sure that the driver does that.
2009-08-31 08:50:15 -06:00
Brian Paul
604031563c mesa: use _mesa_is_bufferobj() 2009-08-12 17:28:45 -06:00
Brian Paul
7bf6efe780 mesa: use _mesa_bufferobj_mapped() 2009-08-07 09:50:38 -06:00
Brian Paul
331eb58f68 mesa: make buffer object-related driver fallback functions static
Plug them in via _mesa_init_buffer_object_functions().
2009-06-19 10:00:03 -06:00
Brian Paul
70d247c69b Merge branch 'arb_map_buffer_range'
Conflicts:

	docs/relnotes-7.6.html
	src/mesa/main/mtypes.h
2009-06-15 16:42:42 -06:00
Brian Paul
0854b7e972 mesa: use _mesa_reference_buffer_object() in a few places 2009-06-12 16:01:02 -06:00
Brian Paul
4a7fd6323a mesa: added a simple bounds checker to glMap/UnmapBuffer() (disabled) 2009-06-09 14:05:17 -06:00
Brian Paul
e75b283b45 mesa: implement GL_ARB_map_buffer_range
Only enabled for software drivers at this point.

Note that the gl_buffer_object::Access enum field has been replaced by
a gl_buffer_object::AccessFlags bitfield.  The new field is a mask of
the GL_MAP_x_BIT flags which is a superset of the old GL_READ_ONLY,
GL_WRITE_ONLY and GL_READ_WRITE modes.  When we query GL_BUFFER_ACCESS_ARB
we translate the bitfield into the conventional enum values.
2009-06-08 17:02:36 -06:00
Brian Paul
e7927626c1 mesa: added buffer object debug code (disabled) 2009-06-03 17:16:00 -06:00
Brian Paul
2813c08b35 mesa: fix error test mistake in _mesa_CopyBufferSubData() 2009-06-02 21:35:11 -06:00
Brian Paul
dc0b71f00d mesa: _mesa_CopyBufferSubData() function, and driver fall-back 2009-06-02 21:35:11 -06:00
Brian Paul
ebb991ca0d mesa: use Elements() for loop bound 2009-05-22 14:16:00 -06:00
Brian Paul
a65f385b8d mesa: minor code simplification 2009-05-22 14:14:53 -06:00
Brian Paul
f7ca97f85e mesa: remove pointless null ptr check, improved some error messages 2009-05-21 09:17:09 -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
105c8529e7 mesa: fix comments, s/texture/buffer/ 2009-05-07 14:34:09 -06:00
Brian Paul
6359ecebec mesa: remove unused gl_buffer_object::OnCard field 2009-05-07 10:12:33 -06:00
Brian Paul
dcca97a3e3 mesa: added gl_buffer_object::Written flag (for debug purposes)
The flag is set when we data has been written into the buffer object.
2009-05-07 10:12:33 -06:00
Brian Paul
b9d0f947f2 mesa: Compute gl_client_array->_MaxElement during array validation
Used to be done in the glVertex/Normal/Color/etc/Pointer() calls but
if the VBO was reallocated the size could change.
New _NEW_BUFFER_OBJECT state flag.
2009-05-07 10:12:33 -06:00
Brian Paul
67025f7893 mesa: set bufObj->Pointer = NULL after unmapping
Also, ctx->Driver.UnmapBuffer can never be null, so remove conditional.
2009-02-27 13:10:45 -07:00
Brian Paul
a7f434b486 mesa: if a buffer object is mapped when glDeleteBuffers() is called, unmap it 2009-02-27 13:04:38 -07:00
Brian Paul
395bcad8c0 mesa: updated comments 2009-02-27 12:56:07 -07:00
Brian Paul
75e3ccf6a5 mesa: fix incorrect error handling in glBufferDataARB()
If glBufferDataARB() is called while a buffer object is currently mapped
we're supposed to unmap the current buffer, then replace it.  Don't generate
an error.
2009-02-27 12:56:07 -07:00
Brian Paul
0815ebccfc Merge commit 'origin/master' into gallium-0.2
Conflicts:

	src/mesa/main/ffvertex_prog.c
	src/mesa/main/texenvprogram.c
2009-01-02 16:32:26 -07:00
Brian Paul
e9b34885b8 mesa: increase max texture image units and GLSL samplers to 16
The max texture coord units is still 8.  All the fixed-function paths are
still limited to 8 too.  But GLSL shaders can use more samplers now.

Note that some texcoord-related data structures are declared to be 16
elements in size rather than 8.  This just simplifies the code in a few
places; the extra elements aren't accessible to the user.

These changes haven't been extensively tested yet, but sanity checking has
been done.

It should be possible to increase the max image units/samplers to 32 without
doing anything special.  Beyond that we'll need longer bitfields in a few
places.
2008-12-31 12:00:17 -07:00
Brian Paul
6c72bc8089 mesa: fix default buffer object access value 2008-09-26 07:31:42 -06:00
Keith Whitwell
89ab66448e Merge commit 'origin/master' into gallium-0.2
Conflicts:

	progs/trivial/Makefile
	src/mesa/glapi/glthread.c
2008-09-18 19:03:02 +01:00
Brian Paul
d36f4ef16b mesa: remove some assertions that are invalid during context tear-down 2008-09-15 09:07:32 -06:00