glthread: don't execute Draw and BufferSubData calls if the context is lost
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
This commit is contained in:
@@ -505,6 +505,7 @@ _mesa_marshal_BufferSubData_merged(GLuint target_or_name, GLintptr offset,
|
|||||||
* the buffer storage, but we don't know the buffer size in glthread.
|
* the buffer storage, but we don't know the buffer size in glthread.
|
||||||
*/
|
*/
|
||||||
if (ctx->Const.AllowGLThreadBufferSubDataOpt &&
|
if (ctx->Const.AllowGLThreadBufferSubDataOpt &&
|
||||||
|
ctx->CurrentServerDispatch != ctx->ContextLost &&
|
||||||
data && offset > 0 && size > 0) {
|
data && offset > 0 && size > 0) {
|
||||||
struct gl_buffer_object *upload_buffer = NULL;
|
struct gl_buffer_object *upload_buffer = NULL;
|
||||||
unsigned upload_offset = 0;
|
unsigned upload_offset = 0;
|
||||||
|
@@ -148,6 +148,7 @@ _mesa_glthread_update_draw_always_async(struct gl_context *ctx)
|
|||||||
/* Executing erroneous cases will just generate GL_INVALID_OPERATION. */
|
/* Executing erroneous cases will just generate GL_INVALID_OPERATION. */
|
||||||
ctx->GLThread.draw_always_async =
|
ctx->GLThread.draw_always_async =
|
||||||
ctx->API == API_OPENGL_CORE ||
|
ctx->API == API_OPENGL_CORE ||
|
||||||
|
ctx->CurrentServerDispatch == ctx->ContextLost ||
|
||||||
ctx->GLThread.inside_begin_end ||
|
ctx->GLThread.inside_begin_end ||
|
||||||
ctx->GLThread.ListMode;
|
ctx->GLThread.ListMode;
|
||||||
}
|
}
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
#include "main/dispatch.h" /* for _gloffset_COUNT */
|
#include "main/dispatch.h" /* for _gloffset_COUNT */
|
||||||
#include "api_exec_decl.h"
|
#include "api_exec_decl.h"
|
||||||
|
#include "glthread_marshal.h"
|
||||||
|
|
||||||
static void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
_context_lost_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize,
|
_context_lost_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize,
|
||||||
@@ -104,6 +105,7 @@ _mesa_set_context_lost_dispatch(struct gl_context *ctx)
|
|||||||
|
|
||||||
ctx->CurrentServerDispatch = ctx->ContextLost;
|
ctx->CurrentServerDispatch = ctx->ContextLost;
|
||||||
_glapi_set_dispatch(ctx->CurrentServerDispatch);
|
_glapi_set_dispatch(ctx->CurrentServerDispatch);
|
||||||
|
_mesa_glthread_update_draw_always_async(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user