diff options
author | Eric Anholt <[email protected]> | 2008-11-13 18:32:44 -0800 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-11-24 13:09:50 -0700 |
commit | 490ab6487985e533d73c075a72b2839d69673e93 (patch) | |
tree | 94db0ceb649a2e659760b0dae961b1bb65a65582 /src/mesa/drivers | |
parent | 51af35b7cc412b48d7753d94a7bdf72f435b16c9 (diff) |
i915: Don't overwrite i915's Viewport function from generic code.
Instead, have i965 and i915 both call the generic function from their Viewport.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_state.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_context.c | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_context.h | 3 |
4 files changed, 12 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_state.c b/src/mesa/drivers/dri/i915/intel_state.c index 09aa62da361..4aa43e5f3ab 100644 --- a/src/mesa/drivers/dri/i915/intel_state.c +++ b/src/mesa/drivers/dri/i915/intel_state.c @@ -267,6 +267,8 @@ intelViewport(GLcontext * ctx, GLint x, GLint y, GLsizei width, GLsizei height) { intelCalcViewport(ctx); + + intel_viewport(ctx, x, y, width, height); } static void diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index e2bc08a6cb7..1d6ac2cea68 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -71,6 +71,8 @@ static void brwInitDriverFunctions( struct dd_function_table *functions ) brwInitFragProgFuncs( functions ); brwInitProgFuncs( functions ); brw_init_queryobj_functions(functions); + + functions->Viewport = intel_viewport; } diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 9ac18e69609..6c625b428c0 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -317,11 +317,13 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) driUpdateFramebufferSize(&intel->ctx, drawable); } -static void +void intel_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) { struct intel_context *intel = intel_context(ctx); __DRIcontext *driContext = intel->driContext; + void (*old_viewport)(GLcontext *ctx, GLint x, GLint y, + GLsizei w, GLsizei h); if (!driContext->driScreenPriv->dri2.enabled) return; @@ -330,11 +332,12 @@ intel_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) if (driContext->driDrawablePriv != driContext->driReadablePriv) intel_update_renderbuffers(driContext, driContext->driReadablePriv); + old_viewport = ctx->Driver.Viewport; ctx->Driver.Viewport = NULL; intel->driDrawable = driContext->driDrawablePriv; intelWindowMoved(intel); intel_draw_buffer(ctx, intel->ctx.DrawBuffer); - ctx->Driver.Viewport = intel_viewport; + ctx->Driver.Viewport = old_viewport; } /** @@ -544,7 +547,6 @@ intelInitDriverFunctions(struct dd_function_table *functions) functions->Finish = intelFinish; functions->GetString = intelGetString; functions->UpdateState = intelInvalidateState; - functions->Viewport = intel_viewport; functions->CopyColorTable = _swrast_CopyColorTable; functions->CopyColorSubTable = _swrast_CopyColorSubTable; diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 3938af4c72c..60028f090ae 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -495,6 +495,9 @@ extern int intel_translate_stencil_op(GLenum op); extern int intel_translate_blend_factor(GLenum factor); extern int intel_translate_logic_op(GLenum opcode); +void intel_viewport(GLcontext * ctx, GLint x, GLint y, + GLsizei width, GLsizei height); + void intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable); |