mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
mesa/st: drop scissor/window rect driver state bits
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14261>
This commit is contained in:
parent
42c7570eed
commit
33991f0743
4 changed files with 8 additions and 24 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue