summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/varray.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Remove the now unused _NEW_ARRAY state change flag.Mathias Fröhlich2019-05-041-17/+0
| | | | | | | Is no longer used, so we have less occasions where NewState is non zero. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Track buffer object use also for VAO usage.Mathias Fröhlich2019-03-041-2/+4
| | | | | | | | | We already track the usage history for buffer objects in a lot of aspects. Add GL_ARRAY_BUFFER and GL_ELEMENT_ARRAY_BUFFER to gl_buffer_object::UsageHistory. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Factor out struct gl_vertex_format.Mathias Fröhlich2018-11-211-28/+34
| | | | | | | | | | | | | | | | Factor out struct gl_vertex_format from array attributes. The data type is supposed to describe the type of a vertex element. At this current stage the data type is only used with the VAO, but actually is useful in various other places. Due to the bitfields being used, special care needs to be taken for the glGet code paths. v2: Change unsigned char -> GLubyte. Use struct assignment for struct gl_vertex_format. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Work with bitmasks when en/dis-abling VAO arrays.Mathias Fröhlich2018-11-211-18/+20
| | | | | | | | | | | For enabling or disabling VAO arrays it is now possible to change a set of arrays with a single call without the need to iterate the attributes. Make use of this technique in the vao module. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Remove gl_array_attributes::Enabled.Mathias Fröhlich2018-11-211-7/+4
| | | | | | | | | Now that all users go via the VAO Enabled bitfield, get rid of the Enabled boolean. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Use the gl_vertex_array_object::Enabled bitfield.Mathias Fröhlich2018-11-211-5/+4
| | | | | | | | | | Instead of using gl_array_attributes::Enabled use the much more compact representation stored in gl_vertex_array_object::Enabled using the corresponding bits. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Rename gl_vertex_array_object::_Enabled -> Enabled.Mathias Fröhlich2018-11-211-8/+8
| | | | | | | | | Mark the up to now derived bitfield value now as primary value by removing the underscore. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Collect all the draw functions in draw.{h,c}.Mathias Fröhlich2018-11-011-43/+0
| | | | | | | | Some of these functions were distributed across different implementation and header files. Put them at a central place. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Flag _NEW_ARRAY only if we are changing ctx->Array.VAO.Mathias Fröhlich2018-05-171-6/+14
| | | | | | | | | For the VAO internal helper functions that may be called with a non current VAO, flag the _NEW_ARRAY state only if it is the current ctx->Array.VAO. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Remove flush_vertices argument from VAO methods.Mathias Fröhlich2018-05-171-23/+21
| | | | | | | The flush_vertices argument is now unused, remove it. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Remove FLUSH_VERTICES from VAO state changes.Mathias Fröhlich2018-05-171-59/+6
| | | | | | | | | Pending draw calls on immediate mode or display list calls do not depend on changes of the VAO state. So, remove calls to FLUSH_VERTICES and flag _NEW_ARRAY as appropriate. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Compute effective buffer bindings in the vao.Mathias Fröhlich2018-05-101-0/+9
| | | | | | | | | | | | | | | | Compute VAO buffer binding information past the position/generic0 mapping. Scan for duplicate buffer bindings and collapse them into derived effective buffer binding index and effective attribute mask variables. Provide a set of helper functions to access the distilled information in the VAO. All of them prefixed with _mesa_draw_... to indicate that they are meant to query draw information. v2: Also group user space arrays containing interleaved arrays. Add _Eff*Offset to be copied on attribute and binding copy. Update comments. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Flag early if we modify a SharedAndImmutable VAO.Mathias Fröhlich2018-03-231-0/+6
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Make gl_vertex_array contain pointers to first order VAO members.Mathias Fröhlich2018-03-101-21/+0
| | | | | | | | | | | | | | | Instead of keeping a copy of the vertex array content in struct gl_vertex_array only keep pointers to the first order information originaly in the VAO. For that represent the current values by struct gl_array_attributes and struct gl_vertex_buffer_binding. v2: Change comments. Remove gl... prefix from variables except in the i965 directory where it was like that before. Reindent because of that. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: replace some API_OPENGL_CORE checks with _mesa_is_desktop_glMarek Olšák2018-02-231-3/+3
| | | | | | | This is more accurate with respect to the compatibility profile. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add flush_vertices to _mesa_bind_vertex_buffer.Mathias Fröhlich2018-02-231-7/+8
| | | | | | | We will need the flush_vertices argument later in this series. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Make _mesa_vertex_attrib_binding public.Mathias Fröhlich2018-02-231-18/+20
| | | | | | | | | Change vertex_attrib_binding() to _mesa_vertex_attrib_binding(), add a flush_vertices argument, and make it publicly available. The function will be needed later in the series. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add flush_vertices to _mesa_{enable,disable}_vertex_array_attrib.Mathias Fröhlich2018-02-231-11/+19
| | | | | | | We will need the flush_vertices argument later in this series. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Introduce a yet unused _DrawVAO.Mathias Fröhlich2018-02-231-0/+2
| | | | | | | | | | | | | During the patch series this VAO gets populated with either the currently bound VAO or an internal VAO that will be used for immediate mode and dlist rendering. v2: More comments about the _DrawVAO, filter and enabled mask. Rename _DrawVAOEnabled to _DrawVAOEnabledAttribs. v3: Fix and move comment. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Only update enabled VAO gl_vertex_array entries.Mathias Fröhlich2018-02-091-4/+4
| | | | | | | | | | | | Instead of updating all modified gl_vertex_array_object::_VertexArray entries just update those that are modified and enabled. Also release buffer object from the _VertexArray that belong to disabled attributes. v2: Also set Ptr and Size to zero. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix VAO buffer object tracking.Mathias Fröhlich2018-02-091-0/+2
| | | | | | | | When changing the attribute binding in the VAO we also need to account for getting rid of non vbo bits from VertexAttribBufferMask. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Factor out _mesa_disable_vertex_array_attrib.Mathias Fröhlich2018-02-061-14/+44
| | | | | | | | And use it in the enable code path. Move _mesa_update_attribute_map_mode into its only remaining file. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Track position/generic0 aliasing in the VAO.Mathias Fröhlich2018-02-011-4/+14
| | | | | | | | | | | | | | | | | | | | | | | Since the first material attribute no longer aliases with the generic0 attribute, only aliasing between generic0 and position is left and entirely dependent on the enabled state of the VAO. So introduce a gl_attribute_map_mode in the VAO that is used to track how the position and the generic 0 attribute alias. Provide a static const array that can be used to map from vertex program input indices to VERT_ATTRIB_* indices. The outer dimension of the array is meant to be indexed directly by the new VAO member variable. Also provide methods on the VAO to convert bitmasks of VERT_BIT's from the VAO numbering to the vertex processing inputs numbering. v2: s,unsigned char,GLubyte,g s,_ATTRIBUTE_MAP_MODE_MAX,ATTRIBUTE_MAP_MODE_MAX,g Change comment style, add comments. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove invalid assertion in _mesa_enable_vertex_array_attrib()Brian Paul2018-01-301-1/+0
| | | | | | | | | | The meta module passes some 0-based attrib values. Should fix Piglit regressions reported by Mark Janes. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104863 Fixes: 4ab7e03e1fc7ac ("mesa: add an assertion in _mesa_enable_vertex_array_attrib()") Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: use gl_vert_attrib enum type in more placesBrian Paul2018-01-301-6/+6
| | | | | | Slightly better readbility. Reviewed-by: Gert Wollny <[email protected]>
* mesa: rename some 'client' array functionsBrian Paul2018-01-301-2/+2
| | | | | | | A long time ago gl_vertex_array was gl_client_array. Update some function names to be consistent. Reviewed-by: Gert Wollny <[email protected]>
* mesa: check/assert array index in _mesa_bind_vertex_buffer()Brian Paul2018-01-301-0/+1
| | | | Reviewed-by: Gert Wollny <[email protected]>
* mesa: add an assertion in _mesa_enable_vertex_array_attrib()Brian Paul2018-01-301-0/+1
| | | | | | | | Some of the enable/disable vertex array functions take a zero-based generic index, while others take a VERT_ATTRIB_GENERIC0-based value. Add an assertion to clarify that in one place. Reviewed-by: Gert Wollny <[email protected]>
* mesa: shrink VERT_ATTRIB bitfields to 32 bitsMarek Olšák2017-11-251-1/+1
| | | | | | There are only 32 vertex attribs now. Reviewed-by: Ian Romanick <[email protected]>
* mesa: add KHR_no_error support to glPrimitiveRestartIndex()Samuel Pitoiset2017-07-311-0/+8
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add primitive_restart_index() helperSamuel Pitoiset2017-07-311-4/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glVertexArrayBindingDivisor()Samuel Pitoiset2017-07-311-0/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glVertexBindingDivisor()Samuel Pitoiset2017-07-311-0/+9
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glDisableVertexA*A*()Timothy Arceri2017-06-291-0/+17
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: move error handling into disable_vertex_array_attrib() callersTimothy Arceri2017-06-291-10/+14
| | | | | | | This will let us just call disable_vertex_array_attrib() for KHR_no_error support. Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: add KHR_no_error support for glEnableVertexA*A*()Timothy Arceri2017-06-291-0/+18
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: add KHR_no_error support for glVertex*AttribBinding()Samuel Pitoiset2017-06-281-0/+23
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't flag _NEW_TRANSFORM for primitive restartMarek Olšák2017-06-221-1/+1
| | | | | | | | It's a draw state. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add support for unsigned 64-bit vertex attributesSamuel Pitoiset2017-06-141-0/+18
| | | | | | | | This adds support in the VBO and array code to handle unsigned 64-bit vertex attributes as specified by ARB_bindless_texture. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mapi: add GL_ARB_bindless_texture entry pointsSamuel Pitoiset2017-06-141-0/+5
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glBindVertexBuffers()Samuel Pitoiset2017-06-071-0/+13
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glVertexArrayVertexBuffers()Samuel Pitoiset2017-06-071-0/+15
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add vertex_array_vertex_buffers_err() helperSamuel Pitoiset2017-06-071-47/+61
| | | | | | | | This also adds a 'no_error' parameter to vertex_array_vertex_buffer() to be used in a following patch. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glVertexArrayVertexBuffer()Timothy Arceri2017-05-301-0/+13
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: add KHR_no_error support for glBindVertexBuffer()Timothy Arceri2017-05-301-3/+14
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: split vertex_array_vertex_buffer() in twoTimothy Arceri2017-05-301-42/+53
| | | | | | | | This will allow us to skip the error checkes when adding KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: Make _mesa_primitive_restart_index a static inline in the header.Kenneth Graunke2017-05-091-18/+0
| | | | | | | | | | It's now basically a single expression, so it probably makes sense to have it inlined into the callers. Suggested by Marek. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Simplify _mesa_primitive_restart_index().Kenneth Graunke2017-05-061-10/+2
| | | | | | | We can use a simple shift equation rather than a switch statement. Reviewed-by: Rafael Antognolli <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/varray: make use of dispatch KHR_no_error supportTimothy Arceri2017-05-041-173/+319
| | | | | | Make use of dispatch KHR_no_error support for varray functions. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: tidy up left over APPLE_vertex_array_object semanticsTimothy Arceri2017-04-261-1/+1
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>