mesa: replace _NEW_EVAL with vbo_exec_update_eval_maps
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
This commit is contained in:
parent
cf2f3c2753
commit
ee0263e03f
|
@ -400,7 +400,6 @@ static struct dirty_bit_map mesa_bits[] = {
|
|||
DEFINE_BIT(_NEW_TEXTURE_MATRIX),
|
||||
DEFINE_BIT(_NEW_COLOR),
|
||||
DEFINE_BIT(_NEW_DEPTH),
|
||||
DEFINE_BIT(_NEW_EVAL),
|
||||
DEFINE_BIT(_NEW_FOG),
|
||||
DEFINE_BIT(_NEW_HINT),
|
||||
DEFINE_BIT(_NEW_LIGHT),
|
||||
|
|
|
@ -1178,7 +1178,7 @@ _mesa_PopAttrib(void)
|
|||
break;
|
||||
case GL_EVAL_BIT:
|
||||
memcpy(&ctx->Eval, attr->data, sizeof(struct gl_eval_attrib));
|
||||
ctx->NewState |= _NEW_EVAL;
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
break;
|
||||
case GL_FOG_BIT:
|
||||
{
|
||||
|
|
|
@ -73,7 +73,7 @@ void
|
|||
_mesa_print_state( const char *msg, GLuint state )
|
||||
{
|
||||
_mesa_debug(NULL,
|
||||
"%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
|
||||
"%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
|
||||
msg,
|
||||
state,
|
||||
(state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "",
|
||||
|
@ -81,7 +81,6 @@ _mesa_print_state( const char *msg, GLuint state )
|
|||
(state & _NEW_TEXTURE_MATRIX) ? "ctx->TextureMatrix, " : "",
|
||||
(state & _NEW_COLOR) ? "ctx->Color, " : "",
|
||||
(state & _NEW_DEPTH) ? "ctx->Depth, " : "",
|
||||
(state & _NEW_EVAL) ? "ctx->Eval/EvalMap, " : "",
|
||||
(state & _NEW_FOG) ? "ctx->Fog, " : "",
|
||||
(state & _NEW_HINT) ? "ctx->Hint, " : "",
|
||||
(state & _NEW_LIGHT) ? "ctx->Light, " : "",
|
||||
|
|
|
@ -405,7 +405,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.AutoNormal == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.AutoNormal = state;
|
||||
break;
|
||||
case GL_BLEND:
|
||||
|
@ -604,7 +605,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1Color4 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map1Color4 = state;
|
||||
break;
|
||||
case GL_MAP1_INDEX:
|
||||
|
@ -612,7 +614,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1Index == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map1Index = state;
|
||||
break;
|
||||
case GL_MAP1_NORMAL:
|
||||
|
@ -620,7 +623,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1Normal == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map1Normal = state;
|
||||
break;
|
||||
case GL_MAP1_TEXTURE_COORD_1:
|
||||
|
@ -628,7 +632,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1TextureCoord1 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map1TextureCoord1 = state;
|
||||
break;
|
||||
case GL_MAP1_TEXTURE_COORD_2:
|
||||
|
@ -636,7 +641,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1TextureCoord2 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map1TextureCoord2 = state;
|
||||
break;
|
||||
case GL_MAP1_TEXTURE_COORD_3:
|
||||
|
@ -644,7 +650,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1TextureCoord3 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map1TextureCoord3 = state;
|
||||
break;
|
||||
case GL_MAP1_TEXTURE_COORD_4:
|
||||
|
@ -652,7 +659,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1TextureCoord4 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map1TextureCoord4 = state;
|
||||
break;
|
||||
case GL_MAP1_VERTEX_3:
|
||||
|
@ -660,7 +668,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1Vertex3 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map1Vertex3 = state;
|
||||
break;
|
||||
case GL_MAP1_VERTEX_4:
|
||||
|
@ -668,7 +677,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1Vertex4 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map1Vertex4 = state;
|
||||
break;
|
||||
case GL_MAP2_COLOR_4:
|
||||
|
@ -676,7 +686,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2Color4 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map2Color4 = state;
|
||||
break;
|
||||
case GL_MAP2_INDEX:
|
||||
|
@ -684,7 +695,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2Index == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map2Index = state;
|
||||
break;
|
||||
case GL_MAP2_NORMAL:
|
||||
|
@ -692,7 +704,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2Normal == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map2Normal = state;
|
||||
break;
|
||||
case GL_MAP2_TEXTURE_COORD_1:
|
||||
|
@ -700,7 +713,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2TextureCoord1 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map2TextureCoord1 = state;
|
||||
break;
|
||||
case GL_MAP2_TEXTURE_COORD_2:
|
||||
|
@ -708,7 +722,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2TextureCoord2 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map2TextureCoord2 = state;
|
||||
break;
|
||||
case GL_MAP2_TEXTURE_COORD_3:
|
||||
|
@ -716,7 +731,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2TextureCoord3 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map2TextureCoord3 = state;
|
||||
break;
|
||||
case GL_MAP2_TEXTURE_COORD_4:
|
||||
|
@ -724,7 +740,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2TextureCoord4 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map2TextureCoord4 = state;
|
||||
break;
|
||||
case GL_MAP2_VERTEX_3:
|
||||
|
@ -732,7 +749,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2Vertex3 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map2Vertex3 = state;
|
||||
break;
|
||||
case GL_MAP2_VERTEX_4:
|
||||
|
@ -740,7 +758,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2Vertex4 == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.Map2Vertex4 = state;
|
||||
break;
|
||||
case GL_NORMALIZE:
|
||||
|
|
|
@ -353,7 +353,8 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
|
|||
pnts = _mesa_copy_map_points1d(target, ustride, uorder, (GLdouble*) points);
|
||||
|
||||
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
map->Order = uorder;
|
||||
map->u1 = u1;
|
||||
map->u2 = u2;
|
||||
|
@ -448,7 +449,8 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
|
|||
vstride, vorder, (GLdouble*) points);
|
||||
|
||||
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
map->Uorder = uorder;
|
||||
map->u1 = u1;
|
||||
map->u2 = u2;
|
||||
|
@ -768,7 +770,8 @@ _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 )
|
|||
_mesa_error( ctx, GL_INVALID_VALUE, "glMapGrid1f" );
|
||||
return;
|
||||
}
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.MapGrid1un = un;
|
||||
ctx->Eval.MapGrid1u1 = u1;
|
||||
ctx->Eval.MapGrid1u2 = u2;
|
||||
|
@ -798,7 +801,8 @@ _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
|
|||
return;
|
||||
}
|
||||
|
||||
FLUSH_VERTICES(ctx, _NEW_EVAL);
|
||||
FLUSH_VERTICES(ctx, 0);
|
||||
vbo_exec_update_eval_maps(ctx);
|
||||
ctx->Eval.MapGrid2un = un;
|
||||
ctx->Eval.MapGrid2u1 = u1;
|
||||
ctx->Eval.MapGrid2u2 = u2;
|
||||
|
|
|
@ -4482,7 +4482,7 @@ struct gl_matrix_stack
|
|||
#define _NEW_TEXTURE_MATRIX (1u << 2) /**< gl_context::TextureMatrix */
|
||||
#define _NEW_COLOR (1u << 3) /**< gl_context::Color */
|
||||
#define _NEW_DEPTH (1u << 4) /**< gl_context::Depth */
|
||||
#define _NEW_EVAL (1u << 5) /**< gl_context::Eval, EvalMap */
|
||||
/* gap */
|
||||
#define _NEW_FOG (1u << 6) /**< gl_context::Fog */
|
||||
#define _NEW_HINT (1u << 7) /**< gl_context::Hint */
|
||||
#define _NEW_LIGHT (1u << 8) /**< gl_context::Light */
|
||||
|
|
|
@ -463,7 +463,6 @@ _mesa_update_state_locked( struct gl_context *ctx )
|
|||
new_prog_state |= update_program_constants(ctx);
|
||||
|
||||
ctx->NewState |= new_prog_state;
|
||||
vbo_exec_invalidate_state(ctx);
|
||||
|
||||
/*
|
||||
* Give the driver a chance to act upon the new_state flags.
|
||||
|
|
|
@ -48,7 +48,7 @@ void
|
|||
_vbo_DestroyContext(struct gl_context *ctx);
|
||||
|
||||
void
|
||||
vbo_exec_invalidate_state(struct gl_context *ctx);
|
||||
vbo_exec_update_eval_maps(struct gl_context *ctx);
|
||||
|
||||
void
|
||||
_vbo_install_exec_vtxfmt(struct gl_context *ctx);
|
||||
|
|
|
@ -149,13 +149,11 @@ _vbo_install_exec_vtxfmt(struct gl_context *ctx)
|
|||
|
||||
|
||||
void
|
||||
vbo_exec_invalidate_state(struct gl_context *ctx)
|
||||
vbo_exec_update_eval_maps(struct gl_context *ctx)
|
||||
{
|
||||
struct vbo_context *vbo = vbo_context(ctx);
|
||||
struct vbo_exec_context *exec = &vbo->exec;
|
||||
|
||||
if (ctx->NewState & _NEW_EVAL)
|
||||
exec->eval.recalculate_maps = GL_TRUE;
|
||||
vbo->exec.eval.recalculate_maps = GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue