glthread: handle DeleteBuffers(n=-1) gracefully

this is a valid error condition

cc: mesa-stable

fixes:
GTF-GL46.gtf21.GL2FixedTests.buffer_objects.buffer_objects

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18856>
(cherry picked from commit 004c5b60ca)
This commit is contained in:
Mike Blumenkrantz
2022-09-27 21:42:49 -04:00
committed by Dylan Baker
parent 3aa0a2a7c7
commit 1cfd9ec3d7
2 changed files with 2 additions and 2 deletions

View File

@@ -1444,7 +1444,7 @@
"description": "glthread: handle DeleteBuffers(n=-1) gracefully", "description": "glthread: handle DeleteBuffers(n=-1) gracefully",
"nominated": true, "nominated": true,
"nomination_type": 0, "nomination_type": 0,
"resolution": 0, "resolution": 1,
"main_sha": null, "main_sha": null,
"because_sha": null "because_sha": null
}, },

View File

@@ -208,7 +208,7 @@ _mesa_glthread_DeleteBuffers(struct gl_context *ctx, GLsizei n,
{ {
struct glthread_state *glthread = &ctx->GLThread; struct glthread_state *glthread = &ctx->GLThread;
if (!buffers) if (!buffers || n < 0)
return; return;
for (unsigned i = 0; i < n; i++) { for (unsigned i = 0; i < n; i++) {