glthread: don't sync for more glGetIntegerv enums for glretrace

This makes glretrace faster with glthread.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13970>
This commit is contained in:
Marek Olšák 2021-11-28 08:09:15 -05:00 committed by Marge Bot
parent 996f147fef
commit e48f676835
5 changed files with 26 additions and 9 deletions

View File

@ -202,7 +202,8 @@
<glx vendorpriv="1425"/>
</function>
<function name="BindFramebuffer" es2="2.0">
<function name="BindFramebuffer" es2="2.0"
marshal_call_after="if (target == GL_FRAMEBUFFER || target == GL_DRAW_FRAMEBUFFER) ctx->GLThread.CurrentDrawFramebuffer = framebuffer;">
<param name="target" type="GLenum"/>
<param name="framebuffer" type="GLuint"/>
<glx rop="236"/>

View File

@ -5563,7 +5563,8 @@
<glx ignore="true"/>
</function>
<function name="UseProgram" es2="2.0" no_error="true">
<function name="UseProgram" es2="2.0" no_error="true"
marshal_call_after="ctx->GLThread.CurrentProgram = program;">
<param name="program" type="GLuint"/>
<glx ignore="true"/>
</function>

View File

@ -207,6 +207,7 @@ struct glthread_state
GLuint CurrentDrawIndirectBufferName;
GLuint CurrentPixelPackBufferName;
GLuint CurrentPixelUnpackBufferName;
GLuint CurrentQueryBufferName;
/**
* The batch index of the last occurence of glLinkProgram or
@ -230,6 +231,9 @@ struct glthread_state
/** Enable states. */
bool CullFace;
GLuint CurrentDrawFramebuffer;
GLuint CurrentProgram;
};
void _mesa_glthread_init(struct gl_context *ctx);

View File

@ -195,6 +195,9 @@ _mesa_glthread_BindBuffer(struct gl_context *ctx, GLenum target, GLuint buffer)
case GL_PIXEL_UNPACK_BUFFER:
glthread->CurrentPixelUnpackBufferName = buffer;
break;
case GL_QUERY_BUFFER:
glthread->CurrentQueryBufferName = buffer;
break;
}
}

View File

@ -43,13 +43,6 @@ _mesa_marshal_GetIntegerv(GLenum pname, GLint *p)
* - CONTEXT_[A-Z]*(Const
*/
if (ctx->API != API_OPENGL_COMPAT) {
/* glthread only tracks these states for the compatibility profile. */
_mesa_glthread_finish_before(ctx, "GetIntegerv");
CALL_GetIntegerv(ctx->CurrentServerDispatch, (pname, p));
return;
}
switch (pname) {
case GL_ACTIVE_TEXTURE:
*p = GL_TEXTURE0 + ctx->GLThread.ActiveTexture;
@ -66,9 +59,24 @@ _mesa_marshal_GetIntegerv(GLenum pname, GLint *p)
case GL_CLIENT_ATTRIB_STACK_DEPTH:
*p = ctx->GLThread.ClientAttribStackTop;
return;
case GL_CURRENT_PROGRAM:
*p = ctx->GLThread.CurrentProgram;
return;
case GL_DRAW_INDIRECT_BUFFER_BINDING:
*p = ctx->GLThread.CurrentDrawIndirectBufferName;
return;
case GL_DRAW_FRAMEBUFFER_BINDING: /* == GL_FRAMEBUFFER_BINDING */
*p = ctx->GLThread.CurrentDrawFramebuffer;
return;
case GL_PIXEL_PACK_BUFFER_BINDING:
*p = ctx->GLThread.CurrentPixelPackBufferName;
return;
case GL_PIXEL_UNPACK_BUFFER_BINDING:
*p = ctx->GLThread.CurrentPixelUnpackBufferName;
return;
case GL_QUERY_BUFFER_BINDING:
*p = ctx->GLThread.CurrentQueryBufferName;
return;
case GL_MATRIX_MODE:
*p = ctx->GLThread.MatrixMode;