summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_split_copy.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Delete VAO _MaxElement code and index buffer bounds checking.Kenneth Graunke2014-09-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Roland Scheidegger <[email protected]>
* mesa: allow buffers to be mapped multiple timesMarek Olšák2014-02-251-12/+16
| | | | | | | | | | | | | | | | | | | OpenGL allows a buffer to be mapped only once, but we also map buffers internally, e.g. in the software primitive restart fallback, for PBOs, vbo_get_minmax_index, etc. This has always been a problem, but it will be a bigger problem with persistent buffer mappings, which will prevent all Mesa functions from mapping buffers for internal purposes. This adds a driver interface to core Mesa which supports multiple buffer mappings and allows 2 mappings: one for the GL user and one for Mesa. Note that Gallium supports an unlimited number of buffer and texture mappings, so it's not really an issue for Gallium. v2: fix unmapping in xm_dd.c, remove the GL errors there v3: fix the intel driver (by Fredrik) Reviewed-by: Fredrik Höglund <[email protected]>
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
* mesa: add indirect drawing buffer parameter to draw functionsChristoph Bumiller2013-11-251-1/+1
| | | | | | | | | | | | Split from patch implementing ARB_draw_indirect. v2: Const-qualify the struct gl_buffer_object *indirect argument. v3: Fix up some more draw calls for new argument. v4: Fix up rebase conflicts in i965. v5: Undo const-qualification Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove outdated version lines in commentsRico Schüller2013-06-051-1/+0
| | | | Signed-off-by: Brian Paul <[email protected]>
* mesa: Restore 78-column wrapping of license text in C-style comments.Kenneth Graunke2013-04-231-3/+4
| | | | | | | | | | | | | | The previous commit introduced extra words, breaking the formatting. This text transformation was done automatically via the following shell command: $ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript where 'vimscript' is a file containing: /THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/\*\// !fmt -w 78 -p ' * ' :wq Reviewed-by: Brian Paul <[email protected]>
* mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | This brings the license text in line with the MIT License as published on the Open Source Initiative website: http://opensource.org/licenses/mit-license.php Generated automatically be the following shell command: $ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {} This introduces some wrapping issues, to be fixed in the next commit. Reviewed-by: Brian Paul <[email protected]>
* mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | | Generated automatically be the following shell command: $ git grep 'BRIAN PAUL BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/BRIAN PAUL/THE AUTHORS/' {} The intention here is to protect all authors, not just Brian Paul. I believe that was already the sensible interpretation, but spelling it out is probably better. More practically, it also prevents people from accidentally copy & pasting the license into a new file which says Brian is not liable when he isn't even one of the authors. Reviewed-by: Brian Paul <[email protected]>
* mesa: move more format helper functions to glformats.cBrian Paul2012-07-241-1/+1
|
* mesa: add gl_context::NewDriverState and use it for vertex arraysMarek Olšák2012-05-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vbo module recomputes its states if _NEW_ARRAY is set, so it shouldn't use the same flag to notify the driver. Since we've run out of bits in NewState and NewState is for core Mesa anyway, we need to find another way. This patch is the first to start decoupling the state flags meant only for core Mesa and those only for drivers. The idea is to have two flag sets: - gl_context::NewState - used by core Mesa only - gl_context::NewDriverState - used by drivers only (the flags are defined by the driver and opaque to core Mesa) It makes perfect sense to use NewState|=_NEW_ARRAY to notify the vbo module that the user changed vertex arrays, and the vbo module in turn sets a driver-specific flag to notify the driver that it should update its vertex array bindings. The driver decides which bits of NewDriverState should be set and stores them in gl_context::DriverFlags. Then, Core Mesa can do this: ctx->NewDriverState |= ctx->DriverFlags.NewArray; This patch implements this behavior and adapts st/mesa. DriverFlags.NewArray is set to ST_NEW_VERTEX_ARRAYS. Core Mesa only sets NewDriverState. It's the driver's responsibility to read it whenever it wants and reset it to 0. Reviewed-by: Brian Paul <[email protected]>
* mesa: move gl_client_array*[] from vbo_draw_func into gl_contextMarek Olšák2012-05-081-2/+7
| | | | | | | | | | | | | | | | | | In the future we'd like to treat vertex arrays as a state and not as a parameter to the draw function. This is the first step towards that goal. Part of the goal is to avoid array re-validation for every draw call. This commit adds: const struct gl_client_array **gl_context::Array::_DrawArrays. The pointer is changed in: * vbo_draw_method * vbo_rebase_prims - unused by gallium * vbo_split_prims - unused by gallium * st_RasterPos Reviewed-by: Brian Paul <[email protected]>
* mesa: implement DrawTransformFeedback from ARB_transform_feedback2Marek Olšák2011-12-151-1/+2
| | | | | | | | | | | | | | It's like DrawArrays, but the count is taken from a transform feedback object. This removes DrawTransformFeedback from dd_function_table and adds the same function to GLvertexformat (with the function parameters matching GL). The vbo_draw_func callback has a new parameter "struct gl_transform_feedback_object *tfb_vertcount". The rest of the code just validates states and forwards the transform feedback object into vbo_draw_func.
* mesa: Set the "Integer" field of gl_client_array properly.Paul Berry2011-11-021-0/+1
| | | | | | | | | | | This patch ensures that gl_client_array::Integer is properly set to GL_TRUE for vertex attributes specified using glVertexAttribIPointer, and to GL_FALSE for vertex attributes specified using glVertexAttribPointer, so that the vertex attributes can be interpreted properly by driver back-ends. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Eliminate dd_function_table::MapBufferIan Romanick2011-08-231-2/+3
| | | | | | | | | | Replace all calls to dd_function_table::MapBuffer with appropriate calls to dd_function_table::MapBufferRange, then remove all the cruft. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove target parameter from dd_function_table::MapBufferIan Romanick2011-08-231-3/+2
| | | | | | | | | | No driver used that parameter, and most drivers ended up with a bunch of unused-parameter warnings because it was there. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove target parameter from dd_function_table::UnmapBufferIan Romanick2011-08-231-2/+2
| | | | | | | | | | No driver used that parameter, and most drivers ended up with a bunch of unused-parameter warnings because it was there. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Update _ElementSize.Brian Paul2011-04-071-0/+1
|
* vbo: initialize num_instances in a few placesBrian Paul2011-01-181-0/+1
| | | | | | This fixes https://bugs.freedesktop.org/show_bug.cgi?id=33247 There might still be some issues with drawing multiple instances with VBO splitting to investigate someday.
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-5/+5
|
* vbo: Fix vbo_split_copy to pass correct max_index to draw.Pauli Nieminen2010-03-211-1/+1
| | | | | | | | vbo_split_copy was passing one past the max_index to draw function which caused _tnl_draw_prims function to read uninitialized values from copied array. Bug was spoted in valgrind report of progs/tests/cva_huge.
* Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg2010-02-191-18/+18
|
* Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versionsKristian Høgsberg2010-02-191-7/+7
|
* vbo: Remove unnecessary header from vbo_split_copy.c.Vinson Lee2010-01-111-3/+0
|
* mesa: Add support for ARB_draw_elements_base_vertex.Eric Anholt2009-09-081-20/+32
|
* vbo: use _mesa_is_bufferobj()Brian Paul2009-08-121-4/+7
|
* vbo: Avoid extra validation of DrawElements.Eric Anholt2009-08-121-0/+1
| | | | | | | | | | | | | This saves mapping the index buffer to get a bounds on the indices that drivers just drop on the floor in the VBO case (cache win), saves a bonus walk of the indices in the CheckArrayBounds case, and other miscellaneous validation. On intel it's a particularly a large win (50-100% in my app) because even though we let the indices stay in both CPU and GPU caches, we still end up waiting for the GPU to be done with the buffer before reading from it. Drivers that want the min/max_index fields must now check index_bounds_valid and use vbo_get_minmax_index before using them.
* Merge branch 'mesa_7_5_branch'Jakob Bornecrantz2009-07-031-1/+1
|\ | | | | | | | | | | Conflicts: src/mesa/main/dlist.c src/mesa/vbo/vbo_save_api.c
| * mesa/vbo: use _lookup_prim_by_nr for debuggingKeith Whitwell2009-06-301-1/+1
| | | | | | | | Switch over to specialized enum lookup for primitives
* | mesa: revert some recent VBO buffer object refcounting changesBrian Paul2009-06-151-5/+2
| | | | | | | | | | | | | | | | Reverts part of commit d7ea9ddf5824556e47decac7ba200f37cf1e552f. We were calling _mesa_reference_buffer_object() on some heap-allocated memory that was uninitialized and could trigger an assertion. We can actually go back to "looser" ref counting of the Null/default buffer object in these cases.
* | mesa: use _mesa_reference_buffer_object() in a few placesBrian Paul2009-06-121-2/+5
| |
* | vbo: new debug/dump code (disabled)Brian Paul2009-06-031-0/+58
| |
* | mesa: move the NullBufferObj from GLcontext to gl_shared_stateBrian Paul2009-05-071-2/+2
| | | | | | | | | | Since shared array objects may point to the null/default buffer object, the null/default buffer object should be part of the shared state.
* | mesa: use _mesa_sizeof_type() in vbo split codeBrian Paul2009-05-071-16/+2
| |
* | mesa: vbo code reformatting, clean-up, commentsBrian Paul2009-05-071-43/+52
| |
* | mesa: in vbo split code, map buffers read-only, not write-onlyBrian Paul2009-05-071-6/+6
|/ | | | And use GL_ELEMENT_ARRAY_BUFFER where appropriate.
* mesa: set the new array->Format field in VBO codeBrian Paul2009-01-231-0/+1
| | | | Should help to solve failed assertion in i965 driver (see bug 19708)
* fix vbo_split_copy related bug 9962Xiang, Haihao2007-08-071-1/+8
|
* Be more consistant with paths in #includes. Eventually, eliminate a bunch ↵Brian2007-07-041-5/+5
| | | | of -I flags.
* fix missing ADD_POINTERS, fixes crashes if the index elements are in a vbo.Roland Scheidegger2007-02-011-5/+7
|
* Use new rebase helper. Remove other rebase code.Keith Whitwell2007-01-301-1/+0
|
* allocate larger minimum dstelt bufferRoland Scheidegger2007-01-251-1/+1
| | | | | | | | increase the minimum dstelt buffer size to avoid triggering an assertion later because the split is triggered before the buffer is full. This fixes cases where the vbo_split_copy path is hit because of maximum index limit, where the dstelt buffer size needed could be very small (doom3 hit that assertion with a vertex count of just 3)
* fix dstelt memory allocation to avoid hash corruptionRoland Scheidegger2007-01-251-1/+1
|
* Fix invalid enums passed to MapBufferAapo Tahkola2007-01-181-2/+2
|
* Merge branch 'master' of git+ssh://[email protected]/git/mesa/mesa ↵Keith Whitwell2007-01-161-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | into vbo-0.2 Conflicts: src/mesa/array_cache/sources src/mesa/drivers/dri/i965/brw_context.c src/mesa/drivers/dri/i965/brw_draw.c src/mesa/drivers/dri/i965/brw_fallback.c src/mesa/drivers/dri/i965/brw_vs_emit.c src/mesa/drivers/dri/i965/brw_vs_tnl.c src/mesa/drivers/dri/mach64/mach64_context.c src/mesa/main/extensions.c src/mesa/main/getstring.c src/mesa/tnl/sources src/mesa/tnl/t_save_api.c src/mesa/tnl/t_save_playback.c src/mesa/tnl/t_vtx_api.c src/mesa/tnl/t_vtx_exec.c src/mesa/vbo/vbo_attrib.h src/mesa/vbo/vbo_exec_api.c src/mesa/vbo/vbo_save_api.c src/mesa/vbo/vbo_save_draw.c
* New files to manage splitting drawing commandskeithw2007-01-151-0/+549