aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_exec_draw.c
Commit message (Collapse)AuthorAgeFilesLines
* vbo: fix glVertexAttribI* functionsMarek Olšák2012-11-061-4/+3
| | | | | | | | | | | | | | | | | | | | | | 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 support for NV_vertex_program's special attributes aliasingEric Anholt2012-10-151-5/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_beginend define.Oliver McFadden2012-09-151-6/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add gl_context::NewDriverState and use it for vertex arraysMarek Olšák2012-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+1
| | | | | | | | | | | | | | | | | | 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]>
* vbo: call UpdateState directly when notifying a driver about _NEW_ARRAYMarek Olšák2012-04-231-1/+1
| | | | | | | | Core Mesa doesn't need to know about this. This also removes the hack in recalculate_input_bindings. Reviewed-by: Brian Paul <[email protected]>
* vbo: remove vbo_context::mat_currvalMarek Olšák2012-04-191-1/+2
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: remove vbo_context::generic_currvalMarek Olšák2012-04-191-1/+2
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: remove vbo_context::legacy_currvalMarek Olšák2012-04-191-2/+2
| | | | | | | | | | | | It's not nice when you have several variables pointing to the same array and you wanna ask your editor "where is this used" and you only get an answer for one of the four currval, legacy_currval, generic_currval, mat_currval, which is quite useless, because you never see the whole picture. Let's get rid of the additional pointers. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: add _NEW_VARYING_VP_INPUTS for gl_context::varying_vp_inputsMarek Olšák2012-04-191-1/+1
| | | | | | | | | This is a frequently-updated state and _NEW_ARRAY already causes revalidation of the vbo module. It's kinda counter-productive to recompute arrays in the vbo module if _NEW_ARRAY is set and then set _NEW_ARRAY again. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Mathias Fröhlich <[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: Make gl_program::InputsRead 64 bits.Mathias Fröhlich2011-11-291-1/+1
| | | | | | | | | Make gl_program::InputsRead a 64 bits bitfield. Adapt the intel and radeon driver to handle a 64 bits InputsRead value. Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: Use The VERT_{ATTRIB,BIT} defines.Mathias Fröhlich2011-11-291-10/+12
| | | | | | Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: better handling of VBO allocation failuresBrian Paul2011-11-111-18/+44
| | | | | | | | | | | Previously, if we failed to allocate a VBO (either for display list compilation or immediate mode rendering) we'd eventually segfault when trying to map the non-existant buffer or in a glVertex/Color/etc call when we hit a null pointer. Now we don't try to map non-existant buffers and if we do fail to allocate a VBO we plug in no-op functions for glVertex/Color/etc so we don't segfault.
* vbo: remove unused var, remove unneeded local varBrian Paul2011-08-241-4/+1
|
* mesa: Eliminate dd_function_table::MapBufferIan Romanick2011-08-231-12/+6
| | | | | | | | | | 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::FlushMappedBufferRangeIan Romanick2011-08-231-2/+1
| | | | | | | | | | 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::MapBufferRangeIan Romanick2011-08-231-2/+1
| | | | | | | | | | 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::MapBufferIan Romanick2011-08-231-1/+1
| | | | | | | | | | 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-1/+1
| | | | | | | | | | 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: rename, document function paramsBrian Paul2011-02-211-5/+5
|
* vbo: commentsBrian Paul2011-02-211-0/+8
|
* vbo: replace assert(0) with proper assertionsBrian Paul2011-02-211-5/+2
|
* vbo: notify a driver that we change buffer offsets, strides, etc.Marek Olšák2011-02-141-0/+1
|
* vbo: Include mfeatures.h in files that perform feature tests.Vinson Lee2011-01-091-0/+1
|
* vbo: Avoid unnecessary copy to/from current in vertex format upgrade.Francisco Jerez2010-11-061-8/+5
| | | | | | | | | | | | | | | | | Rebuilding the vertex format from scratch every time we see a new vertex attribute is rather costly, new attributes can be appended at the end avoiding a copy to current and then back again, and the full attr pointer recalculation. In the not so likely case of an already existing attribute having its size increased the old behavior is preserved, this could be optimized more, not sure if it's worth it. It's a modest improvement in FlightGear (that game punishes the VBO module pretty hard in general, framerate goes from some 46 FPS to 50 FPS with the nouveau classic driver). Signed-off-by: Brian Paul <[email protected]>
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-4/+4
|
* mesa: Remove inclusion of compiler.h from mtypes.h.Vinson Lee2010-07-311-0/+1
| | | | | | | mtypes.h does not use any symbols from compiler.h. Also add the required headers for files that depended on symbols from compiler.h but were indirectly including compiler.h through mtypes.h.
* mesa: Remove unnecessary headers.Vinson Lee2010-07-301-1/+0
|
* Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg2010-02-191-16/+16
|
* Remove _mesa_memcpy in favor of plain memcpy.Kenneth Graunke2010-02-191-8/+8
| | | | This may break the SUNOS4 build, but it's no longer relevant.
* vbo: Remove unnecessary header from vbo_exec_draw.c.Vinson Lee2010-01-121-1/+0
|
* Merge branch 'mesa_7_6_branch'Brian Paul2009-11-041-0/+4
|\ | | | | | | | | | | Conflicts: src/mesa/drivers/windows/gdi/mesa.def
| * vbo: fix out-of-bounds array accessBrian Paul2009-11-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | The exec->vtx.inputs[] array was being written past its end. This was clobbering the following vbo_exec_context::eval state. Probably not noticed since evaluators and immediate mode rendering don't happen at the same time. Fixed the loop in vbo_exec_vtx_init(). Changed the size of the vbo_exec_context::vtx.arrays[] array. Added a bunch of debug-build assertions. Issue found by Vinson Lee.
* | mesa/main: New feature FEATURE_beginend.Chia-I Wu2009-09-301-0/+6
|/ | | | | This feature corresponds to the Begin/End paradigm. Disabling this feature also eliminates the use of GLvertexformat completely.
* vbo: Fix array pointer calculation for MapBufferRange-mapped vertex data.Eric Anholt2009-08-281-1/+3
| | | | | We would end up with the offset from the start of the mapping rather than the offset from the start of the buffer.
* Merge branch 'mesa_7_5_branch'Brian Paul2009-08-261-0/+1
|\
| * vbo: fix divide by zero exceptionBrian Paul2009-08-241-1/+1
| | | | | | | | Fixes bug 23489.
* | vbo: fix divide by zero exceptionBrian Paul2009-08-241-1/+1
| | | | | | | | Fixes bug 23489.
* | vbo: use _mesa_is_bufferobj()Brian Paul2009-08-121-6/+6
| |
* | 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
| * Merge branch 'mesa_7_5_branch' into dlist-statechange-shortcircuitKeith Whitwell2009-06-301-9/+19
| |\ | | | | | | | | | Need this to pick up fixes for per-vertex materials.
| * | mesa/vbo: use _lookup_prim_by_nr for debuggingKeith Whitwell2009-06-301-1/+1
| | | | | | | | | | | | Switch over to specialized enum lookup for primitives
* | | vbo: If MapBufferRange fails, try MapBuffer instead.Corbin Simpson2009-07-021-1/+2
| | | | | | | | | | | | | | | Fixes segfaults with radeon winsys. (Probably libdrm_radeon doing something that it shouldn't.)
* | | Merge branch 'mesa_7_5_branch'Brian Paul2009-06-301-9/+19
|\ \ \ | | |/ | |/| | | | | | | | | | Conflicts: src/mesa/vbo/vbo_exec_draw.c
| * | mesa: Set FLUSH_EXPLICIT_BIT flags when calling FlushMappedBufferRange.José Fonseca2009-06-301-9/+19
| |/ | | | | | | As prescribed by ARB_map_buffer_range.
* / vbo: asst. reformatting, clean-upsBrian Paul2009-05-221-34/+46
|/
* vbo: fix crash in vbo_exec_bind_arrays()Brian Paul2009-05-221-0/+1
| | | | | | | | | When a vertex shader uses generic vertex attribute 0, but not gl_Vertex, we need to set attribute[16] to point to attribute[0]. We were setting the attribute size, but not the pointer. Fixes crash in glsl/multitex.c when using the VertCoord attribute instead of gl_Vertex.