mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
mesa/st: drop the rasterizer driver flags
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
b2175609ba
commit
c5af853cb9
7 changed files with 47 additions and 92 deletions
|
|
@ -33,6 +33,8 @@
|
|||
#include "enums.h"
|
||||
#include "api_exec_decl.h"
|
||||
|
||||
#include "state_tracker/st_context.h"
|
||||
|
||||
static ALWAYS_INLINE void
|
||||
conservative_raster_parameter(GLenum pname, GLfloat param,
|
||||
bool no_error, const char *func)
|
||||
|
|
@ -62,8 +64,7 @@ conservative_raster_parameter(GLenum pname, GLfloat param,
|
|||
}
|
||||
|
||||
FLUSH_VERTICES(ctx, 0, 0);
|
||||
ctx->NewDriverState |=
|
||||
ctx->DriverFlags.NewNvConservativeRasterizationParams;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
|
||||
ctx->ConservativeRasterDilate =
|
||||
CLAMP(param,
|
||||
|
|
@ -82,9 +83,7 @@ conservative_raster_parameter(GLenum pname, GLfloat param,
|
|||
}
|
||||
|
||||
FLUSH_VERTICES(ctx, 0, 0);
|
||||
ctx->NewDriverState |=
|
||||
ctx->DriverFlags.NewNvConservativeRasterizationParams;
|
||||
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->ConservativeRasterMode = param;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -503,10 +503,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
case GL_CULL_FACE:
|
||||
if (ctx->Polygon.CullFlag == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx,
|
||||
ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_POLYGON_BIT | GL_ENABLE_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Polygon.CullFlag = state;
|
||||
break;
|
||||
case GL_DEPTH_TEST:
|
||||
|
|
@ -577,9 +576,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Line.SmoothFlag == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_LINE_BIT | GL_ENABLE_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewLineState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Line.SmoothFlag = state;
|
||||
break;
|
||||
case GL_LINE_STIPPLE:
|
||||
|
|
@ -587,9 +586,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Line.StippleFlag == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_LINE_BIT | GL_ENABLE_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewLineState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Line.StippleFlag = state;
|
||||
break;
|
||||
case GL_INDEX_LOGIC_OP:
|
||||
|
|
@ -608,8 +607,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
if (ctx->IntelConservativeRasterization == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, 0, 0);
|
||||
ctx->NewDriverState |=
|
||||
ctx->DriverFlags.NewIntelConservativeRasterization;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->IntelConservativeRasterization = state;
|
||||
_mesa_update_valid_to_render_state(ctx);
|
||||
break;
|
||||
|
|
@ -619,8 +617,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
if (ctx->ConservativeRasterization == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, 0, GL_ENABLE_BIT);
|
||||
ctx->NewDriverState |=
|
||||
ctx->DriverFlags.NewNvConservativeRasterization;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->ConservativeRasterization = state;
|
||||
break;
|
||||
case GL_COLOR_LOGIC_OP:
|
||||
|
|
@ -818,10 +815,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Polygon.SmoothFlag == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx,
|
||||
ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_POLYGON_BIT | GL_ENABLE_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Polygon.SmoothFlag = state;
|
||||
break;
|
||||
case GL_POLYGON_STIPPLE:
|
||||
|
|
@ -829,10 +825,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Polygon.StippleFlag == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx,
|
||||
ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_POLYGON_BIT | GL_ENABLE_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Polygon.StippleFlag = state;
|
||||
break;
|
||||
case GL_POLYGON_OFFSET_POINT:
|
||||
|
|
@ -840,10 +835,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Polygon.OffsetPoint == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx,
|
||||
ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_POLYGON_BIT | GL_ENABLE_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Polygon.OffsetPoint = state;
|
||||
break;
|
||||
case GL_POLYGON_OFFSET_LINE:
|
||||
|
|
@ -851,19 +845,17 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->Polygon.OffsetLine == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx,
|
||||
ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_POLYGON_BIT | GL_ENABLE_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Polygon.OffsetLine = state;
|
||||
break;
|
||||
case GL_POLYGON_OFFSET_FILL:
|
||||
if (ctx->Polygon.OffsetFill == state)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx,
|
||||
ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_POLYGON_BIT | GL_ENABLE_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Polygon.OffsetFill = state;
|
||||
break;
|
||||
case GL_RESCALE_NORMAL_EXT:
|
||||
|
|
@ -1230,7 +1222,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->RasterDiscard != state) {
|
||||
FLUSH_VERTICES(ctx, 0, 0);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewRasterizerDiscard;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->RasterDiscard = state;
|
||||
}
|
||||
break;
|
||||
|
|
@ -1240,7 +1232,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->TileRasterOrderFixed != state) {
|
||||
FLUSH_VERTICES(ctx, 0, GL_ENABLE_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewTileRasterOrder;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->TileRasterOrderFixed = state;
|
||||
}
|
||||
break;
|
||||
|
|
@ -1250,7 +1242,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->TileRasterOrderIncreasingX != state) {
|
||||
FLUSH_VERTICES(ctx, 0, GL_ENABLE_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewTileRasterOrder;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->TileRasterOrderIncreasingX = state;
|
||||
}
|
||||
break;
|
||||
|
|
@ -1260,7 +1252,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
goto invalid_enum_error;
|
||||
if (ctx->TileRasterOrderIncreasingY != state) {
|
||||
FLUSH_VERTICES(ctx, 0, GL_ENABLE_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewTileRasterOrder;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->TileRasterOrderIncreasingY = state;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "mtypes.h"
|
||||
#include "api_exec_decl.h"
|
||||
|
||||
#include "state_tracker/st_context.h"
|
||||
|
||||
/**
|
||||
* Set the line width.
|
||||
|
|
@ -68,8 +69,8 @@ line_width(struct gl_context *ctx, GLfloat width, bool no_error)
|
|||
return;
|
||||
}
|
||||
|
||||
FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE, GL_LINE_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewLineState;
|
||||
FLUSH_VERTICES(ctx, 0, GL_LINE_BIT);
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Line.Width = width;
|
||||
}
|
||||
|
||||
|
|
@ -120,8 +121,8 @@ _mesa_LineStipple( GLint factor, GLushort pattern )
|
|||
ctx->Line.StipplePattern == pattern)
|
||||
return;
|
||||
|
||||
FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE, GL_LINE_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewLineState;
|
||||
FLUSH_VERTICES(ctx, 0, GL_LINE_BIT);
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Line.StippleFactor = factor;
|
||||
ctx->Line.StipplePattern = pattern;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4774,12 +4774,6 @@ struct gl_driver_flags
|
|||
/** gl_context::TransformFeedback::CurrentObject::shader_program */
|
||||
uint64_t NewTransformFeedbackProg;
|
||||
|
||||
/** gl_context::RasterDiscard */
|
||||
uint64_t NewRasterizerDiscard;
|
||||
|
||||
/** gl_context::TileRasterOrder* */
|
||||
uint64_t NewTileRasterOrder;
|
||||
|
||||
/**
|
||||
* gl_context::UniformBufferBindings
|
||||
* gl_shader_program::UniformBlocks
|
||||
|
|
@ -4810,22 +4804,6 @@ struct gl_driver_flags
|
|||
*/
|
||||
uint64_t NewTessState;
|
||||
|
||||
/**
|
||||
* gl_context::IntelConservativeRasterization
|
||||
*/
|
||||
uint64_t NewIntelConservativeRasterization;
|
||||
|
||||
/**
|
||||
* gl_context::NvConservativeRasterization
|
||||
*/
|
||||
uint64_t NewNvConservativeRasterization;
|
||||
|
||||
/**
|
||||
* gl_context::ConservativeRasterMode/ConservativeRasterDilate
|
||||
* gl_context::SubpixelPrecisionBias
|
||||
*/
|
||||
uint64_t NewNvConservativeRasterizationParams;
|
||||
|
||||
/**
|
||||
* gl_context::Scissor::WindowRects
|
||||
*/
|
||||
|
|
@ -4885,12 +4863,6 @@ struct gl_driver_flags
|
|||
/** gl_context::Color::ClampFragmentColor */
|
||||
uint64_t NewFragClamp;
|
||||
|
||||
/** gl_context::Line */
|
||||
uint64_t NewLineState;
|
||||
|
||||
/** gl_context::Polygon */
|
||||
uint64_t NewPolygonState;
|
||||
|
||||
/** gl_context::PolygonStipple */
|
||||
uint64_t NewPolygonStipple;
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include "mtypes.h"
|
||||
#include "api_exec_decl.h"
|
||||
|
||||
#include "state_tracker/st_context.h"
|
||||
|
||||
/**
|
||||
* Specify whether to cull front- or back-facing facets.
|
||||
|
|
@ -64,9 +65,9 @@ cull_face(struct gl_context *ctx, GLenum mode, bool no_error)
|
|||
return;
|
||||
}
|
||||
|
||||
FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_POLYGON_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Polygon.CullFaceMode = mode;
|
||||
}
|
||||
|
||||
|
|
@ -113,9 +114,9 @@ front_face(struct gl_context *ctx, GLenum mode, bool no_error)
|
|||
return;
|
||||
}
|
||||
|
||||
FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_POLYGON_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Polygon.FrontFace = mode;
|
||||
}
|
||||
|
||||
|
|
@ -188,17 +189,17 @@ polygon_mode(struct gl_context *ctx, GLenum face, GLenum mode, bool no_error)
|
|||
}
|
||||
if (ctx->Polygon.FrontMode == mode)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_POLYGON_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Polygon.FrontMode = mode;
|
||||
break;
|
||||
case GL_FRONT_AND_BACK:
|
||||
if (ctx->Polygon.FrontMode == mode && ctx->Polygon.BackMode == mode)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_POLYGON_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Polygon.FrontMode = mode;
|
||||
ctx->Polygon.BackMode = mode;
|
||||
break;
|
||||
|
|
@ -209,9 +210,9 @@ polygon_mode(struct gl_context *ctx, GLenum face, GLenum mode, bool no_error)
|
|||
}
|
||||
if (ctx->Polygon.BackMode == mode)
|
||||
return;
|
||||
FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_POLYGON_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Polygon.BackMode = mode;
|
||||
break;
|
||||
default:
|
||||
|
|
@ -314,9 +315,9 @@ _mesa_polygon_offset_clamp(struct gl_context *ctx,
|
|||
ctx->Polygon.OffsetClamp == clamp)
|
||||
return;
|
||||
|
||||
FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON,
|
||||
FLUSH_VERTICES(ctx, 0,
|
||||
GL_POLYGON_BIT);
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
ctx->Polygon.OffsetFactor = factor;
|
||||
ctx->Polygon.OffsetUnits = units;
|
||||
ctx->Polygon.OffsetClamp = clamp;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
#include "api_exec_decl.h"
|
||||
|
||||
#include "state_tracker/st_cb_viewport.h"
|
||||
#include "state_tracker/st_context.h"
|
||||
|
||||
static void
|
||||
clamp_viewport(struct gl_context *ctx, GLfloat *x, GLfloat *y,
|
||||
|
|
@ -515,10 +516,7 @@ clip_control(struct gl_context *ctx, GLenum origin, GLenum depth, bool no_error)
|
|||
ctx->Transform.ClipOrigin = origin;
|
||||
|
||||
/* Affects the winding order of the front face. */
|
||||
if (ctx->DriverFlags.NewPolygonState)
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
|
||||
else
|
||||
ctx->NewState |= _NEW_POLYGON;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
}
|
||||
|
||||
if (ctx->Transform.ClipDepthMode != depth) {
|
||||
|
|
@ -601,8 +599,7 @@ subpixel_precision_bias(struct gl_context *ctx, GLuint xbits, GLuint ybits)
|
|||
ctx->SubpixelPrecisionBias[0] = xbits;
|
||||
ctx->SubpixelPrecisionBias[1] = ybits;
|
||||
|
||||
ctx->NewDriverState |=
|
||||
ctx->DriverFlags.NewNvConservativeRasterizationParams;
|
||||
ctx->NewDriverState |= ST_NEW_RASTERIZER;
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
|
|
|
|||
|
|
@ -447,8 +447,6 @@ st_init_driver_flags(struct st_context *st)
|
|||
{
|
||||
struct gl_driver_flags *f = &st->ctx->DriverFlags;
|
||||
|
||||
f->NewRasterizerDiscard = ST_NEW_RASTERIZER;
|
||||
f->NewTileRasterOrder = ST_NEW_RASTERIZER;
|
||||
f->NewUniformBuffer = ST_NEW_UNIFORM_BUFFER;
|
||||
f->NewTessState = ST_NEW_TESS_STATE;
|
||||
|
||||
|
|
@ -513,13 +511,8 @@ st_init_driver_flags(struct st_context *st)
|
|||
else
|
||||
f->NewClipPlaneEnable = ST_NEW_RASTERIZER;
|
||||
|
||||
f->NewLineState = ST_NEW_RASTERIZER;
|
||||
f->NewPolygonState = ST_NEW_RASTERIZER;
|
||||
f->NewPolygonStipple = ST_NEW_POLY_STIPPLE;
|
||||
f->NewViewport = ST_NEW_VIEWPORT;
|
||||
f->NewNvConservativeRasterization = ST_NEW_RASTERIZER;
|
||||
f->NewNvConservativeRasterizationParams = ST_NEW_RASTERIZER;
|
||||
f->NewIntelConservativeRasterization = ST_NEW_RASTERIZER;
|
||||
|
||||
if (st->emulate_gl_clamp)
|
||||
f->NewSamplersWithClamp = ST_NEW_SAMPLERS |
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue