summaryrefslogtreecommitdiff
path: root/src/mesa/main/objectlabel.c
AgeCommit message (Collapse)AuthorFilesLines
2023-02-17mesa: make use of the new _mesa_is_desktop_gl_compat() helperEric Engestrom1-1/+1
Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2022-10-17mesa: add EXT_debug_label supportTimothy Arceri1-8/+60
KHR_debug provides the same functionality but this extension is still in use and adding support for it seems fairly harmless. For example its used by Unity and without it we keep getting given apitraces from Unity games that just spew out unsupported function errors due to the missing support. Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19029>
2021-12-14mesa: remove all GL func forward declarations because they are autogeneratedMarek Olšák1-1/+1
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-07-09dlist: add locked param to _mesa_lookup_listPierre-Eric Pelloux-Prayer1-1/+1
This allows to take the lock once and reduce the cpu-overhead of locking/unlocking multiple times when executing multiple lists. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11493>
2016-05-10mesa/objectlabel: don't return info on genned but never bound textures.Dave Airlie1-1/+1
This fixes some cases in the CTS KHR debug tests where it uses glIsTexture to find an invalid ID and then call GetObjectLabel. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-10mesa: don't use genned but unnamed xfb objects.Dave Airlie1-1/+5
If we try to draw or query an XFB object that hasn't been bound, we shouldn't return any information. This fixes a couple if cases in: GL33-CTS.transform_feedback.api_errors_test The ObjectLabel test is inspired by another test. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-03mesa/objectlabel: handle NULL src stringMark Janes1-3/+4
This prevents a crash when a NULL src is passed with a non-NULL length. fixes: dEQP-GLES31.functional.debug.object_labels.query_length_only Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95252 Signed-off-by: Mark Janes <mark.a.janes@intel.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-05-03mesa/objectlabel: don't do memcpy if bufSize is 0 (v2)Dave Airlie1-0/+5
This prevents GL43-CTS.khr_debug.labels_non_debug from memcpying all over the stack and crashing. v2: actually fix the test. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-02-05mesa: Fix locking of GLsync objects.Steinar H. Gunderson1-4/+9
GLsync objects had a race condition when used from multiple threads (which is the main point of the extension, really); it could be validated as a sync object at the beginning of the function, and then deleted by another thread before use, causing crashes. Fix this by changing all casts from GLsync to struct gl_sync_object to a new function _mesa_get_and_ref_sync() that validates and increases the refcount. In a similar vein, validation itself uses _mesa_set_search(), which requires synchronization -- it was called without a mutex held, causing spurious error returns and other issues. Since _mesa_get_and_ref_sync() now takes the shared context mutex, this problem is also resolved. Fixes bug #92757, found while developing Nageru, my live video mixer (due for release at FOSDEM 2016). v2: Marek: silence warnings, fix declaration after code Signed-off-by: Steinar H. Gunderson <sesse@google.com> Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2015-11-20mesa: use the correct string for the ES GL_KHR_debug functionsEmil Velikov1-10/+36
As defined in the spec when implemented in an OpenGL ES context, all entry points defined by this extension must have a "KHR" suffix. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-20mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke1-1/+1
Generated by sed; no manual changes. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2015-06-18mesa: add GL_PROGRAM_PIPELINE support in KHR_debug callsIlia Mirkin1-2/+8
This was apparently missed when ARB_sso support was added. Add label support to pipeline objects just like all the other debug-related objects. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au> Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
2015-03-11mesa: use strdup() instead of _mesa_strdup()Brian Paul1-1/+1
We were already using strdup() in various places in Mesa. Get rid of the _mesa_strdup() wrapper. All the callers pass a non-NULL argument so the NULL check isn't needed either. Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-12-08Don't cast the return value of malloc/reallocMatt Turner1-1/+1
See commit 2b7a972e for the Coccinelle script. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-12-08Remove useless checks for NULL before freeingMatt Turner1-5/+2
See commits 5067506e and b6109de3 for the Coccinelle script. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-03mesa: Rename _mesa_lookup_arrayobj to _mesa_lookup_vao.Kenneth Graunke1-1/+1
For consistency with the previous renames. Completely generated by: $ find . -type f -print0 | xargs -0 sed -i \ 's/_mesa_lookup_arrayobj/_mesa_lookup_vao/g' Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03mesa: Rename "struct gl_array_object" to gl_vertex_array_object.Kenneth Graunke1-1/+1
I considered replacing it with "gl_vao", but spelling it out seemed to fit better with Mesa's traditional style. Mesa doesn't shy away from long type names - consider gl_transform_feedback_object, gl_fragment_program_state, gl_uniform_buffer_binding, and so on. Completely generated by: $ find . -type f -print0 | xargs -0 sed -i \ 's/gl_array_object/gl_vertex_array_object/g' v2: Rerun command to resolve conflicts with Ian's meta patches. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-01mesa: add missing error checks in _mesa_GetObject[Ptr]Label()Brian Paul1-0/+12
Error checking bufSize isn't mentioned in the spec, but it is in the man pages. However, I believe the man page is incorrect. Typically, GL functions that take GLsizei parameters check that they're positive or non-negative. Negative values don't make sense here. A spec bug has been filed with Khronos/ARB. v2: check for negative values, not <= 0.
2013-10-01mesa: use caller string in error message in get_label_pointer()Brian Paul1-1/+1
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
2013-10-01mesa: asst. clean-ups in copy_label()Brian Paul1-10/+27
This incorporates Vinson's change to check for a null src pointer as detected by coverity. Also, rename the function params to be src/dst, const-qualify src, and use GL types to match the calling functions. And add some more comments. Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
2013-09-04mesa: Implement KHR_debug ObjectLabel functionsTimothy Arceri1-0/+282
V3: make sure to add null terminator when setting label, generate error when the client specifies an explicit length that exceeds MAX_LABEL_LENGTH, set label pointer to NULL when freed, and output correct length in MAX_LABEL_LENGTH error message. V2: fixed indentation of comment Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au> Reviewed-by: Brian Paul <brianp@vmware.com>