summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/varray.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: fix indentation in vertex_attrib_binding()Brian Paul2016-10-131-2/+2
| | | | Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
* mesa: add sanity check assertion in update_array_formatBrian Paul2016-10-131-0/+3
| | | | | | At most, one of the normalized, integer, doubles bools can be true. Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
* mesa: remove needless cast in update_array()Brian Paul2016-10-131-1/+1
| | | | Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
* mesa: simplify update_array() with a vao local varBrian Paul2016-10-131-7/+7
| | | | Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
* mesa: rename gl_vertex_attrib_array gl_array_attributesBrian Paul2016-10-131-7/+7
| | | | | | | The structure contains the attributes of a vertex array. The old name was kind of confusing. Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
* mesa: rename gl_vertex_attrib_array::VertexBindingBrian Paul2016-10-131-8/+8
| | | | | | | | | Rename to gl_vertex_attrib_array::BufferBindingIndex because this field is an index into the array of buffer binding points. This makes some code a little easier to follow since there's also a "VertexBinding" field in gl_vertex_array_object. Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
* mesa: Remove set but not used gl_client_array::Stride.Mathias Fröhlich2016-07-311-1/+0
| | | | | | | | The field is only read for printing today and there it was probably a leftover. Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de> Reviewed-by: Eric Anholt <eric@anholt.net>
* mesa: Remove set but not used gl_client_array::Enabled.Mathias Fröhlich2016-07-311-1/+0
| | | | | | | | The way it is used today does not care about the Enabled flag anymore. Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de> Reviewed-by: Eric Anholt <eric@anholt.net>
* mesa: Walk the VAO in _mesa_print_arrays.Mathias Fröhlich2016-07-311-32/+20
| | | | | | | | | Only a debugging function, but move away from gl_client_array and use the first order information from the VAO. Also make use of gl_vert_attrib_name. Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de> Reviewed-by: Eric Anholt <eric@anholt.net>
* mesa: Move sanity check of BindVertexBuffer for OpenGL ES 3.1Marta Lofstedt2016-01-191-0/+4
| | | | | | | | | Sanity check of BindVertexBuffer for OpenGL ES in _mesa_handle_bind_buffer_gen breaks OpenGL ES 2 conformance. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93426 Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
* mesa/varray: set double arrays to non-normalised.Dave Airlie2015-12-101-1/+1
| | | | | | | | | | | Doesn't have any effect in practice I don't think, but CTS reads back using GetVertexAttrib. This fixes: GL41-CTS.vertex_attrib_64bit.get_vertex_attrib Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* mesa: error out in indirect draw when vertex bindings mismatchTapani Pälli2015-11-261-0/+10
| | | | | | | | | | | | | | | | | | | | Patch adds additional mask for tracking which vertex arrays have associated vertex buffer binding set. This array can be directly compared to which vertex arrays are enabled and should match when drawing. Fixes following CTS tests: ES31-CTS.draw_indirect.negative-noVBO-arrays ES31-CTS.draw_indirect.negative-noVBO-elements v2: update mask in vertex_array_attrib_binding v3: rename mask and make it track _BoundArrays which matches what was actually originally wanted (Fredrik Höglund) v4: code cleanup, check for GLES 3.1 (Fredrik Höglund) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Fredrik Höglund <fredrik@kde.org>
* mesa: Refactor enable_vertex_array_attrib to make ↵Ian Romanick2015-11-241-9/+17
| | | | | | | | | | | | | | _mesa_enable_vertex_array_attrib Pulls the parts of enable_vertex_array_attrib that aren't just parameter validation out into a function that can be called from other parts of Mesa (e.g., meta). _mesa_enable_vertex_array_attrib can also be used to enable fixed-function arrays. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
* mesa: Refactor update_array_format to make _mesa_update_array_format_publicIan Romanick2015-11-241-19/+49
| | | | | | | | | Pulls the parts of update_array_format that aren't just parameter validation out into a function that can be called from other parts of Mesa (e.g., meta). Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
* mesa: Make bind_vertex_buffer avilable outside varray.cIan Romanick2015-11-241-14/+15
| | | | | | Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
* mesa: remove Driver.NewArrayObjectMarek Olšák2015-10-031-1/+1
| | | | | | | Nothing reimplements it. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* mesa/es3.1: Enable GL_ARB_vertex_attrib_binding functionality for GLES 3.1Marta Lofstedt2015-09-221-7/+7
| | | | Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
* mesa: whitespace, line wrap fixes in varray.cBrian Paul2015-09-161-12/+20
| | | | Trivial.
* mesa: Remove target parameter from _mesa_handle_bind_buffer_genIan Romanick2015-09-021-2/+1
| | | | | | | | | | main/bufferobj.c: In function '_mesa_handle_bind_buffer_gen': main/bufferobj.c:915:37: warning: unused parameter 'target' [-Wunused-parameter] GLenum target, ^ Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
* mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke2015-07-201-3/+3
| | | | | | | Generated by sed; no manual changes. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: use _mesa_lookup_enum_by_nr() in print_array()Brian Paul2015-06-221-4/+4
| | | | | | Print GL_FLOAT, etc. instead of hex value. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
* Revert "mesa: Add ARB_direct_state_access checks in VAO functions"Ian Romanick2015-05-281-64/+0
| | | | | | | This reverts commit 36b05793372b86b914d9b95d0188f5f387e01d68. Acked-by: Fredrik Höglund <fredrik@kde.org> Cc: "10.6" <mesa-stable@lists.freedesktop.org>
* mesa: Add ARB_direct_state_access checks in VAO functionsFredrik Höglund2015-05-141-0/+64
| | | | | Signed-off-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
* mesa: Implement GetVertexArrayIndexed[64]ivFredrik Höglund2015-05-081-0/+117
| | | | | | v2: Fix the name of the entry point in the error messages. Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Add support for querying GL_VERTEX_ATTRIB_ARRAY_LONGFredrik Höglund2015-05-081-0/+5
| | | | | | This parameter was added in OpenGL 4.3 and GL_ARB_direct_state_access. Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Add a vao parameter to get_vertex_array_attribFredrik Höglund2015-05-081-9/+16
| | | | | | | | | This is needed to implement glGetVertexArrayIndexediv and glGetVertexArrayIndexed64iv. v2: Make the vao parameter const. Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Implement VertexArrayBindingDivisorFredrik Höglund2015-05-081-16/+49
| | | | Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Add a vao parameter to vertex_binding_divisorFredrik Höglund2015-05-081-4/+6
| | | | | | This is needed to implement VertexArrayBindingDivisor. Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Implement VertexArrayAttribBindingFredrik Höglund2015-05-081-22/+55
| | | | Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Add a vao parameter to vertex_attrib_bindingFredrik Höglund2015-05-081-6/+9
| | | | | | This is needed to implement VertexArrayAttribBinding. Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Implement VertexArrayAttrib[I|L]FormatFredrik Höglund2015-05-081-0/+79
| | | | Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Add a vao parameter to update_array_formatFredrik Höglund2015-05-081-7/+10
| | | | | | This is needed to implement VertexArrayAttrib*Format. Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Refactor VertexAttrib[I|L]FormatFredrik Höglund2015-05-081-100/+49
| | | | | | | | The only difference between these functions is the legal types and sizes, so consolidate the code into a single vertex_attrib_format() function and call it from all three entry points. Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Implement VertexArrayVertexBuffersFredrik Höglund2015-05-081-27/+63
| | | | Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Implement VertexArrayVertexBufferFredrik Höglund2015-05-081-25/+58
| | | | Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Add a vao parameter to bind_vertex_bufferFredrik Höglund2015-05-081-8/+10
| | | | | | | This is needed to implement VertexArrayVertexBuffer and VertexArrayVertexBuffers. Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Implement EnableVertexArrayAttribFredrik Höglund2015-05-081-9/+37
| | | | Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa: Implement DisableVertexArrayAttribFredrik Höglund2015-05-081-9/+36
| | | | Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
* mesa/vbo: add support for 64-bit vertex attributes. (v1)Dave Airlie2015-05-081-17/+47
| | | | | | | | | | | | This adds support in the vbo and array code to handle double vertex attributes. v0.2: merge code to handle doubles in vbo layer. v1: don't use v0, merge api_array elt code. Acked-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* mapi: add GL_ARB_vertex_attrib_64bit supportDave Airlie2015-05-081-1/+9
| | | | | | | | This just adds the glapi bits. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* mesa: include stdio.h where neededBrian Paul2015-03-051-0/+1
| | | | | | | Instead of relying on glapi.h or some other header to provide it. Acked-by: Matt Turner <mattst88@gmail.com> Reviewed-by: José Fonseca <jfonseca@vmware.com>
* mesa/main: replace Elements() with ARRAY_SIZE()Brian Paul2015-03-021-7/+7
| | | | | | | | We've been using a mix of these two macros for a while now. Let's just use the later everywhere. It seems to be the convention used by other open-source projects. Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-231-8/+8
| | | | Acked-by: Eric Anholt <eric@anholt.net>
* mesa: Fix some signed-unsigned comparison warningsJan Vesely2015-01-211-1/+1
| | | | | | | | v2: s/unsigned int/unsigned/ in prog_optimize.c Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: David Heidelberg <david@ixit.cz> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* mesa: Recompute LegalTypesMask if the GL API has changedIago Toral Quiroga2014-12-091-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code computes ctx->Array.LegalTypesMask just once, however, computing this needs to consider ctx->API so we need to make sure that the API for that context has not changed if we intend to reuse the result. The context API can change, at least, if we go through _mesa_meta_begin, since that will always force API_OPENGL_COMPAT until we call _mesa_meta_end. If any operation in between these two calls triggers a call to update_array_format, then we might be caching a value for LegalTypesMask that will not be right once we have called _mesa_meta_end and restored the context API. Fixes the following 179 dEQP tests in i965: dEQP-GLES3.functional.vertex_arrays.single_attribute.strides.fixed.* dEQP-GLES3.functional.vertex_arrays.single_attribute.normalize.fixed.* dEQP-GLES3.functional.vertex_arrays.single_attribute.output_types.fixed.* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.static_draw.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.stream_draw.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.dynamic_draw.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.static_copy.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.stream_copy.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.dynamic_copy.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.static_read.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.stream_read.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.dynamic_read.*fixed* dEQP-GLES3.functional.vertex_arrays.multiple_attributes.input_types.3_*fixed2* dEQP-GLES3.functional.draw.random.{2,18,28,68,83,106,109,156,181,191} Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Make _mesa_print_arrays use stderr.Kenneth Graunke2014-10-091-3/+3
| | | | | | | | | These days, most driver debug output happens via stderr, not stdout. Some applications (such as Xephyr) also appear to close stdout which makes these messages go nowhere. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
* mesa: Use VertexArray, not _VertexArray, in array size expressions.Kenneth Graunke2014-09-241-4/+4
| | | | | | | | | Both sizes are VERT_ATTRIB_MAX, so this has no effect. But it drops a few trivial uses of the derived state. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Delete VAO _MaxElement code and index buffer bounds checking.Kenneth Graunke2014-09-191-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fredrik's implementation of ARB_vertex_attrib_binding introduced new gl_vertex_attrib_array and gl_vertex_buffer_binding structures, and converted Mesa's older gl_client_array to be derived state. Ultimately, we'd like to drop gl_client_array and use those structures directly. One hitch is that gl_client_array::_MaxElement doesn't correspond to either structure (unlike every other field), so we'd have to figure out where to store it. The _MaxElement computation uses values from both structures, so it doesn't really belong in either place. We could put it in the VAO, but we'd have to pass it around everywhere. It turns out that it's only used when ctx->Const.CheckArrayBounds is set, which is only set by the (rarely used) classic swrast driver. It appears that drivers/x11 used to set it as well, which was intended to avoid segmentation faults on out-of-bounds memory access in the X server (probably for indirect GLX clients). However, ajax deleted that code in 2010 (commit 1ccef926be46dce3b6b5c76e812e2fae4e205ce7). The bounds checking apparently doesn't actually work, either. Non-VBO attributes arbitrarily set _MaxElement to 2 * 1000 * 1000 * 1000. vbo_save_draw and vbo_exec_draw remark /* ??? */ when setting it, and the i965 code contains a comment noting that _MaxElement is often bogus. Given that the code is complex, rarely used, and dubiously functional, it doesn't seem worth maintaining going forward. This patch drops it. This will probably mean the classic swrast driver may begin crashing on out of bounds vertex buffer access in some cases, but I believe that is allowed by OpenGL (and probably happened for non-VBO accesses anyway). There do not appear to be any Piglit regressions, either. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Roland Scheidegger <sroland@vmware.com>
* mesa: implement GL_MAX_VERTEX_ATTRIB_STRIDETimothy Arceri2014-08-271-0/+22
| | | | | | | | V2: moved test for the VertexAttrib*Pointer() functions to update_array(), and made constant available for drivers to set Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* mesa: fix copy and paste errors in glBindVertexBuffersTimothy Arceri2014-08-191-2/+2
| | | | | Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au> Reviewed-by: Fredrik Höglund <fredrik@kde.org>