summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo
Commit message (Collapse)AuthorAgeFilesLines
* vbo: move DLIST_DANGLING_REFS from mtypes.h to vbo_save_api.cBrian Paul2018-01-241-0/+5
| | | | | | It's only used in this file. Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: replace assert(0) with unreachable()Brian Paul2018-01-245-11/+10
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: fix, add comment in vbo_save.hBrian Paul2018-01-241-2/+2
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: whitespace, formatting fixes in vbo_split.[ch]Brian Paul2018-01-242-60/+65
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: fix VBO optimization regressionBrian Paul2018-01-182-4/+7
| | | | | | | | | | | | | | | The optimization in change 8e4efdc895ea ("vbo: optimize some display list drawing") missed the loopback case. This is used when the glBegin/End primitive doesn't have a uniform set of vertex attributes. The new Piglit gl-1.0-dlist-materials test hits this. So check the aligned_vertex_buffer_offset(list) value and adjust the buffer offset accordingly. We also need to remove the 'start == 0' assertion in the loopback code since it no longer applies. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: remove unneeded #includes of main/compiler.hBrian Paul2018-01-171-1/+0
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* vbo: reindent vbo_attrib.h to use 3 spacesBrian Paul2018-01-171-50/+50
| | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vbo: whitespace, formatting fixes in vbo_exec_api.cBrian Paul2018-01-171-99/+98
| | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vbo: add assertions, comments in vbo_exec_api.cBrian Paul2018-01-171-1/+7
| | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vbo: whitespace, formatting fixes in vbo_exec_draw.cBrian Paul2018-01-171-64/+64
| | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vbo: use inputs_read var to simplify codeBrian Paul2018-01-172-8/+8
| | | | | | | | v2: add some const qualifiers, per Ian. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vbo: whitespace, formatting fixes in vbo_split_copy.cBrian Paul2018-01-171-160/+144
| | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vbo: use a new local 'array' variable in bind_vertex_list() loopBrian Paul2018-01-171-12/+13
| | | | | | | | Make the code a bit more concise. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vbo: remove unneeded #includes in vbo_context.cBrian Paul2018-01-171-2/+0
| | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vbo: whitespace, formatting fixes in vbo_context.cBrian Paul2018-01-171-24/+35
| | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vbo: change vbo_context attribute map arrays to GLubyteBrian Paul2018-01-174-5/+8
| | | | | | | | | | | The values will never be larger than VBO_ATTRIB_MAX (currently 44). v2: add STATIC_ASSERT to be sure VBO_ATTRIB_MAX can fit in ubyte, per Emil. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vbo: lift common code out of switch casesBrian Paul2018-01-172-18/+12
| | | | | | | | Both switch cases began with the same code. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vbo: optimize some display list drawing (v2)Brian Paul2018-01-173-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: rewrite some code in playback_copy_to_current()Brian Paul2018-01-171-8/+6
| | | | | | I think this is a little easier to understand. Reviewed-by: Ian Romanick <[email protected]>
* vbo: add some comments in vbo_save_api.cBrian Paul2018-01-171-0/+17
| | | | Reviewed-by: Ian Romanick <[email protected]>
* vbo: rename some functions in vbo_save_api.cBrian Paul2018-01-171-37/+37
| | | | Reviewed-by: Ian Romanick <[email protected]>
* vbo: rename some functions in vbo_save_draw.cBrian Paul2018-01-171-9/+9
| | | | 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: minor code simplification in _save_compile_vertex_list()Brian Paul2018-01-171-4/+5
| | | | Reviewed-by: Ian Romanick <[email protected]>
* vbo: rename prim to primsBrian Paul2018-01-173-47/+47
| | | | | | | 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: removed unused ctx parameter for alloc_prim_store()Brian Paul2018-01-171-4/+3
| | | | Reviewed-by: Ian Romanick <[email protected]>
* vbo: rename vbo_save_context::buffer to buffer_mapBrian Paul2018-01-172-9/+9
| | | | | | 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-173-12/+13
| | | | Reviewed-by: Ian Romanick <[email protected]>
* vbo: rename vbo_save_vertex_store::buffer to buffer_mapBrian Paul2018-01-173-14/+15
| | | | | | 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-172-2/+2
| | | | | | 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]>
* vbo: whitespace fixes in vbo_save_draw.cBrian Paul2018-01-171-30/+31
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: shrink VERT_ATTRIB bitfields to 32 bitsMarek Olšák2017-11-253-3/+3
| | | | | | There are only 32 vertex attribs now. Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove unused vertex attrib WEIGHTMarek Olšák2017-11-251-1/+0
| | | | | | | | | | | | We don't support ARB_vertex_blend. Note that the attribute aliasing check for ARB_vertex_program had to be rewritten. vbo_context: 20344 -> 20008 bytes gl_context: 74672 -> 74616 bytes Reviewed-by: Ian Romanick <[email protected]>
* mesa: don't assign numbers to vertex attrib enums manuallyMarek Olšák2017-11-251-46/+46
| | | | | | I plan to remove one of them. Reviewed-by: Ian Romanick <[email protected]>
* mesa: use simple mtx in core mesaTimothy Arceri2017-11-091-4/+4
| | | | | | | | | Results from x11perf -copywinwin10 on Eric's SKL: 4.33338% ± 0.905054% (n=40) Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Yogesh Marathe <[email protected]>
* vbo: fix build errors on androidTapani Pälli2017-09-051-1/+1
| | | | | | | | | | | | | incompatible pointer to integer conversion assigning to 'GLintptr' (aka 'int') from 'const char *' [-Werror,-Wint-conversion] offset = indices; ^ ~~~~~~~ Fixes: 2d93b462b4d ("vbo: fix offset in minmax cache key") Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* vbo: fix offset in minmax cache keyCharmaine Lee2017-08-301-3/+5
| | | | | | | | | | | | | Instead of saving primitive offset in the minmax cache key, save the actual buffer offset which is used in the cache lookup. Fixes rendering artifact seen with GoogleEarth when run with VMware driver. v2: Per Brian's comment, initialize offset to avoid compiler warning. Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
* vbo: fix glVertexAttrib(index=0)Brian Paul2017-08-242-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on which extension or GL spec you read the behavior of glVertexAttrib(index=0) either sets the current value for generic attribute 0, or it emits a vertex just like glVertex(). I believe it should do either, depending on context (see below). The piglit gl-2.0-vertex-const-attr test declares two vertex attributes: attribute vec2 vertex; attribute vec4 attr; and the GLSL linker assigns "vertex" to location 0 and "attr" to location 1. The test passes. But if the declarations were reversed such that "attr" was location 0 and "vertex" was location 1, the test would fail to draw properly. The problem is the call to glVertexAttrib(index=0) to set attr's value was interpreted as glVertex() and did not set generic attribute[0]'s value. Interesting, calling glVertex() outside glBegin/End (which is effectively what the piglit test does) does not generate a GL error. I believe the behavior of glVertexAttrib(index=0) should depend on whether it's called inside or outside of glBegin/glEnd(). If inside glBegin/End(), it should act like glVertex(). Else, it should behave like glVertexAttrib(index > 0). This seems to be what NVIDIA does. This patch makes two changes: 1. Check if we're inside glBegin/End for glVertexAttrib() 2. Fix the vertex array binding for recalculate_input_bindings(). As it was, we were using &vbo->currval[VBO_ATTRIB_POS], but that's interpreted as a zero-stride attribute and doesn't make sense for array drawing. No Piglit regressions. Fixes updated gl-2.0-vertex-const-attr test and passes new gl-2.0-vertex-attrib-0 test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101941 Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* vbo: use new _is_vertex_position() helper in vbo_attrib_tmp.hBrian Paul2017-08-211-36/+46
| | | | | | | Makes the code a bit more understandable. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* vbo: make vbo_bind_arrays() staticBrian Paul2017-08-212-3/+1
| | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: fix ES only draw if we have vertex positionsTimothy Arceri2017-08-221-2/+2
| | | | | | | | | | | | This code was separated from the validation code so it could use used with KHR_no_error paths. The return values were inverted to reflect the name of the helper, but here the condtion was mistakenly inverted rather than the return value. Fixes: 4df2931a87fe (mesa/vbo: move some Draw checks out of validation) Reported-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add KHR_no_error support to glDrawTransformFeedback*()Samuel Pitoiset2017-07-311-3/+10
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glMultiDrawArrays()Samuel Pitoiset2017-07-311-2/+9
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glMultiDraw*Indirect*()Samuel Pitoiset2017-07-311-14/+42
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glMultiDrawElementsBaseVertex()Samuel Pitoiset2017-07-311-3/+10
| | | | | | | Just skip validation when no_error is enabled. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* vbo: fix glPrimitiveRestartNV crash inside a display listOlivier Lauffenburger2017-07-071-5/+15
| | | | | | | | | | | | | | | | | | | | glPrimitiveRestartNV crashes when it is called during the compilation of a display list. There are two reasons: - ctx->Driver.CurrentSavePrimitive is not set to the current primitive - save_PrimitiveRestartNV() calls _save_Begin() which only sets an OpenGL error, instead of calling vbo_save_NotifyBegin(). This patch correctly calls vbo_save_NotifyBegin() but it detects the current primitive mode by looking at the latest saved primitive. Additional work by Brian Paul Signed-off-by: Olivier Lauffenburger <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101464 Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* vbo: rename target->index in loopback codeBrian Paul2017-07-071-12/+12
| | | | | | Because it's a vertex attribute index. Reviewed-by: Charmaine Lee <[email protected]>