Module: Mesa Branch: main Commit: 33991f0743e34103072078235634ffb7da6a08c5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=33991f0743e34103072078235634ffb7da6a08c5
Author: Dave Airlie <[email protected]> Date: Mon Dec 20 13:03:42 2021 +1000 mesa/st: drop scissor/window rect driver state bits Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14261> --- src/mesa/main/enable.c | 10 ++++------ src/mesa/main/mtypes.h | 11 ----------- src/mesa/main/scissor.c | 8 ++++---- src/mesa/state_tracker/st_context.c | 3 --- 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 12b94358d52..f658f183f30 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -873,10 +873,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) GLbitfield newEnabled = state * ((1 << ctx->Const.MaxViewports) - 1); if (newEnabled != ctx->Scissor.EnableFlags) { - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewScissorTest ? 0 : - _NEW_SCISSOR, + FLUSH_VERTICES(ctx, 0, GL_SCISSOR_BIT | GL_ENABLE_BIT); - ctx->NewDriverState |= ctx->DriverFlags.NewScissorTest; + ctx->NewDriverState |= ST_NEW_SCISSOR | ST_NEW_RASTERIZER; ctx->Scissor.EnableFlags = newEnabled; } } @@ -1406,10 +1405,9 @@ _mesa_set_enablei(struct gl_context *ctx, GLenum cap, return; } if (((ctx->Scissor.EnableFlags >> index) & 1) != state) { - FLUSH_VERTICES(ctx, - ctx->DriverFlags.NewScissorTest ? 0 : _NEW_SCISSOR, + FLUSH_VERTICES(ctx, 0, GL_SCISSOR_BIT | GL_ENABLE_BIT); - ctx->NewDriverState |= ctx->DriverFlags.NewScissorTest; + ctx->NewDriverState |= ST_NEW_SCISSOR | ST_NEW_RASTERIZER; if (state) ctx->Scissor.EnableFlags |= (1 << index); else diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 566cbe9527d..4dcff8ab374 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -4773,20 +4773,9 @@ struct gl_driver_flags */ uint64_t NewAtomicBuffer; - /** - * gl_context::Scissor::WindowRects - */ - uint64_t NewWindowRectangles; - /** gl_context::Color::sRGBEnabled */ uint64_t NewFramebufferSRGB; - /** gl_context::Scissor::EnableFlags */ - uint64_t NewScissorTest; - - /** gl_context::Scissor::ScissorArray */ - uint64_t NewScissorRect; - /** gl_context::Color::Alpha* */ uint64_t NewAlphaTest; diff --git a/src/mesa/main/scissor.c b/src/mesa/main/scissor.c index 5b529787ec1..054c5abaccd 100644 --- a/src/mesa/main/scissor.c +++ b/src/mesa/main/scissor.c @@ -30,6 +30,7 @@ #include "main/scissor.h" #include "api_exec_decl.h" +#include "state_tracker/st_context.h" /** * Set scissor rectangle data directly in ScissorArray @@ -49,9 +50,8 @@ set_scissor_no_notify(struct gl_context *ctx, unsigned idx, height == ctx->Scissor.ScissorArray[idx].Height) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewScissorRect ? 0 : _NEW_SCISSOR, - GL_SCISSOR_BIT); - ctx->NewDriverState |= ctx->DriverFlags.NewScissorRect; + FLUSH_VERTICES(ctx, 0, GL_SCISSOR_BIT); + ctx->NewDriverState |= ST_NEW_SCISSOR; ctx->Scissor.ScissorArray[idx].X = x; ctx->Scissor.ScissorArray[idx].Y = y; @@ -295,7 +295,7 @@ _mesa_WindowRectanglesEXT(GLenum mode, GLsizei count, const GLint *box) } FLUSH_VERTICES(ctx, 0, GL_SCISSOR_BIT); - ctx->NewDriverState |= ctx->DriverFlags.NewWindowRectangles; + ctx->NewDriverState |= ST_NEW_WINDOW_RECTANGLES; memcpy(ctx->Scissor.WindowRects, newval, sizeof(struct gl_scissor_rect) * count); diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index b77dd901246..f828b0c5447 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -460,10 +460,7 @@ st_init_driver_flags(struct st_context *st) f->NewShaderConstants[MESA_SHADER_FRAGMENT] = ST_NEW_FS_CONSTANTS; f->NewShaderConstants[MESA_SHADER_COMPUTE] = ST_NEW_CS_CONSTANTS; - f->NewWindowRectangles = ST_NEW_WINDOW_RECTANGLES; f->NewFramebufferSRGB = ST_NEW_FB_STATE; - f->NewScissorRect = ST_NEW_SCISSOR; - f->NewScissorTest = ST_NEW_SCISSOR | ST_NEW_RASTERIZER; if (st->lower_alpha_test) f->NewAlphaTest = ST_NEW_FS_STATE | ST_NEW_FS_CONSTANTS;
