Commit Graph

48 Commits

Author SHA1 Message Date
Eric Anholt
4f9d351ef1 mesa: Remove support for NV_vertex_program's special attributes aliasing
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Oliver McFadden
d09428c9cc mesa: remove FEATURE_point_size_array define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:07 +03:00
Eric Anholt
7d8d1c7819 mesa: Fix VAO deletion on GL 3.1 core.
We were calling through a dispatch table entry that was NULL, since the apple
variant is only on legacy desktop.  Just call the function we mean instead of
indirecting through the dispatch.
2012-08-29 15:09:36 -07:00
Brian Paul
8459f4a63a mesa: make _mesa_reference_array_object() an inline function
As we do for texture objects, buffer objects, etc.
2012-06-27 07:50:57 -06:00
Brian Paul
b0e048f0b9 mesa: move gl_array_attrib::NewState to gl_array_object::NewArrays
The field wasn't actually used before and it's not used now either.
But this is a more logical place for it and will hopefully allow
doing smarter draw/array validation (per array object) in the future.

Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-20 07:32:33 -06:00
Ian Romanick
e06b1c65bc mesa: Set the gl_array_object::ARBsemantics flag at the right time
With 0963990 the flag was only set when Bind created the object.  In
all cases where ::ARBsemantics could be true, this path never
happened.  Instead, add a _Used flag to track whether a VAO has ever
been bound.  On the first Bind, set the _Used flag, and set the
ARBsemantics flag to the correct value.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45423
2012-02-02 10:07:14 -07:00
Ian Romanick
0963990153 mesa: Rename gl_array_object::VBOonly to ::ARBsemantics
There are more differences between Apple and ARB than just requiring
that all arrays be stored in VBOs.  Additional uses will be added in
following commits.

Also, set the flag at Bind time instead of Gen time.  The ARB_vao spec
specifies that behavior.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 12:31:04 -08:00
Mathias Fröhlich
7a1e941ebe mesa: Fix and speedup gl_array_object::_MaxElement computation.
Use a bitmask approach to compute gl_array_object::_MaxElement.
To make this work correctly depending on the shader type actually used,
make use of the newly introduced typed bitmask getters.
With this change I gain about 5% draw time on some osgviewer examples.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-20 07:24:20 +01:00
Brian Paul
9a548c27aa mesa: remove _mesa_ffs(), implement ffs() for non-GNU platforms
Call ffs() and ffsll() everywhere.  Define our own ffs(), ffsll()
functions when the platform doesn't have them.

v2: remove #ifdef _WIN32, __IBMC__, __IBMCPP_ tests inside ffs()
implementation.  The #else clause was recursive.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Alexander von Gluck <kallisti5@unixzen.com>
2012-01-12 07:30:58 -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
Mathias Fröhlich
762c9766c9 mesa: Use VERT_ATTRIB_* indexed array in gl_array_object.
Replace the distinct struct gl_client_array members in gl_array_object by
an array of gl_client_arrays indexed by VERT_ATTRIB_*.
Renumber the vertex attributes slightly to keep the old semantics of the
distinct array members. Make use of the upper 32 bits in VERT_BIT_*.
Update all occurances of the distinct struct members with the array
equivalents.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:37:19 +01:00
Mathias Fröhlich
104b81def4 mesa: Replace _NEW_ARRAY_* bits with VERT_BIT_*
Consolidate the two distinct set of flags to use VERT_BIT_*.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Yuanhan Liu
a0a5bd4bb3 mesa: move ElementArrayBufferObj to gl_array_object
According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at
page 515, the element buffer object is listed in vertex array object.

So, move the ElementArrayBufferObj inside gl_array_object to make
element buffer object per-vao.

This would fix most of(3 left) intel oglc vao test fail

NOTE: this is a candidate for the 7.11 branch.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-29 09:48:50 +08:00
Paul Berry
8f84c237b3 mesa: Set the "Integer" field of gl_client_array properly.
This patch ensures that gl_client_array::Integer is properly set to
GL_TRUE for vertex attributes specified using glVertexAttribIPointer,
and to GL_FALSE for vertex attributes specified using
glVertexAttribPointer, so that the vertex attributes can be
interpreted properly by driver back-ends.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-02 09:29:35 -07:00
Brian Paul
9520f483b8 mesa: s/INLINE/inline/
INLINE is still seen in some files (some generated files, etc) but this
is a good start.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-01 08:16:36 -06:00
Brian Paul
496bf04905 mesa: only update array _MaxElement if array is enabled
Fixes failed assertion when calling _mesa_print_arrays() debug function.
2011-05-18 08:14:32 -06:00
Brian Paul
204991bf5d mesa: Update _ElementSize. 2011-04-07 12:20:06 +01:00
Brian Paul
7b8830d81d mesa: consolidate code in _mesa_update_array_max_element() 2011-04-06 16:52:48 -06:00
Brian Paul
9459cc593c mesa: 80-column wrapping 2011-03-19 14:17:41 -06:00
Ian Romanick
09e15ac76a mesa: Initial size for secondary color array is 3
See table 6.7 on page 347 of the OpenGL 3.0 specification.
2011-01-31 15:32:55 -08:00
Vinson Lee
db61b9ce39 mesa: Directly include mfeatures.h in files that perform feature tests. 2011-01-07 00:13:00 -08:00
Vinson Lee
0117da40cd mesa: Include mtypes.h in files that use gl_context struct.
Directly include mtypes.h if a file uses a gl_context struct. This
allows future removal of headers that are not strictly necessary but
indirectly include mtypes.h for a file.
2011-01-05 23:11:54 -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
2cf44390d1 mesa: Move src/mesa/glapi/dispatch.h to mesa.
glapi/dispatch.h is a core Mesa header file.  Move the header file to
main/ to make this clear.  It also becomes clear after this change that
IN_DRI_DRIVER is only used in core Mesa to enable the remap table.
2010-02-25 21:32:58 +08: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
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
Brian Paul
9342e6f5a9 mesa: implement _mesa_GenVertexArrays() for GL_ARB_vertex_array_object
This also involves adding a gl_array_object::VBOonly field.  For the
ARB extension, all arrays in the object must reside in a VBO.  This flag
keeps track of that requirement.
2009-06-19 18:17:25 -06:00
Brian Paul
b8000c874e mesa: implement _mesa_BindVertexArray() 2009-06-19 18:12:11 -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
42ae2a8648 mesa: use Elements() macro to limit loops instead of constants 2009-05-22 07:51:13 -06:00
Brian Paul
8fa0cb2b42 mesa: added gl_array_object::Weight array field
We don't really implement vertex weights but in the VBO code this
fixes and odd case for the legacy_array[] setup.  Before, the
vbo->draw_prims() call was always indicating that the vertex weight
array was present/enabled when it really wasn't.
2009-05-21 16:10:45 -06:00
Brian Paul
1889890c88 mesa: check FEATURE_point_size_array for PointSize array 2009-05-21 16:10:45 -06:00
Brian Paul
de1cfc5e8a mesa: new _mesa_update_array_object_max_element() function
This will replace the code in state.c
2009-05-21 16:10:45 -06:00
Brian Paul
fa95ecb467 mesa: make the array object save/remove functions static 2009-05-07 14:34:09 -06:00
Brian Paul
32b851c807 mesa: clean-up vertex array object VBO unbinding and delete/refcounting
Don't really delete vertex array objects until the refcount hits zero.
At that time, unbind any pointers to VBOs.
2009-05-07 14:34:09 -06:00
Brian Paul
1030bf0ded mesa: reference counting for gl_array_object
Every kind of object that can be shared by multiple contexts should be
refcounted.
2009-05-07 14:34: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
9cf594d698 mesa: improve array initialization code, and set the new array->Format field. 2009-01-23 11:25:13 -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
1cf2c8a043 mesa: point size arrays 2008-09-21 22:13:56 -07:00
Brian Paul
9246c2fad4 mesa: replace MALLOC w/ CALLOC to fix valgrind warning 2008-09-05 08:06:24 -06:00
Brian Paul
37c74af01c mesa: improved gl_buffer_object reference counting
Use new _mesa_reference_buffer_object() function wherever possible.
Fixes buffer object/display list crash reported in ParaView.
2008-09-04 14:59:40 -06:00
Brian
c223c6b663 Be more consistant with paths in #includes. Eventually, eliminate a bunch of -I flags. 2007-07-04 13:15:20 -06:00
Keith Whitwell
99efde461d better handling of current attributes. Trivial dlist and varray tests work 2006-10-30 16:44:13 +00:00
Brian Paul
2d77b25c27 minor clean-ups 2006-06-15 15:36:06 +00:00
Brian Paul
48c03d7c9f s/buffer/arrays/ 2006-06-12 20:02:11 +00:00
Ian Romanick
ee34e6ef71 Add support for GL_APPLE_vertex_array_object. Several test programs
and demos are also added.

Adding basic support to drivers should be as easy as just enabling the
extension, though thorough test would also be required.
2006-06-12 16:26:29 +00:00