diff options
author | Brian <[email protected]> | 2007-08-01 15:11:59 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-08-01 15:11:59 -0600 |
commit | 0c4acfe15a0555a6f3da02ab17e58cc379df11fd (patch) | |
tree | c65574cd49cdbc79d1eb8034f5bfe661f5e06eef /src/mesa/drivers/dri | |
parent | 0eb02a1963a25f6994b730147d0613b03424c11e (diff) |
Re-implement intelClear() in terms of softpipe_clear(). Pretty simple/small now.
Note: softpipe_clear() should really be renamed to something like
pipe_clear_with_blits() and put into a driver-indepedent module...
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/i915pipe/intel_blit.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915pipe/intel_buffers.c | 34 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915pipe/intel_context.c | 1 |
3 files changed, 36 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i915pipe/intel_blit.c b/src/mesa/drivers/dri/i915pipe/intel_blit.c index 109d4face26..4a5f58ed9e0 100644 --- a/src/mesa/drivers/dri/i915pipe/intel_blit.c +++ b/src/mesa/drivers/dri/i915pipe/intel_blit.c @@ -216,6 +216,10 @@ intelEmitFillBlit(struct intel_context *intel, GLboolean badMask = GL_FALSE; BATCH_LOCALS; + /* + printf("Emit fill blit value=0x%x mask=0x%x\n", value, mask); + */ + dst_pitch *= cpp; switch (cpp) { diff --git a/src/mesa/drivers/dri/i915pipe/intel_buffers.c b/src/mesa/drivers/dri/i915pipe/intel_buffers.c index fb931514302..e39220fe47e 100644 --- a/src/mesa/drivers/dri/i915pipe/intel_buffers.c +++ b/src/mesa/drivers/dri/i915pipe/intel_buffers.c @@ -295,16 +295,16 @@ intelWindowMoved(struct intel_context *intel) - /** * Called by ctx->Driver.Clear. + * XXX NO LONGER USED - REMOVE IN NEAR FUTURE */ #if 0 static void intelClear(GLcontext *ctx, GLbitfield mask) #else -void -intelClear(struct pipe_context *pipe, +static void +OLD_intelClear(struct pipe_context *pipe, GLboolean color, GLboolean depth, GLboolean stencil, GLboolean accum) #endif @@ -396,6 +396,34 @@ intelClear(struct pipe_context *pipe, } +/** + * Clear buffers. Called via pipe->clear(). + */ +void +intelClear(struct pipe_context *pipe, + GLboolean color, GLboolean depth, + GLboolean stencil, GLboolean accum) +{ + GLcontext *ctx = (GLcontext *) pipe->glctx; + struct intel_context *intel = intel_context(ctx); + + /* XXX + * Examine stencil and color writemasks to determine if we can clear + * with blits. + */ + + intelFlush(&intel->ctx); + LOCK_HARDWARE(intel); + + softpipe_clear(pipe, color, depth, stencil, accum); + + intel_batchbuffer_flush(intel->batch); + + UNLOCK_HARDWARE(intel); +} + + + /* Emit wait for pending flips */ void intel_wait_flips(struct intel_context *intel, GLuint batch_flags) diff --git a/src/mesa/drivers/dri/i915pipe/intel_context.c b/src/mesa/drivers/dri/i915pipe/intel_context.c index 6121f6bc608..be8235d7d11 100644 --- a/src/mesa/drivers/dri/i915pipe/intel_context.c +++ b/src/mesa/drivers/dri/i915pipe/intel_context.c @@ -763,6 +763,7 @@ void LOCK_HARDWARE( struct intel_context *intel ) */ void UNLOCK_HARDWARE( struct intel_context *intel ) { + assert(intel->locked); intel->locked = 0; DRM_UNLOCK(intel->driFd, intel->driHwLock, intel->hHWContext); |