mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
glthread: don't sync for glIsEnabled(GL_BLEND, GL_LIGHTING, GL_POLYGON_STIPPLE)
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18199>
This commit is contained in:
parent
513ac52e47
commit
8e024e2870
2 changed files with 48 additions and 2 deletions
|
|
@ -131,8 +131,11 @@ struct glthread_attrib_node {
|
|||
GLbitfield Mask;
|
||||
int ActiveTexture;
|
||||
GLenum16 MatrixMode;
|
||||
bool Blend;
|
||||
bool CullFace;
|
||||
bool DepthTest;
|
||||
bool Lighting;
|
||||
bool PolygonStipple;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
|
|
@ -234,8 +237,11 @@ struct glthread_state
|
|||
int MatrixStackDepth[M_NUM_MATRIX_STACKS];
|
||||
|
||||
/** Enable states. */
|
||||
bool Blend;
|
||||
bool DepthTest;
|
||||
bool CullFace;
|
||||
bool Lighting;
|
||||
bool PolygonStipple;
|
||||
|
||||
GLuint CurrentDrawFramebuffer;
|
||||
GLuint CurrentReadFramebuffer;
|
||||
|
|
|
|||
|
|
@ -473,12 +473,21 @@ _mesa_glthread_Enable(struct gl_context *ctx, GLenum cap)
|
|||
case GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB:
|
||||
_mesa_glthread_destroy(ctx, "Enable(DEBUG_OUTPUT_SYNCHRONOUS)");
|
||||
break;
|
||||
case GL_BLEND:
|
||||
ctx->GLThread.Blend = true;
|
||||
break;
|
||||
case GL_DEPTH_TEST:
|
||||
ctx->GLThread.DepthTest = true;
|
||||
break;
|
||||
case GL_CULL_FACE:
|
||||
ctx->GLThread.CullFace = true;
|
||||
break;
|
||||
case GL_LIGHTING:
|
||||
ctx->GLThread.Lighting = true;
|
||||
break;
|
||||
case GL_POLYGON_STIPPLE:
|
||||
ctx->GLThread.PolygonStipple = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -493,12 +502,21 @@ _mesa_glthread_Disable(struct gl_context *ctx, GLenum cap)
|
|||
case GL_PRIMITIVE_RESTART_FIXED_INDEX:
|
||||
_mesa_glthread_set_prim_restart(ctx, cap, false);
|
||||
break;
|
||||
case GL_BLEND:
|
||||
ctx->GLThread.Blend = false;
|
||||
break;
|
||||
case GL_CULL_FACE:
|
||||
ctx->GLThread.CullFace = false;
|
||||
break;
|
||||
case GL_DEPTH_TEST:
|
||||
ctx->GLThread.DepthTest = false;
|
||||
break;
|
||||
case GL_LIGHTING:
|
||||
ctx->GLThread.Lighting = false;
|
||||
break;
|
||||
case GL_POLYGON_STIPPLE:
|
||||
ctx->GLThread.PolygonStipple = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -510,10 +528,16 @@ _mesa_glthread_IsEnabled(struct gl_context *ctx, GLenum cap)
|
|||
return -1;
|
||||
|
||||
switch (cap) {
|
||||
case GL_BLEND:
|
||||
return ctx->GLThread.Blend;
|
||||
case GL_CULL_FACE:
|
||||
return ctx->GLThread.CullFace;
|
||||
case GL_DEPTH_TEST:
|
||||
return ctx->GLThread.DepthTest;
|
||||
case GL_LIGHTING:
|
||||
return ctx->GLThread.Lighting;
|
||||
case GL_POLYGON_STIPPLE:
|
||||
return ctx->GLThread.PolygonStipple;
|
||||
case GL_VERTEX_ARRAY:
|
||||
return !!(ctx->GLThread.CurrentVAO->UserEnabled & VERT_BIT_POS);
|
||||
case GL_NORMAL_ARRAY:
|
||||
|
|
@ -542,12 +566,20 @@ _mesa_glthread_PushAttrib(struct gl_context *ctx, GLbitfield mask)
|
|||
|
||||
attr->Mask = mask;
|
||||
|
||||
if (mask & (GL_POLYGON_BIT | GL_ENABLE_BIT))
|
||||
if (mask & GL_ENABLE_BIT)
|
||||
attr->Blend = ctx->GLThread.Blend;
|
||||
|
||||
if (mask & (GL_POLYGON_BIT | GL_ENABLE_BIT)) {
|
||||
attr->CullFace = ctx->GLThread.CullFace;
|
||||
attr->PolygonStipple = ctx->GLThread.PolygonStipple;
|
||||
}
|
||||
|
||||
if (mask & (GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT))
|
||||
attr->DepthTest = ctx->GLThread.DepthTest;
|
||||
|
||||
if (mask & (GL_LIGHTING_BIT | GL_ENABLE_BIT))
|
||||
attr->Lighting = ctx->GLThread.Lighting;
|
||||
|
||||
if (mask & GL_TEXTURE_BIT)
|
||||
attr->ActiveTexture = ctx->GLThread.ActiveTexture;
|
||||
|
||||
|
|
@ -568,12 +600,20 @@ _mesa_glthread_PopAttrib(struct gl_context *ctx)
|
|||
&ctx->GLThread.AttribStack[--ctx->GLThread.AttribStackDepth];
|
||||
unsigned mask = attr->Mask;
|
||||
|
||||
if (mask & (GL_POLYGON_BIT | GL_ENABLE_BIT))
|
||||
if (mask & GL_ENABLE_BIT)
|
||||
ctx->GLThread.Blend = attr->Blend;
|
||||
|
||||
if (mask & (GL_POLYGON_BIT | GL_ENABLE_BIT)) {
|
||||
ctx->GLThread.CullFace = attr->CullFace;
|
||||
ctx->GLThread.PolygonStipple = attr->PolygonStipple;
|
||||
}
|
||||
|
||||
if (mask & (GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT))
|
||||
ctx->GLThread.DepthTest = attr->DepthTest;
|
||||
|
||||
if (mask & (GL_LIGHTING_BIT | GL_ENABLE_BIT))
|
||||
ctx->GLThread.Lighting = attr->Lighting;
|
||||
|
||||
if (mask & GL_TEXTURE_BIT)
|
||||
ctx->GLThread.ActiveTexture = attr->ActiveTexture;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue