diff options
author | Ian Romanick <[email protected]> | 2013-11-01 11:38:25 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-11-05 07:50:04 -0800 |
commit | 619a9bee7da9f3b8271841b6782dfc846dd7ee32 (patch) | |
tree | f08f3b36a82a3c81cf29fc9df019b2f2d39443be | |
parent | abd962f1d5e0991073312305560516a3e64ef1cb (diff) |
i915: Bring sanity to the Viewport function
The i830 and the i915 driver have the same dd_function_table::Viewport
function... it just has two names and lives in two places. Using a
single implementation allows cleaning up the saved_viewport nonsense
too.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Cc: Courtney Goeltzenleuchter <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i915/i830_state.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_state.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_context.c | 28 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_context.h | 2 |
4 files changed, 22 insertions, 28 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c index cedc58a2d1c..bbf0cefe148 100644 --- a/src/mesa/drivers/dri/i915/i830_state.c +++ b/src/mesa/drivers/dri/i915/i830_state.c @@ -451,15 +451,6 @@ i830DepthMask(struct gl_context * ctx, GLboolean flag) i830->state.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_DEPTH_WRITE; } -/** Called from ctx->Driver.Viewport() */ -static void -i830Viewport(struct gl_context * ctx, - GLint x, GLint y, GLsizei width, GLsizei height) -{ - intelCalcViewport(ctx); -} - - /** Called from ctx->Driver.DepthRange() */ static void i830DepthRange(struct gl_context * ctx, GLclampd nearval, GLclampd farval) @@ -1136,7 +1127,6 @@ i830InitStateFuncs(struct dd_function_table *functions) functions->StencilMaskSeparate = i830StencilMaskSeparate; functions->StencilOpSeparate = i830StencilOpSeparate; functions->DepthRange = i830DepthRange; - functions->Viewport = i830Viewport; } void diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index 2fd0bf12f93..fedafece6af 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -424,15 +424,6 @@ intelCalcViewport(struct gl_context * ctx) } -/** Called from ctx->Driver.Viewport() */ -static void -i915Viewport(struct gl_context * ctx, - GLint x, GLint y, GLsizei width, GLsizei height) -{ - intelCalcViewport(ctx); -} - - /** Called from ctx->Driver.DepthRange() */ static void i915DepthRange(struct gl_context * ctx, GLclampd nearval, GLclampd farval) @@ -1091,7 +1082,6 @@ i915InitStateFunctions(struct dd_function_table *functions) functions->StencilMaskSeparate = i915StencilMaskSeparate; functions->StencilOpSeparate = i915StencilOpSeparate; functions->DepthRange = i915DepthRange; - functions->Viewport = i915Viewport; } diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index 2748514b248..15d40748bcb 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -248,13 +248,18 @@ intel_prepare_render(struct intel_context *intel) } static void -intel_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h) +intel_noninvalidate_viewport(struct gl_context *ctx, GLint x, GLint y, + GLsizei w, GLsizei h) { struct intel_context *intel = intel_context(ctx); __DRIcontext *driContext = intel->driContext; - if (intel->saved_viewport) - intel->saved_viewport(ctx, x, y, w, h); + (void) x; + (void) y; + (void) w; + (void) h; + + intelCalcViewport(ctx); if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) { dri2InvalidateDrawable(driContext->driDrawablePriv); @@ -262,6 +267,17 @@ intel_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h) } } +static void +intel_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h) +{ + (void) x; + (void) y; + (void) w; + (void) h; + + intelCalcViewport(ctx); +} + static const struct dri_debug_control debug_control[] = { { "tex", DEBUG_TEXTURE}, { "state", DEBUG_STATE}, @@ -384,10 +400,10 @@ intelInitContext(struct intel_context *intel, struct gl_config visual; /* Can't rely on invalidate events, fall back to glViewport hack */ - if (!driContextPriv->driScreenPriv->dri2.useInvalidate) { - intel->saved_viewport = functions->Viewport; + if (!driContextPriv->driScreenPriv->dri2.useInvalidate) + functions->Viewport = intel_noninvalidate_viewport; + else functions->Viewport = intel_viewport; - } if (mesaVis == NULL) { memset(&visual, 0, sizeof visual); diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index 6fb73fcd0dc..0b83a3ef656 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -278,8 +278,6 @@ struct intel_context __DRIcontext *driContext; struct intel_screen *intelScreen; - void (*saved_viewport)(struct gl_context * ctx, - GLint x, GLint y, GLsizei width, GLsizei height); /** * Configuration cache |