mesa: call Driver.TexParameter in glPopAttrib to fix r100, r200, old nouveau
The glPopAttrib optimizations incorrectly removed it.
Use GL_ALL_ATTRIB_BITS to mean "all texture parameters have changed" to
make it more efficient.
Fixes: d0e18550e2
- mesa: optimize saving/restoring bound textures for glPush/PopAttrib
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>
This commit is contained in:
parent
a6164ab48c
commit
8c5c133741
|
@ -413,6 +413,7 @@ nouveau_tex_parameter(struct gl_context *ctx,
|
|||
case GL_TEXTURE_MIN_FILTER:
|
||||
case GL_TEXTURE_BASE_LEVEL:
|
||||
case GL_TEXTURE_MAX_LEVEL:
|
||||
case GL_ALL_ATTRIB_BITS: /* meaning is all pnames, internal */
|
||||
nouveau_texture_reallocate(ctx, t);
|
||||
context_dirty_i(ctx, TEX_OBJ, ctx->Texture.CurrentUnit);
|
||||
break;
|
||||
|
|
|
@ -387,6 +387,7 @@ static void r200TexParameter(struct gl_context *ctx,
|
|||
_mesa_enum_to_string( pname ) );
|
||||
|
||||
switch ( pname ) {
|
||||
case GL_ALL_ATTRIB_BITS: /* meaning is all pnames, internal */
|
||||
case GL_TEXTURE_MIN_FILTER:
|
||||
case GL_TEXTURE_MAG_FILTER:
|
||||
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
|
||||
|
|
|
@ -337,6 +337,7 @@ static void radeonTexParameter( struct gl_context *ctx,
|
|||
_mesa_enum_to_string( pname ) );
|
||||
|
||||
switch ( pname ) {
|
||||
case GL_ALL_ATTRIB_BITS: /* meaning is all pnames, internal */
|
||||
case GL_TEXTURE_BASE_LEVEL:
|
||||
case GL_TEXTURE_MAX_LEVEL:
|
||||
case GL_TEXTURE_MIN_LOD:
|
||||
|
|
|
@ -604,6 +604,10 @@ pop_texture_group(struct gl_context *ctx, struct gl_texture_attrib_node *texstat
|
|||
memcpy(&texObj->Sampler.Attrib, &savedObj->Sampler.Attrib,
|
||||
sizeof(savedObj->Sampler.Attrib));
|
||||
memcpy(&texObj->Attrib, &savedObj->Attrib, sizeof(savedObj->Attrib));
|
||||
|
||||
/* GL_ALL_ATTRIB_BITS means all pnames. (internal) */
|
||||
if (texObj->Name != 0 && ctx->Driver.TexParameter)
|
||||
ctx->Driver.TexParameter(ctx, texObj, GL_ALL_ATTRIB_BITS);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3262,6 +3262,7 @@ st_TexParameter(struct gl_context *ctx,
|
|||
struct st_texture_object *stObj = st_texture_object(texObj);
|
||||
|
||||
switch (pname) {
|
||||
case GL_ALL_ATTRIB_BITS: /* meaning is all pnames, internal */
|
||||
case GL_TEXTURE_BASE_LEVEL:
|
||||
case GL_TEXTURE_MAX_LEVEL:
|
||||
case GL_DEPTH_TEXTURE_MODE:
|
||||
|
|
Loading…
Reference in New Issue