diff options
author | Eric Anholt <[email protected]> | 2005-05-30 06:15:29 +0000 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2005-05-30 06:15:29 +0000 |
commit | b328dded7513c6092861197f6ba2edf9341e46d3 (patch) | |
tree | 7ee4cff1457aed635c343fd6301c717767278df6 /src/mesa | |
parent | c1b87b2a063034a0584d20ac21d5349f1e85d58a (diff) |
Pull hardware locking out into SpanRenderStart/Finish rather than
HW_LOCK/UNLOCK. Provides a 61% performance improvement in no_rast=true quake3
(n=2, 320x240, 16bpp, p4 1ghz), and a factor of 3 improvement in no_rast
glxgears.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/mga/mgaspan.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/mga/mgaspan.c b/src/mesa/drivers/dri/mga/mgaspan.c index 4279dfd95bc..8487f4b83f6 100644 --- a/src/mesa/drivers/dri/mga/mgaspan.c +++ b/src/mesa/drivers/dri/mga/mgaspan.c @@ -36,6 +36,7 @@ #define DBG 0 #define LOCAL_VARS \ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); \ __DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \ mgaScreenPrivate *mgaScreen = mmesa->mgaScreen; \ __DRIscreenPrivate *sPriv = mmesa->driScreen; \ @@ -55,6 +56,7 @@ #define LOCAL_DEPTH_VARS \ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); \ __DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \ mgaScreenPrivate *mgaScreen = mmesa->mgaScreen; \ __DRIscreenPrivate *sPriv = mmesa->driScreen; \ @@ -81,11 +83,7 @@ } -#define HW_LOCK() \ - mgaContextPtr mmesa = MGA_CONTEXT(ctx); \ - FLUSH_BATCH(mmesa); \ - LOCK_HARDWARE_QUIESCENT(mmesa); - +#define HW_LOCK() #define HW_CLIPLOOP() \ do { \ @@ -100,10 +98,7 @@ } \ } while (0) -#define HW_UNLOCK() \ - UNLOCK_HARDWARE(mmesa); - - +#define HW_UNLOCK() @@ -220,6 +215,20 @@ static void mgaDDSetBuffer(GLcontext *ctx, GLframebuffer *buffer, ? mmesa->driDrawable : mmesa->driReadable; } +void mgaSpanRenderStart( GLcontext *ctx ) +{ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + FLUSH_BATCH( mmesa ); + LOCK_HARDWARE_QUIESCENT( mmesa ); +} + +void mgaSpanRenderFinish( GLcontext *ctx ) +{ + mgaContextPtr mmesa = MGA_CONTEXT(ctx); + _swrast_flush( ctx ); + UNLOCK_HARDWARE( mmesa ); +} + /** * Initialize the driver callbacks for the read / write span functions. * @@ -269,10 +278,11 @@ void mgaDDInitSpanFuncs( GLcontext *ctx ) #endif break; } + swdd->SpanRenderStart = mgaSpanRenderStart; + swdd->SpanRenderFinish = mgaSpanRenderFinish; } - /** * Plug in the Get/Put routines for the given driRenderbuffer. */ |