mesa: more optimizations in glPopAttrib (colormask, drawbuffers, coord replace)
Acked-by: Adam Jackson <ajax@redhat.com> Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
This commit is contained in:
parent
f6f6d3c0e7
commit
959380dcb0
|
@ -683,23 +683,24 @@ _mesa_PopAttrib(void)
|
||||||
attr->Color.ClearColor.f[2],
|
attr->Color.ClearColor.f[2],
|
||||||
attr->Color.ClearColor.f[3]);
|
attr->Color.ClearColor.f[3]);
|
||||||
TEST_AND_CALL1(Color.IndexMask, IndexMask);
|
TEST_AND_CALL1(Color.IndexMask, IndexMask);
|
||||||
if (!ctx->Extensions.EXT_draw_buffers2) {
|
if (ctx->Color.ColorMask != attr->Color.ColorMask) {
|
||||||
_mesa_ColorMask(GET_COLORMASK_BIT(attr->Color.ColorMask, 0, 0),
|
if (!ctx->Extensions.EXT_draw_buffers2) {
|
||||||
GET_COLORMASK_BIT(attr->Color.ColorMask, 0, 1),
|
_mesa_ColorMask(GET_COLORMASK_BIT(attr->Color.ColorMask, 0, 0),
|
||||||
GET_COLORMASK_BIT(attr->Color.ColorMask, 0, 2),
|
GET_COLORMASK_BIT(attr->Color.ColorMask, 0, 1),
|
||||||
GET_COLORMASK_BIT(attr->Color.ColorMask, 0, 3));
|
GET_COLORMASK_BIT(attr->Color.ColorMask, 0, 2),
|
||||||
}
|
GET_COLORMASK_BIT(attr->Color.ColorMask, 0, 3));
|
||||||
else {
|
} else {
|
||||||
GLuint i;
|
for (unsigned i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
|
||||||
for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
|
_mesa_ColorMaski(i,
|
||||||
_mesa_ColorMaski(i,
|
GET_COLORMASK_BIT(attr->Color.ColorMask, i, 0),
|
||||||
GET_COLORMASK_BIT(attr->Color.ColorMask, i, 0),
|
GET_COLORMASK_BIT(attr->Color.ColorMask, i, 1),
|
||||||
GET_COLORMASK_BIT(attr->Color.ColorMask, i, 1),
|
GET_COLORMASK_BIT(attr->Color.ColorMask, i, 2),
|
||||||
GET_COLORMASK_BIT(attr->Color.ColorMask, i, 2),
|
GET_COLORMASK_BIT(attr->Color.ColorMask, i, 3));
|
||||||
GET_COLORMASK_BIT(attr->Color.ColorMask, i, 3));
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
if (memcmp(ctx->Color.DrawBuffer, attr->Color.DrawBuffer,
|
||||||
|
sizeof(attr->Color.DrawBuffer))) {
|
||||||
/* Need to determine if more than one color output is
|
/* Need to determine if more than one color output is
|
||||||
* specified. If so, call glDrawBuffersARB, else call
|
* specified. If so, call glDrawBuffersARB, else call
|
||||||
* glDrawBuffer(). This is a subtle, but essential point
|
* glDrawBuffer(). This is a subtle, but essential point
|
||||||
|
@ -978,10 +979,9 @@ _mesa_PopAttrib(void)
|
||||||
}
|
}
|
||||||
if (ctx->Extensions.NV_point_sprite
|
if (ctx->Extensions.NV_point_sprite
|
||||||
|| ctx->Extensions.ARB_point_sprite) {
|
|| ctx->Extensions.ARB_point_sprite) {
|
||||||
GLuint u;
|
if (ctx->Point.CoordReplace != attr->Point.CoordReplace) {
|
||||||
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
|
ctx->NewState |= _NEW_POINT;
|
||||||
_mesa_TexEnvi(GL_POINT_SPRITE_NV, GL_COORD_REPLACE_NV,
|
ctx->Point.CoordReplace = attr->Point.CoordReplace;
|
||||||
!!(attr->Point.CoordReplace & (1u << u)));
|
|
||||||
}
|
}
|
||||||
TEST_AND_UPDATE(ctx->Point.PointSprite, attr->Point.PointSprite,
|
TEST_AND_UPDATE(ctx->Point.PointSprite, attr->Point.PointSprite,
|
||||||
GL_POINT_SPRITE_NV);
|
GL_POINT_SPRITE_NV);
|
||||||
|
|
Loading…
Reference in New Issue