summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo
Commit message (Collapse)AuthorAgeFilesLines
* vbo: process buffer binding state changes on draw when recordingIlia Mirkin2017-02-021-0/+7
| | | | | | | | | | | | | | The VBO module keeps track of any vbo buffers. It updates this list when receiving an InvalidateState call, however this never happens when recording draws right now. Make sure that we do all the usual state updates when recording draws so that the VBO list may be kept up to date. Signed-off-by: Ilia Mirkin <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99631 Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]> Cc: "13.0 17.0" <[email protected]>
* mesa: rename gl_client_array -> gl_vertex_arrayBrian Paul2016-10-2815-48/+48
| | | | | | | | | | | The term "client array" is a legacy thing dating back to the pre-VBO era when _all_ vertex arrays lived in client memory. Nowadays, it only contains vertex array state which is derived from gl_array_attributes and gl_vertex_buffer_binding. It's used by the VBO module and some drivers. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: rename gl_vertex_array_object::VertexBinding to BufferBindingBrian Paul2016-10-281-3/+3
| | | | | | To be a little more understandable. Reviewed-by: Anuj Phogat <[email protected]>
* r200/i915/st/mesa/compiler: use common inputs read fieldTimothy Arceri2016-10-263-5/+9
| | | | | | | | | | | | And set set inputs_read directly in shader_info. To avoid regressions between changes this change is a squashed version of the following patches. st/mesa changes where: Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa/i965/i915/r200: eliminate gl_vertex_programTimothy Arceri2016-10-262-4/+4
| | | | | | | Here we move the only field in gl_vertex_program to the ARB program fields in gl_program. Reviewed-by: Jason Ekstrand <[email protected]>
* vbo: clean up with 'indent', whitespace fixes, etc in vbo_exec_array.cBrian Paul2016-10-201-252/+276
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* vbo: whitespace fixes and reformatting in vbo_exec_api.cBrian Paul2016-10-201-42/+64
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* vbo: minor clean-up in vbo_exec_api.cBrian Paul2016-10-201-5/+2
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* vbo: move attribute type assignmentBrian Paul2016-10-201-1/+2
| | | | | | | | | | If the attribute type is changing, we would have found that earlier in the ATTR_UNION() macro and would have called vbo_exec_fixup_vertex(). So move the assignment into that function so we don't do it every time. No Piglit regressions. Reviewed-by: Charmaine Lee <[email protected]>
* vbo: rename reset_attrfv() to vbo_reset_all_attr()Brian Paul2016-10-201-4/+6
| | | | | | Use a better name. Reviewed-by: Charmaine Lee <[email protected]>
* vbo: make vbo_reset_attr() staticBrian Paul2016-10-202-3/+5
| | | | | | Not called from any other file. Reviewed-by: Charmaine Lee <[email protected]>
* vbo: trivial indentation fix in vbo_exec_api.cBrian Paul2016-10-201-1/+1
|
* vbo: simplify some code in check_draw_elements_data()Brian Paul2016-10-131-5/+4
| | | | | | Use the 'vao' local var in more places. Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: rename gl_vertex_attrib_array gl_array_attributesBrian Paul2016-10-131-4/+4
| | | | | | | The structure contains the attributes of a vertex array. The old name was kind of confusing. Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: rename gl_vertex_attrib_array::VertexBindingBrian Paul2016-10-131-3/+3
| | | | | | | | | 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 <[email protected]>
* vbo: increase VBO_SAVE_BUFFER_SIZE from 8k to 256k dwordsTim Rowley2016-09-061-1/+1
| | | | | | | | | | | | Increases the performance of legacy geometry-heavy apps still using display lists. Performance increase for a targeted testcase is on the order of 8x, and applications like ParaView 4.x (5.x uses no longer used display lists) improve by about 10%-20%. Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* vbo: set draw_idMiklós Máté2016-08-261-0/+1
| | | | | | | | | Fixes conditional jump depending on uninitialized value in si_state_draw.c:593 Cc: <[email protected]> Signed-off-by: Miklós Máté <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: fix format string compiler warning for 32-bit machinesJan Ziak2016-08-231-5/+6
| | | | | Signed-off-by: Jan Ziak (http://atom-symbol.net) <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Make #if 0'd debugging code compile.Matt Turner2016-08-221-1/+1
|
* vbo: remove unnecessary max_basevertex computationIlia Mirkin2016-08-181-8/+0
| | | | | | | | The max basevertex is already computed and added into max_index by the caller, _tnl_draw_prims. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* vbo: add basevertex when looking up elements for vbo splittingIlia Mirkin2016-08-181-1/+1
| | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97351 Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* vbo: Remove always true return from vbo_bind_arrays.Mathias Fröhlich2016-08-152-26/+12
| | | | | | Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Move check for vbo mapping into api_validate.c.Mathias Fröhlich2016-08-151-7/+1
| | | | | | | | | | | Instead of checking for mapped buffers in vbo_bind_arrays do this check in api_validate.c. This additionally enables printing the draw calls name into the error string. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Move _mesa_all_buffers_are_unmapped to arrayobj.c.Mathias Fröhlich2016-08-151-35/+1
| | | | | | | | | | Move the function to check if all vao buffers are unmapped into the vao implementation file. Rename the function to _mesa_all_buffers_are_unmapped. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: Array draw must not care about glBegin/glEnd vbo mapping.Mathias Fröhlich2016-08-151-17/+1
| | | | | | | | | In array draw do not check if the vertex buffer object that is used to implement immediate mode glBegin/glEnd is mapped. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: allow DrawElementsBaseVertex in display listsIlia Mirkin2016-08-141-5/+13
| | | | | | | | | Looks like it was missed originally. The multi version is there already. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97331 Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: [email protected]
* util: Move format_r11g11b10f.h to src/utilJason Ekstrand2016-08-051-1/+1
| | | | | | | It's used from both mesa main and gallium. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: Remove set but not used gl_client_array::Stride.Mathias Fröhlich2016-07-314-5/+1
| | | | | | | | The field is only read for printing today and there it was probably a leftover. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove set but not used gl_client_array::Enabled.Mathias Fröhlich2016-07-314-6/+2
| | | | | | | | The way it is used today does not care about the Enabled flag anymore. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: Use the VAO array enabled flags in vbo_exec_array.Mathias Fröhlich2016-07-311-7/+8
| | | | | | | | | Instead of gl_client_array::Enabled inside a VAO, directly use the gl_vertex_attrib_array::Enabled value which is the origin of the above. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: Walk the VAO in check_array_data.Mathias Fröhlich2016-07-311-20/+29
| | | | | | | | | Only a debugging function, but move away from gl_client_array and use the first order information from the VAO. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: Walk the VAO in print_draw_arrays.Mathias Fröhlich2016-07-311-20/+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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: Walk the VAO to check for mapped buffers.Mathias Fröhlich2016-07-311-10/+23
| | | | | | | | | Similarily to _mesa_all_varyings_in_vbos walk the VAO to check if we have an illegal mapped buffer object instead of walking all gl_client_arrays. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: Walk the VAO to see if all varyings are in vbos.Mathias Fröhlich2016-07-311-2/+2
| | | | | | | | | | | | | | | | In vbo_draw_transform_feedback we currently look at exec->array.inputs to determine if all varying vertex attributes reside in vbos. But the vbo_bind_arrays call only happens past the vbo_all_varyings_in_vbos query. Thus we may work on a stale set of client arrays. Using the current VAOs content for this query feels much more logical to me. Additionally with this change mesa makes more use of the information already tracked in the VAO instead of looping across VERT_ATTRIB_MAX vertex arrays. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: Fix handling of POS/GENERIC0 attributes.Mathias Fröhlich2016-07-271-3/+16
| | | | | | | | | | | | | In case of split primitives we need to restore the original setting of the vtx.attrsz array to make immediate mode attribute array tracking work. v2: Use bool instead of boolean. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96950
* vbo: fix attr resetRob Clark2016-07-063-7/+10
| | | | | | | | | | | | | | | In bc4e0c4 (vbo: Use a bitmask to track the active arrays in vbo_exec*.) we stopped looping over all the attributes and resetting all slots. Which exposed an issue in vbo_exec_bind_arrays() for handling GENERIC0 vs. POS. Split out a helper which can reset a particular slot, so that vbo_exec_bind_arrays() can re-use it to reset POS. This fixes an issue with 0ad (and possibly others). Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: Use a bitmask to track the active arrays in vbo_save*.Mathias Fröhlich2016-06-163-55/+69
| | | | | | | | | | | The use of a bitmask makes functions iterating only active attributes less visible in profiles. v2: Use _mesa_bit_scan{,64} instead of open coding. v3: Use u_bit_scan{,64} instead of _mesa_bit_scan{,64}. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Use a bitmask to track the active arrays in vbo_exec*.Mathias Fröhlich2016-06-163-70/+79
| | | | | | | | | | | The use of a bitmask makes functions iterating only active attributes less visible in profiles. v2: Use _mesa_bit_scan{,64} instead of open coding. v3: Use u_bit_scan{,64} instead of _mesa_bit_scan{,64}. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Declare the index range invalid for DrawTransformFeedbackJason Ekstrand2016-05-231-1/+1
| | | | | | | | | | Right now, we're setting the range to [0, 0] which is obviously bogus. Instead, we should set it to be invalid like we do for DrawIndirect. Cc: "11.1 11.2" <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* vbo: Declare the index range invalid for DrawIndirectJason Ekstrand2016-05-231-1/+1
| | | | | | | | | | | | | | Right now, we're just setting the range to [0, MAX_UINT32] which, while correct isn't helpful. With DrawIndirect, you can't really know what the actual range is so we may as well flag it as being an invalid range. This is what we do for draws with index buffer which is similar (the indices aren't statically known) if a bit simpler. Cc: "11.1 11.2" <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/vbo: fix check for zero aliases with 2/10/10/10Dave Airlie2016-05-101-1/+1
| | | | | | | | | This fixes: GL33-CTS.gtf33.GL3Tests.vertex_type_2_10_10_10_rev.vertex_type_2_10_10_10_rev_attrib Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
* vbo: avoid leaking prim on vbo bind failureIlia Mirkin2016-05-011-1/+3
| | | | | | | Spotted by Coverity Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Vinson Lee <[email protected]>
* vbo: Return INVALID_OPERATION during draw with a mapped bufferJordan Justen2016-04-272-47/+42
| | | | | | | | | | | | | | | | Fixes the OpenGLES 3.1 CTS: * ESEXT-CTS.draw_elements_base_vertex_tests.invalid_mapped_bos Because this is triggering the error message after the normal API validation phase, we don't have the API function name available, and therefore we generate an error message without the draw call name: Mesa: User error: GL_INVALID_OPERATION in draw call (vertex buffers are mapped) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95142 Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: expose EXT_base_instance in ES3 contextsIlia Mirkin2016-04-031-1/+1
| | | | | | | | This extension is identical to ARB_base_instance. Reuse the same entrypoints. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* vbo: disable the minmax cache when the hit rate is lowNicolai Hähnle2016-02-031-2/+32
| | | | | | | | | | | | | | | | | | When applications stream their index buffers, the caches for those BOs become useless and add overhead, so we want to disable them. The tricky part is coming up with the right heuristic for *when* to disable them. The first question is which hit rate to aim for. Since I'm not aware of any interesting borderline applications that do something like "draw two or three times for each upload", I just kept it simple. The second question is how soon we should give up on the caching. Applications might have a warm-up phase where they fill a buffer gradually but then keep reusing it. For this reason, I count the number of indices that hit and miss (instead of the number of calls that hit or miss), since comparing that to the size of the buffer makes sense. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add USAGE_DISABLE_MINMAX_CACHE flag to buffer UsageHistoryNicolai Hähnle2016-02-031-1/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* vbo: cache/memoize the result of vbo_get_minmax_indices (v3)Nicolai Hähnle2016-02-032-0/+171
| | | | | | | | | | | | | | | | | | | | | | | | | Some games developers are unaware that an index buffer in a VBO still needs to be read by the CPU if some varying data comes from a user pointer (unless glDrawRangeElements and friends are used). This is particularly bad when they tell us that the index buffer should live in VRAM. This cache helps, e.g. lifting This War Of Mine (a particularly bad offender) from under 10fps to slightly over 20fps on a Carrizo. Note that there is nothing prohibiting a user from rendering from multiple threads simultaneously with the same index buffer, hence the locking. (The internal buffer map taken for the buffer still leads to a race, but at least the locks are a move in the right direction.) v2: disable the cache on USAGE_TEXTURE_BUFFER as well (Chris Forbes) v3: - use bool instead of GLboolean for MinMaxCacheDirty (Ian Romanick) - replace the sticky USAGE_PERSISTENT_WRITE_MAP bit by a direct AccessFlags check Reviewed-by: Chris Forbes <[email protected]> (v2) Reviewed-by: Marek Olšák <[email protected]>
* vbo: move vbo_get_minmax_indices into its own source fileNicolai Hähnle2016-02-032-148/+179
| | | | | | | | We will add more code for caching/memoization. Moving the existing code into its own file helps keep things modular. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add support for ARB_indirect_parameters draw functionsIlia Mirkin2016-01-071-0/+103
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* glapi: add ARB_indirect_parameters definitionsIlia Mirkin2016-01-071-0/+21
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>