mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 15:00:10 +01:00
mesa: Eliminate parameters to dd_function_table::Scissor
The i830 and i915 drivers used them, but they didn't really need to. They will just be annoying in future patches. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
6dbab6b2bb
commit
a05c596a00
9 changed files with 31 additions and 30 deletions
|
|
@ -302,8 +302,7 @@ _mesa_init_driver_state(struct gl_context *ctx)
|
|||
ctx->Driver.LogicOpcode(ctx, ctx->Color.LogicOp);
|
||||
ctx->Driver.PointSize(ctx, ctx->Point.Size);
|
||||
ctx->Driver.PolygonStipple(ctx, (const GLubyte *) ctx->PolygonStipple);
|
||||
ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
|
||||
ctx->Scissor.Width, ctx->Scissor.Height);
|
||||
ctx->Driver.Scissor(ctx);
|
||||
ctx->Driver.ShadeModel(ctx, ctx->Light.ShadeModel);
|
||||
ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT,
|
||||
ctx->Stencil.Function[0],
|
||||
|
|
|
|||
|
|
@ -527,7 +527,7 @@ i830PolygonStipple(struct gl_context * ctx, const GLubyte * mask)
|
|||
* Hardware clipping
|
||||
*/
|
||||
static void
|
||||
i830Scissor(struct gl_context * ctx, GLint x, GLint y, GLsizei w, GLsizei h)
|
||||
i830Scissor(struct gl_context * ctx)
|
||||
{
|
||||
struct i830_context *i830 = i830_context(ctx);
|
||||
int x1, y1, x2, y2;
|
||||
|
|
@ -535,22 +535,24 @@ i830Scissor(struct gl_context * ctx, GLint x, GLint y, GLsizei w, GLsizei h)
|
|||
if (!ctx->DrawBuffer)
|
||||
return;
|
||||
|
||||
DBG("%s %d,%d %dx%d\n", __FUNCTION__, x, y, w, h);
|
||||
DBG("%s %d,%d %dx%d\n", __FUNCTION__,
|
||||
ctx->Scissor.X, ctx->Scissor.Y,
|
||||
ctx->Scissor.Width, ctx->Scissor.Height);
|
||||
|
||||
if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
|
||||
x1 = x;
|
||||
y1 = ctx->DrawBuffer->Height - (y + h);
|
||||
x2 = x + w - 1;
|
||||
y2 = y1 + h - 1;
|
||||
x1 = ctx->Scissor.X;
|
||||
y1 = ctx->DrawBuffer->Height - (ctx->Scissor.Y + ctx->Scissor.Height);
|
||||
x2 = ctx->Scissor.X + ctx->Scissor.Width - 1;
|
||||
y2 = y1 + ctx->Scissor.Height - 1;
|
||||
DBG("%s %d..%d,%d..%d (inverted)\n", __FUNCTION__, x1, x2, y1, y2);
|
||||
}
|
||||
else {
|
||||
/* FBO - not inverted
|
||||
*/
|
||||
x1 = x;
|
||||
y1 = y;
|
||||
x2 = x + w - 1;
|
||||
y2 = y + h - 1;
|
||||
x1 = ctx->Scissor.X;
|
||||
y1 = ctx->Scissor.Y;
|
||||
x2 = ctx->Scissor.X + ctx->Scissor.Width - 1;
|
||||
y2 = ctx->Scissor.Y + ctx->Scissor.Height - 1;
|
||||
DBG("%s %d..%d,%d..%d (not inverted)\n", __FUNCTION__, x1, x2, y1, y2);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -835,8 +835,7 @@ i830_update_draw_buffer(struct intel_context *intel)
|
|||
/* Set state we know depends on drawable parameters:
|
||||
*/
|
||||
intelCalcViewport(ctx);
|
||||
ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
|
||||
ctx->Scissor.Width, ctx->Scissor.Height);
|
||||
ctx->Driver.Scissor(ctx);
|
||||
|
||||
/* Update culling direction which changes depending on the
|
||||
* orientation of the buffer:
|
||||
|
|
|
|||
|
|
@ -501,7 +501,7 @@ i915PolygonStipple(struct gl_context * ctx, const GLubyte * mask)
|
|||
* Hardware clipping
|
||||
*/
|
||||
static void
|
||||
i915Scissor(struct gl_context * ctx, GLint x, GLint y, GLsizei w, GLsizei h)
|
||||
i915Scissor(struct gl_context * ctx)
|
||||
{
|
||||
struct i915_context *i915 = I915_CONTEXT(ctx);
|
||||
int x1, y1, x2, y2;
|
||||
|
|
@ -509,22 +509,24 @@ i915Scissor(struct gl_context * ctx, GLint x, GLint y, GLsizei w, GLsizei h)
|
|||
if (!ctx->DrawBuffer)
|
||||
return;
|
||||
|
||||
DBG("%s %d,%d %dx%d\n", __FUNCTION__, x, y, w, h);
|
||||
DBG("%s %d,%d %dx%d\n", __FUNCTION__,
|
||||
ctx->Scissor.X, ctx->Scissor.Y,
|
||||
ctx->Scissor.Width, ctx->Scissor.Height);
|
||||
|
||||
if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
|
||||
x1 = x;
|
||||
y1 = ctx->DrawBuffer->Height - (y + h);
|
||||
x2 = x + w - 1;
|
||||
y2 = y1 + h - 1;
|
||||
x1 = ctx->Scissor.X;
|
||||
y1 = ctx->DrawBuffer->Height - (ctx->Scissor.Y + ctx->Scissor.Height);
|
||||
x2 = ctx->Scissor.X + ctx->Scissor.Width - 1;
|
||||
y2 = y1 + ctx->Scissor.Height - 1;
|
||||
DBG("%s %d..%d,%d..%d (inverted)\n", __FUNCTION__, x1, x2, y1, y2);
|
||||
}
|
||||
else {
|
||||
/* FBO - not inverted
|
||||
*/
|
||||
x1 = x;
|
||||
y1 = y;
|
||||
x2 = x + w - 1;
|
||||
y2 = y + h - 1;
|
||||
x1 = ctx->Scissor.X;
|
||||
y1 = ctx->Scissor.Y;
|
||||
x2 = ctx->Scissor.X + ctx->Scissor.Width - 1;
|
||||
y2 = ctx->Scissor.Y + ctx->Scissor.Height - 1;
|
||||
DBG("%s %d..%d,%d..%d (not inverted)\n", __FUNCTION__, x1, x2, y1, y2);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -809,8 +809,7 @@ i915_update_draw_buffer(struct intel_context *intel)
|
|||
/* Set state we know depends on drawable parameters:
|
||||
*/
|
||||
intelCalcViewport(ctx);
|
||||
ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
|
||||
ctx->Scissor.Width, ctx->Scissor.Height);
|
||||
ctx->Driver.Scissor(ctx);
|
||||
|
||||
/* Update culling direction which changes depending on the
|
||||
* orientation of the buffer:
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ void radeonUpdateScissor( struct gl_context *ctx )
|
|||
* Scissoring
|
||||
*/
|
||||
|
||||
void radeonScissor(struct gl_context* ctx, GLint x, GLint y, GLsizei w, GLsizei h)
|
||||
void radeonScissor(struct gl_context *ctx)
|
||||
{
|
||||
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
|
||||
if (ctx->Scissor.Enabled) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
void radeonUserClear(struct gl_context *ctx, GLuint mask);
|
||||
void radeonSetCliprects(radeonContextPtr radeon);
|
||||
void radeonUpdateScissor( struct gl_context *ctx );
|
||||
void radeonScissor(struct gl_context* ctx, GLint x, GLint y, GLsizei w, GLsizei h);
|
||||
void radeonScissor(struct gl_context *ctx);
|
||||
|
||||
extern uint32_t radeonGetAge(radeonContextPtr radeon);
|
||||
|
||||
|
|
|
|||
|
|
@ -525,7 +525,7 @@ struct dd_function_table {
|
|||
/** Set rasterization mode */
|
||||
void (*RenderMode)(struct gl_context *ctx, GLenum mode );
|
||||
/** Define the scissor box */
|
||||
void (*Scissor)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
|
||||
void (*Scissor)(struct gl_context *ctx);
|
||||
/** Select flat or smooth shading */
|
||||
void (*ShadeModel)(struct gl_context *ctx, GLenum mode);
|
||||
/** OpenGL 2.0 two-sided StencilFunc */
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ _mesa_set_scissor(struct gl_context *ctx,
|
|||
ctx->Scissor.Height = height;
|
||||
|
||||
if (ctx->Driver.Scissor)
|
||||
ctx->Driver.Scissor( ctx, x, y, width, height );
|
||||
ctx->Driver.Scissor(ctx);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue