summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/bufferobj.c
Commit message (Collapse)AuthorAgeFilesLines
* main: create_buffers unlocks mutex when throwing OUT_OF_MEMORY.Laura Ekstrand2015-04-011-0/+1
| | | | | | Ilia Mirkin found that I had forgotten to free the mutex in the error case. Reviewed-by: Ilia Mirkin <[email protected]>
* main: Added entry point for glTransformFeedbackBufferRangeMartin Peres2015-03-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | v2: review from Laura Ekstrand - use the refactored code to lookup the objects - improve some error messages - factor out the gl method name computation - better handle the spec differences between the DSA and non-DSA cases - quote the spec a little more v3: review from Laura Ekstrand - use the new name of _mesa_lookup_bufferobj_err - swap the comments around the offset and size checks v4: review from Laura Ekstrand - add more spec quotes - properly fix the comments around the offset and size checks v5: review from Laura Ekstrand - add quotes on the spec citations - revert some changes in the printf format v6: review from Laura Ekstrand - remove a redondant "gl" in a method name Signed-off-by: Martin Peres <[email protected]> Reviewed-by: Laura Ekstrand <[email protected]>
* main: Added entry point for glTransformFeedbackBufferBaseMartin Peres2015-03-251-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | v2: Review from Laura Ekstrand - give more helpful error messages - factor the lookup code for the xfb and objBuf - replace some already-existing tabs with spaces - add comments to explain the cases where xfb == 0 or buffer == 0 - fix the condition for binding the transform buffer or not v3: Review from Laura Ekstrand - rename _mesa_lookup_bufferobj_err to _mesa_lookup_transform_feedback_bufferobj_err and make it static to avoid a future conflict - make _mesa_lookup_transform_feedback_object_err static v4: Review from Laura Ekstrand - add the pdf page number when quoting the spec - rename some of the symbols to follow the public/private conventions v5: Review from Laura Ekstrand - properly rename some of the symbols to follow the public/private conventions - fix some alignments - add quotes around a spec citation - add back a newline I accidentally deleted - add spaces around the ternary operator usages Signed-off-by: Martin Peres <[email protected]> Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Make sure the buffer exists in _mesa_lookup_bufferobj_errFredrik Höglund2015-03-201-4/+6
| | | | | | | | | | Generate GL_INVALID_OPERATION and return NULL when the buffer object hasn't been created. All callers expect this. v2: Use a more concise error message. Cc: Laura Ekstrand <[email protected]> Reviewed-by: Laura Ekstrand <[email protected]>
* main: Correct _mesa_error with no format in bufferobj.c.Laura Ekstrand2015-03-171-1/+1
| | | | | | | This fixes Bug 89616, a build failure due to line 1639 of bufferobj.c: _mesa_error(ctx, GL_INVALID_OPERATION, func); Trivial.
* main: Cosmetic changes to GetBufferSubData.Laura Ekstrand2015-03-171-1/+1
| | | | Reviewed-by: Fredrik Höglund <[email protected]>
* main: Add entry point for GetNamedBufferSubData.Laura Ekstrand2015-03-171-0/+22
| | | | Reviewed-by: Fredrik Höglund <[email protected]>
* main: Cosmetic updates to GetBufferPointerv.Laura Ekstrand2015-03-171-4/+5
| | | | | | | v3: Review from Fredrik Hoglund -Split cosmetic refactor of GetBufferPointerv out into a separate commit Reviewed-by: Fredrik Höglund <[email protected]>
* main: Add entry point for GetNamedBufferPointerv.Laura Ekstrand2015-03-171-0/+20
| | | | | | | v3: Review from Fredrik Hoglund -Split cosmetic refactor of GetBufferPointerv out into a separate commit Reviewed-by: Fredrik Höglund <[email protected]>
* main: Add entry points for GetNamedBufferParameteri[64]v.Laura Ekstrand2015-03-171-0/+39
| | | | Reviewed-by: Fredrik Höglund <[email protected]>
* main: Refactor GetBufferParameteri[64]v.Laura Ekstrand2015-03-171-74/+45
| | | | | | v2: Split into a refactor commit and an entry point commit. Reviewed-by: Fredrik Höglund <[email protected]>
* main: Add entry point for FlushMappedNamedBufferRange.Laura Ekstrand2015-03-171-0/+16
| | | | Reviewed-by: Fredrik Höglund <[email protected]>
* main: Refactor FlushMappedBufferRange.Laura Ekstrand2015-03-171-26/+34
| | | | | | | v2:-Remove "_mesa" from in front of static software fallback. -Split out the refactor from the addition of the DSA entry points. Reviewed-by: Fredrik Höglund <[email protected]>
* main: Add entry point for UnmapNamedBuffer.Laura Ekstrand2015-03-171-13/+34
| | | | | | | | v2: review from Ian Romanick - Restore VBO_DEBUG and BOUNDS_CHECK - Remove _mesa from static software fallback unmap_buffer. Reviewed-by: Fredrik Höglund <[email protected]>
* main: Add entry points for MapNamedBuffer[Range].Laura Ekstrand2015-03-171-0/+42
| | | | Reviewed-by: Fredrik Höglund <[email protected]>
* main: Refactor MapBuffer[Range].Laura Ekstrand2015-03-171-161/+127
| | | | | | | | | | v2: review from Jason Ekstrand - Split refactor from addition of DSA entry points. review from Ian Romanick - Remove "_mesa" from static software fallback map_buffer_range - Restore VBO_DEBUG and BOUNDS_CHECK Reviewed-by: Fredrik Höglund <[email protected]>
* main: Minor whitespace fixes in ClearNamedBuffer[Sub]Data.Laura Ekstrand2015-03-171-2/+2
| | | | Reviewed-by: Fredrik Höglund <[email protected]>
* main: Add entry points for ClearNamedBuffer[Sub]Data.Laura Ekstrand2015-03-171-0/+35
| | | | Reviewed-by: Martin Peres <[email protected]>
* main: Refactor ClearBuffer[Sub]Data.Laura Ekstrand2015-03-171-72/+53
| | | | | | | | v2: review by Jason Ekstrand - Split refactor of clear buffer sub data from addition of DSA entry points. Reviewed-by: Martin Peres <[email protected]>
* main: Add entry point for CopyNamedBufferSubData.Laura Ekstrand2015-03-171-33/+66
| | | | | | v2: remove _mesa in front of static software fallback. Reviewed-by: Martin Peres <[email protected]>
* main: Improve errors and style in BufferSubData.Laura Ekstrand2015-03-171-3/+7
| | | | | | | - More explicit error reporting. - Removed legacy style. Reviewed-by: Martin Peres <[email protected]>
* main: Add entry point for NamedBufferSubData.Laura Ekstrand2015-03-171-49/+80
| | | | | | | | | v2: review by Ian Romanick - Remove "_mesa" from name of static software fallback buffer_sub_data. - Remove mappedRange from _mesa_buffer_sub_data. - Removed some cosmetic changes to a separate commit. Reviewed-by: Martin Peres <[email protected]>
* main: Add entry point for NamedBufferData.Laura Ekstrand2015-03-171-20/+49
| | | | | | | | | | v2: review from Ian Romanick - Fix space in ARB_direct_state_access.xml. - Remove "_mesa" from the name of buffer_data static fallback. - Restore VBO_DEBUG and BOUNDS_CHECK. - Fix beginning of comment to start on same line as /* Reviewed-by: Martin Peres <[email protected]>
* main: Add entry point for NamedBufferStorage.Laura Ekstrand2015-03-171-17/+48
| | | | Reviewed-by: Martin Peres <[email protected]>
* main: Add entry point for CreateBuffers.Laura Ekstrand2015-03-171-13/+52
| | | | Reviewed-by: Martin Peres <[email protected]>
* main: Add utility function _mesa_lookup_bufferobj_err.Laura Ekstrand2015-03-091-0/+19
| | | | | | | This function is exposed to mesa driver internals so that texture buffer objects and array objects can use it. Reviewed-by: Anuj Phogat <[email protected]>
* mesa/main: replace Elements() with ARRAY_SIZE()Brian Paul2015-03-021-1/+1
| | | | | | | | We've been using a mix of these two macros for a while now. Let's just use the later everywhere. It seems to be the convention used by other open-source projects. Acked-by: Ilia Mirkin <[email protected]>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-231-28/+28
| | | | Acked-by: Eric Anholt <[email protected]>
* mesa: implement GL_AMD_pinned_memoryMarek Olšák2015-02-171-2/+31
| | | | | | | | | | | | | | It's not possible to query the current buffer binding, because the extension doesn't define GL_..._BUFFER__BINDING_AMD. Drivers should check the target parameter of Drivers.BufferData. If it's equal to GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, the memory should be pinned. That's all there is to it. A piglit test is on the piglit mailing list. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Christian König <[email protected]>
* mesa: fix AtomicBuffer typo in _mesa_DeleteBuffersMarek Olšák2015-02-171-1/+1
| | | | | Cc: 10.5 10.4 10.3 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix some signed-unsigned comparison warningsJan Vesely2015-01-211-9/+9
| | | | | | | | v2: s/unsigned int/unsigned/ in prog_optimize.c Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: fix 'misalgned' typos in error messagesBrian Paul2014-10-201-2/+2
| | | | Trivial.
* mesa: Drop the "target" parameter from NewBufferObject().Kenneth Graunke2014-10-161-8/+6
| | | | | | | | | | | NewBufferObject took a "target" parameter, which it blindly passed to _mesa_initialize_buffer_object(), which ignored it. Not much point in passing it around. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Mark buffer objects that are used as atomic counter buffersChris Forbes2014-10-161-0/+1
| | | | | Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: Mark buffer objects which are bound as UBOsChris Forbes2014-10-161-0/+6
| | | | | | | | | When a buffer object is bound to one of the indexed uniform buffer binding points, assume that from that point on it may be used as a uniform buffer. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: use PRId64 for printing 64-bit intsBrian Paul2014-08-111-16/+17
| | | | | | | | | | | Silences MinGW warnings: warning: unknown conversion type character ‘l’ in format [-Wformat] warning: too many arguments for format [-Wformat-extra-args] v2: use signed types/formats Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: Add missing atomic buffer bindings and unbindingsAditya Atluri2014-08-011-0/+31
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: Implement glBindBuffersRangeFredrik Höglund2014-05-021-0/+367
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Implement glBindBuffersBaseFredrik Höglund2014-05-021-0/+365
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Refactor set_ubo_binding()Fredrik Höglund2014-05-021-14/+40
| | | | | | | | | Make set_ubo_binding() just update the binding, and move the code that does validation, flushes the vertices etc. into a new bind_uniform_buffer() function. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add helper functions for looking up multiple buffersFredrik Höglund2014-05-021-0/+72
| | | | | | | | | v2: Document the difference between _mesa_lookup_bufferobj() and _mesa_multi_bind_lookup_bufferobj(). v3: Don't create the buffer objects when they don't exist. Reviewed-by: Brian Paul <[email protected]> (v2) Reviewed-by: Ian Romanick <[email protected]> (v2)
* mesa: Refactor set_atomic_buffer_binding()Fredrik Höglund2014-05-021-16/+40
| | | | | | | | | | Make set_atomic_buffer_binding() just update the binding, and move the code that does validation, flushes the vertices etc. into a new bind_atomic_buffer() function. Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: Add infrastructure for ARB_multi_bindFredrik Höglund2014-05-021-0/+13
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa/st: Accelerate ARB_clear_buffer_object with clear_bufferIlia Mirkin2014-03-311-3/+3
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: switch to c11 mutex functionsBrian Paul2014-03-031-13/+13
| | | | Reviewed-by: José Fonseca <[email protected]>
* mesa: don't call ctx->Driver.ClearBufferSubData() if size==0Brian Paul2014-03-031-4/+8
| | | | | | | | Fixes failed assertion when trying to map zero-length region. https://bugs.freedesktop.org/show_bug.cgi?id=75660 Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: allow buffers to be mapped multiple timesMarek Olšák2014-02-251-113/+102
| | | | | | | | | | | | | | | | | | | 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]>
* mesa: allow buffers mapped with the persistent flag to be used by the GPUMarek Olšák2014-02-251-13/+19
| | | | | | v2: also fixed InvalidateBufferData, added citations from the 4.4 spec Reviewed-by: Fredrik Höglund <[email protected]>
* mesa: add error checks to glMapBufferRange, glMapBuffer for ARB_buffer_storageMarek Olšák2014-02-251-7/+57
| | | | Reviewed-by: Fredrik Höglund <[email protected]>
* mesa: implement glBufferStorage, immutable buffers; add extension enable flagMarek Olšák2014-02-251-0/+93
| | | | | | | Reviewed-by: Fredrik Höglund <[email protected]> v2: dropped the error that DYNAMIC_STORAGE is required for MAP_WRITE_BIT, the error is removed in the latest revision of GL 4.4