aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/bufferobj.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: use GLsizeiptrARB, GLintptrARB in bufferobj.cBrian Paul2018-09-201-3/+3
| | | | | | | | | | | | | | | The function pointer declarations in dd.h for the BufferData() and BufferSubData() use the ARB-suffixed datatypes. This patch changes the buffer_data_fallback() and buffer_sub_data_fallback() functions to use those datatypes too. This fixes a build warning when building 32-bit libraries. Evidently, GLsizeiptrARB and GLsizeiptr are defined differently in that situation. All all implementations of these driver hooks use the ARB-suffixed types. Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: add ARB_draw_indirect support to compat profileTimothy Arceri2018-06-301-2/+1
| | | | | | v2: add missing ARB_base_instance support Reviewed-by: Marek Olšák <[email protected]>
* mesa: Remove flush_vertices argument from VAO methods.Mathias Fröhlich2018-05-171-1/+1
| | | | | | | The flush_vertices argument is now unused, remove it. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Add flush_vertices to _mesa_bind_vertex_buffer.Mathias Fröhlich2018-02-231-1/+1
| | | | | | | We will need the flush_vertices argument later in this series. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Use atomics for buffer objects reference counts.Mathias Fröhlich2018-02-061-16/+6
| | | | | | | | | | | | | | | | | | | The mutex is currently used for reference counting and updating the minmax index cache. The change uses atomics directly for reference counting and the mutex for the minmax cache. This is safe since the reference count is not modified beside in _mesa_reference_buffer_object where atomics aim to be used. While using the minmax cache, the calling code holds a reference to the buffer object. Thus unreferencing or even referencing the buffer object does not need to be serialized with accessing the minmax cache. The change reduces the time _mesa_reference_buffer_object_ takes by about a factor of two when looking at perf results for some of my favorite use cases. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: use simple mtx in core mesaTimothy Arceri2017-11-091-7/+7
| | | | | | | | | 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]>
* mesa/bufferobj: don't double negate the rangeDave Airlie2017-10-241-3/+3
| | | | | | | | | | | | | This fixes a regression I introduced refactoring this code, I managed to invert range twice, I moved the inversion into the common code, but forgot to stop doing it in the callee. Fixes: GL45-CTS.multi_bind.dispatch_bind_buffers_base Fixes: 35ac13ed3 (mesa/bufferobj: consolidate some codepaths between ubo/ssbo/atomics.) Reported-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/bufferobj: consolidate some buffer binding code.Dave Airlie2017-10-111-42/+35
| | | | | | | | | These paths are again 90% the same, consolidate them into one. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/bufferobj: consolidate some codepaths between ubo/ssbo/atomics.Dave Airlie2017-10-111-102/+47
| | | | | | | | | These are 90% the same code, consolidate them into a couple of common codepaths. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: rename various buffer bindings to one struct.Dave Airlie2017-10-111-9/+9
| | | | | | | | One binding to bind them all, these are all the same thing. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: align atomic buffer handling code with ubo/ssbo (v1.1)Dave Airlie2017-10-111-44/+91
| | | | | | | | | | | | | | this adds automatic size support to the atomic buffer code, but also realigns the code to act like the ubo/ssbo code. v1.1: add missing blank lines. reindent one block properly. check for NullBufferObj. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: silence 'variable may be used uninitialized' warning in bufferobj.cBrian Paul2017-10-031-0/+1
| | | | | | Found with MinGW optimized build. Reviewed-by: Charmaine Lee <[email protected]>
* mesa: remove duplicate assignments in bind_xfb_buffers()Samuel Pitoiset2017-08-241-3/+0
| | | | | | | | Useless to do that before checking errors. It's now similar to the other bind_XXX_buffers() helpers. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: only expose EXT_memory_object functions if the ext is supportedSamuel Pitoiset2017-08-221-7/+14
| | | | | | | | | They should not be exposed when the extension is unsupported. Note that ARB_direct_state_access is always exposed and EXT_semaphore is not supported at all. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: don't error check the default buffer objectTimothy Arceri2017-08-081-11/+11
| | | | | | | An allocation check is already done when the buffer is created at context creation. Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: hook up (Named)BufferStorageMem apiTimothy Arceri2017-08-061-20/+65
| | | | | | | | | | | | | | | | | | Include no_error variants as well. v2 (Timothy Arceri): - reduced code churn by squashing some changes into previous commits v3 (Timothy Arceri): - drop unused function declaration v4 (Timothy Arceri): - fix Driver function assert() - add missing GL errors Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mapi: add EXT_external_objects and EXT_external_objects_fdAndres Rodriguez2017-08-061-0/+31
| | | | | | | | Includes implementation stubs. Signed-off-by: Andres Rodriguez <[email protected]> Acked-by: Timothy Arceri <[email protected]> Acked-by: Samuel Pitoiset <[email protected]>
* mesa: add KHR_no_error support to glClear*Buffer*Data()Samuel Pitoiset2017-08-021-0/+73
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add clear_buffer_sub_data_error() helperSamuel Pitoiset2017-08-021-17/+35
| | | | | | | And make clear_buffer_sub_data() always inline. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glNamedBufferData() and glBufferData()Samuel Pitoiset2017-08-021-0/+30
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add buffer_data() and buffer_data_error() helpersSamuel Pitoiset2017-08-021-48/+64
| | | | | | | And call buffer_data_error() from _mesa_buffer_data(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glDeleteBuffers()Samuel Pitoiset2017-07-311-0/+8
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add delete_buffers() helperSamuel Pitoiset2017-07-311-10/+17
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: check that buffer object is not NULL before initializing itTimothy Arceri2017-07-271-4/+3
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: drop useless assertTimothy Arceri2017-07-261-1/+0
| | | | | | | NewBufferObj() is called when the shared state is allocated so we wouldn't get this far if it was NULL. Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: call binding functions directly from glDeleteBuffersTimothy Arceri2017-07-261-3/+9
| | | | | | This avoids useless error checking. Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: move static binding functions above _mesa_DeleteBuffers()Timothy Arceri2017-07-261-207/+205
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: don't try to re-generate the default bufferTimothy Arceri2017-07-261-6/+6
| | | | | | It should have been created by this point. Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: add KHR_no_error support for gl*Buffers()Samuel Pitoiset2017-06-281-0/+16
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: prepare create_buffers() helper for KHR_no_error supportSamuel Pitoiset2017-06-281-17/+24
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove _NEW_BUFFER_OBJECTMarek Olšák2017-06-221-2/+2
| | | | | | | | not used Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: refuse to change tex buffers when a handle is allocatedSamuel Pitoiset2017-06-141-2/+2
| | | | | | | | | | | The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by BufferData if it is called to modify a buffer object bound to a buffer texture while that texture object is referenced by one or more texture handles." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glBindBuffer()Samuel Pitoiset2017-06-071-0/+10
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glInvalidateBufferData()Samuel Pitoiset2017-06-071-0/+9
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glInvalidateBufferSubData()Samuel Pitoiset2017-06-071-0/+10
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add invalidate_buffer_subdata() helperSamuel Pitoiset2017-06-071-4/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glBindBufferRange()Timothy Arceri2017-05-301-37/+66
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: create bind_buffer_range() helperTimothy Arceri2017-05-301-3/+10
| | | | | | | This will help us add KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: convert mesa_bind_buffer_range_transform_feedback() to a validate functionTimothy Arceri2017-05-301-4/+8
| | | | | | | | This allows some tidy up and also makes it so we can add KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: split bind_atomic_buffer() in twoTimothy Arceri2017-05-301-25/+29
| | | | | | | This will help us add KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: split bind_buffer_range_shader_storage_buffer() in twoTimothy Arceri2017-05-301-13/+23
| | | | | | | This will help us implement KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: split bind_buffer_range_uniform_buffer() in twoTimothy Arceri2017-05-301-13/+19
| | | | | | | This will help us implement KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: add KHR_no_error support for glBufferSubData()Timothy Arceri2017-05-171-3/+17
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glNamedBufferSubData()Timothy Arceri2017-05-171-7/+20
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add buffer_sub_data() helperTimothy Arceri2017-05-171-17/+24
| | | | | | | This will allow us to share code between the dsa, non-dsa and no_error variants. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: create validate_buffer_sub_data() helperTimothy Arceri2017-05-171-28/+39
| | | | | | | This change assumes meta will always pass valid arguments to _mesa_buffer_sub_data(). Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glBufferStorage()Timothy Arceri2017-05-171-3/+17
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glNamedBufferStorage()Timothy Arceri2017-05-171-7/+24
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add inlined_buffer_storage() helperTimothy Arceri2017-05-171-20/+27
| | | | | | | This will allow us to share code between the dsa, non-dsa and no_error variants. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add validate_buffer_storage() helperTimothy Arceri2017-05-171-15/+27
| | | | | | This will allow use to add KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>