summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_save.h
Commit message (Collapse)AuthorAgeFilesLines
* vbo: Make no_current_update an argument to vbo_save_NotifyBegin.Mathias Fröhlich2018-11-011-1/+0
| | | | | | | | | | | Instead of coding additional information into the primitive mode, make the only remaining flag there a direct argument to vbo_save_NotifyBegin. v2: Fix incorrect no_current_update in glRectf. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Move no_current_update out of _mesa_prim.Mathias Fröhlich2018-11-011-0/+2
| | | | | | | | | | | | | | | | The _mesa_prim::no_current_update flag should tell the compiled display list if the current attributes that are placed in the dlists vbo shall take a defined state past replay of a display list. Immediate mode draws compiled into display lists should set the current values. Array draws may leave the current values in undefined state. So finally this flag is not a property of every primitive but it is a property of the compiled display list and there it is a property of the last primitive compiled into the list. So move the flag out of _mesa_prim into vbo_save. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove the now unused VBO_SAVE_PRIM_WEAK define.Mathias Fröhlich2018-11-011-1/+0
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove the VBO_SAVE_FALLBACK flag.Mathias Fröhlich2018-11-011-2/+0
| | | | | | | | | | | On finishing a display list playback the VBO_SAVE_FALLBACK bit is still kept in vbo_save_context::replay_flags. But examining replay_flags and the display list flags that feed this value the corresponding bit is never set these days anymore. So, since it is nowhere set or checked, we can safely remove it. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove unused vbo_save_fallback function.Mathias Fröhlich2018-11-011-1/+0
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: include mtypes.h lessMarek Olšák2018-04-121-1/+0
| | | | | | | | | | - remove mtypes.h from most header files - add main/menums.h for often used definitions - remove main/core.h v2: fix radv build Reviewed-by: Brian Paul <[email protected]>
* vbo: Remove vbo_save_vertex_list::vertex_size.Mathias Fröhlich2018-03-011-1/+0
| | | | | | | | Like before use local variables from compile_vertex_list instead. Remove vertex_size from struct vbo_save_vertex_list. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove vbo_save_vertex_list::buffer_offset.Mathias Fröhlich2018-03-011-14/+0
| | | | | | | | | | The buffer_offset is used in aligned_vertex_buffer_offset. But now that most of these decisions are done in compile_vertex_list we can work on local variables instead of struct members in the display list code. Clean that up and remove buffer_offset. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove vbo_save_vertex_list::start_vertex.Mathias Fröhlich2018-03-011-1/+0
| | | | | | | | Replace last use on replay with _vbo_save_get_{min,max}_index. Appart from that it is not used anymore. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove vbo_save_vertex_list::attrsz.Mathias Fröhlich2018-03-011-1/+0
| | | | | | | | Is not used anymore on replay, move the last use in display list compilation to the original array in the display list compiler. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove vbo_save_vertex_list::attrtype.Mathias Fröhlich2018-03-011-1/+0
| | | | | | | | Is not used anymore on replay, move the last use in display list compilation to the original array in the display list compiler. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove vbo_save_vertex_list::enabled.Mathias Fröhlich2018-03-011-1/+0
| | | | | | | Is not used anymore on replay. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove reference to the vertex_store from the dlist node.Mathias Fröhlich2018-03-011-4/+2
| | | | | | | | Since we now store a set of VAOs in the display list, use these object to get the reference to the VBO in several places. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Implement current values update in terms of the VAO.Mathias Fröhlich2018-03-011-1/+0
| | | | | | | | | Use the information already present in the VAO to update the current values after display list replay. Set GL_OUT_OF_MEMORY on allocation failure for the current value update storage. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Implement vbo_loopback_vertex_list in terms of the VAO.Mathias Fröhlich2018-03-011-7/+48
| | | | | | | | | | | Use the information already present in the VAO to replay a display list node using immediate mode draw commands. Use a hand full of helper methods that will be useful for the next patches also. v2: Insert asserts, constify local variables. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Use a local variable for the dlist offsets.Mathias Fröhlich2018-03-011-1/+0
| | | | | | | | The master value is now stored inside the VAO already present in struct vbo_save_vertex_list. Remove the unneeded copy from dlist storage. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove unused vbo_save_context::wrap_count.Mathias Fröhlich2018-03-011-1/+0
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove unused vbo_save_vertex_list::dangling_attr_ref.Mathias Fröhlich2018-03-011-2/+0
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Make use of _DrawVAO from the dlist code.Mathias Fröhlich2018-02-231-2/+2
| | | | | | | | | Finally use an internal VAO to execute display list draws. Avoid duplicate state validation for display list draws. Remove client arrays previously used exclusively for display lists. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Correctly handle attribute offsets in dlist draw.Mathias Fröhlich2018-02-011-0/+1
| | | | | | | | | | | | | | | | | | | When executing a display list draw, for the offset list to be correct, the offset computation needs to accumulate all attribute size values in order. Specifically, if we are shuffling around the position and generic0 attributes, we may violate the order or if we do not walk the generic vbo attributes we may skip some of the attributes. Even if this is an unlikely usecase we can fix this use case by precomputing the offsets on the full attribute list and store the full offset list in the display list node. v2: Formatting fix v3: Rebase Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: replace GLenum with GLenum16 in common structures (v4)Marek Olšák2018-01-291-2/+2
| | | | | | | | | | | | | v2: - fix glGet* - also use GLenum16 for DrawBuffers v3: - rebase to top of tree (BrianP) and incorporate Ian's suggestions v4: - fix a GLenum16 bug in VBO/save code, add some STATIC_ASSERT()s gl_context = 152432 -> 136840 bytes vbo_context = 22096 -> 20608 bytes Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* vbo: fix incorrect min/max_index values in display list draw callBrian Paul2018-01-241-1/+2
| | | | | | | | | | | | | | This fixes another regression from commit 8e4efdc895ea ("vbo: optimize some display list drawing"). The problem was the min_index, max_index values passed to the vbo drawing function were not computed to compensate for the biased prim::start values. https://bugs.freedesktop.org/show_bug.cgi?id=104746 https://bugs.freedesktop.org/show_bug.cgi?id=104742 https://bugs.freedesktop.org/show_bug.cgi?id=104690 Tested-by: Clayton Craft <[email protected]> Fixes: 8e4efdc895ea ("vbo: optimize some display list drawing") Reviewed-by: Emil Velikov <[email protected]>
* vbo: fix, add comment in vbo_save.hBrian Paul2018-01-241-2/+2
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: optimize some display list drawing (v2)Brian Paul2018-01-171-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vbo_save_vertex_list structure records one or more glBegin/End primitives which all have the same vertex format. To draw these primitives, we setup the vertex array state, then issue the drawing command. Before, the 'start' vertex was typically zero and we used the vertex array pointer to indicate where the vertex data starts. This patch checks if the vertex buffer offset is an exact multiple of the vertex size. If so, that means we can use zero-based vertex array pointers and use the draw's start value to indicate where the vertex data starts. This means a series of display list drawing commands may have identical vertex array state. This will get filtered out by the Gallium CSO module so we can issue a tight series of drawing commands without state changes to the device. Note that this also works for a series of glCallList commands (not just one list that contains multiple glBegin/End pairs). No Piglit or conform changes. v2: minor fixes suggested by Ian. Reviewed-by: Ian Romanick <[email protected]>
* vbo: add comment that vbo_save_vertex_list::buffer_offset is in bytesBrian Paul2018-01-171-1/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* vbo: rename prim to primsBrian Paul2018-01-171-2/+2
| | | | | | | Using a plural name makes it easier to see that this is an array and not a pointer to a single object. Reviewed-by: Ian Romanick <[email protected]>
* vbo: rename vbo_save_context::buffer to buffer_mapBrian Paul2018-01-171-2/+2
| | | | | | And move the field and improve comments. Reviewed-by: Ian Romanick <[email protected]>
* vbo: remove unused vbo_save_context::count fieldBrian Paul2018-01-171-1/+0
| | | | Reviewed-by: Ian Romanick <[email protected]>
* vbo: s/GLuint/GLbitfield/ for vbo_save_context::replay_flagsBrian Paul2018-01-171-1/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* vbo: rename vbo_save_vertex_list::count to vertex_countBrian Paul2018-01-171-1/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* vbo: rename vbo_save_vertex_store::buffer to buffer_mapBrian Paul2018-01-171-1/+1
| | | | | | To match other parts of the VBO code and make things easier to understand. Reviewed-by: Ian Romanick <[email protected]>
* vbo: rename vbo_save_primitive_store::buffer to primsBrian Paul2018-01-171-1/+1
| | | | | | A little easier to understand. Reviewed-by: Ian Romanick <[email protected]>
* vbo: whitespace fixes in vbo_save.hBrian Paul2018-01-171-15/+17
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: rename gl_client_array -> gl_vertex_arrayBrian Paul2016-10-281-2/+2
| | | | | | | | | | | 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]>
* 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: Use a bitmask to track the active arrays in vbo_save*.Mathias Fröhlich2016-06-161-0/+2
| | | | | | | | | | | 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]>
* mesa: remove Driver.EndCallListMarek Olšák2015-10-031-2/+0
| | | | | | Nothing overrides it. Reviewed-by: Brian Paul <[email protected]>
* mesa: remove Driver.BeginCallListMarek Olšák2015-10-031-1/+0
| | | | | | Nothing overrides it. Reviewed-by: Brian Paul <[email protected]>
* mesa: remove Driver.EndListMarek Olšák2015-10-031-1/+0
| | | | | | Nothing overrides it. Reviewed-by: Brian Paul <[email protected]>
* mesa: remove Driver.NewListMarek Olšák2015-10-031-1/+0
| | | | | | Nothing overrides it. Reviewed-by: Brian Paul <[email protected]>
* mesa: remove Driver.NotifySaveBeginMarek Olšák2015-10-031-1/+0
| | | | | | Nothing overrides it. Reviewed-by: Brian Paul <[email protected]>
* mesa: remove Driver.SaveFlushVerticesMarek Olšák2015-10-031-1/+0
| | | | | | Nothing overrides it. Reviewed-by: Brian Paul <[email protected]>
* mesa: use fi_type in vertex attribute codeMarius Predut2015-02-251-9/+9
| | | | | | | | | | | | | | | | | | | | | | | For 32-bit builds, floating point operations use x86 FPU registers, not SSE registers. If we're actually storing an integer in a float variable, the value might get modified when written to memory. This patch changes the VBO code to use the fi_type (float/int union) to store/copy vertex attributes. Also, this can improve performance on x86 because moving floats with integer registers instead of FP registers is faster. Neil Roberts review: - include changes on all places that are storing attribute values. - check with and without -O3 compiler flag. Brian Paul review: - use fi_type type instead gl_constant_value type - fix a bunch of nit-picks. - fix compiler warnings Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82668 Signed-off-by: Marius Predut <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the old copyright name is creating unnecessary confusion, hence this change. This was the sed script I used: $ cat tg2vmw.sed # Run as: # # git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed # # Rename copyrights s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./ s/TUNGSTEN GRAPHICS/VMWARE/g # Rename emails s/[email protected]/[email protected]/ s/[email protected]/[email protected]/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\[email protected]/[email protected]/g s/keithw\[email protected]/[email protected]/g s/[email protected]/[email protected]/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/[email protected]/[email protected]/ # Remove dead links s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g # C string src/gallium/state_trackers/vega/api_misc.c s/"Tungsten Graphics, Inc"/"VMware, Inc"/ Reviewed-by: Brian Paul <[email protected]>
* vbo: assorted minor clean-upsBrian Paul2013-10-111-1/+1
| | | | | Use GL_TRUE/FALSE instead of 1/0. Remove extraneous parentheses. Remove trailing whitespace.
* vbo: add comments, const qualifiersBrian Paul2013-05-031-4/+4
| | | | Reviewed-by: José Fonseca <[email protected]>
* mesa: remove #include "mfeatures.h" from numerous source filesBrian Paul2013-04-171-1/+0
| | | | | | None of the remaining FEATURE_x symbols in mfeatures.h are used anymore. Reviewed-by: Jordan Justen <[email protected]>
* vbo: fix glVertexAttribI* functionsMarek Olšák2012-11-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | The functions were broken, because they converted ints to floats. Now we can finally advertise OpenGL 3.0. ;) In this commit, the vbo module also tracks the type for each attrib in addition to the size. It can be one of FLOAT, INT, UNSIGNED_INT. The little ugliness is the vertex attribs are declared as floats even though there may be integer values. The code just copies integer values into them without any conversion. This implementation passes the glVertexAttribI piglit test which I am going to commit in piglit soon. The test covers vertex arrays, immediate mode and display lists. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]> v2: cosmetic changes as suggested by Brian
* mesa: remove FEATURE_dlist define.Oliver McFadden2012-09-151-16/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: unmap vertex store before executing listsBrian Paul2012-02-091-0/+8
| | | | | | | | | We don't want our VBOs mapped when we're drawing. This change checks if the vertex store VBO is mapped before we execute a list, unmaps it, then remaps it after drawing. This situation pops up when building a nested display list in GL_COMPILE_AND_EXECUTE mode. Reviewed-by: Eric Anholt <[email protected]>