mesa/drivers: use new swrast renderbuffer functions
authorBrian Paul <brianp@vmware.com>
Tue, 6 Dec 2011 03:40:48 +0000 (20:40 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 8 Dec 2011 15:56:30 +0000 (08:56 -0700)
Reviewed-by: Eric Anholt <eric@anholt.net>
12 files changed:
src/mesa/drivers/common/driverfuncs.c
src/mesa/drivers/dri/intel/intel_pixel.c
src/mesa/drivers/dri/intel/intel_screen.c
src/mesa/drivers/dri/intel/intel_span.c
src/mesa/drivers/dri/nouveau/nouveau_screen.c
src/mesa/drivers/dri/radeon/radeon_screen.c
src/mesa/drivers/dri/radeon/radeon_span.c
src/mesa/drivers/dri/swrast/swrast.c
src/mesa/drivers/osmesa/osmesa.c
src/mesa/drivers/windows/gdi/wmesa.c
src/mesa/drivers/x11/xm_api.c
src/mesa/drivers/x11/xm_buffer.c

index 0785cffb42e744c045a8a9ec92eb14db99329ee1..c6b42a21d931179ca84bda7eaf13670d4bd91bce 100644 (file)
@@ -50,6 +50,7 @@
 #include "program/program.h"
 #include "tnl/tnl.h"
 #include "swrast/swrast.h"
+#include "swrast/s_renderbuffer.h"
 
 #include "driverfuncs.h"
 #include "meta.h"
@@ -179,9 +180,9 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
    _mesa_init_sync_object_functions(driver);
 
    driver->NewFramebuffer = _mesa_new_framebuffer;
-   driver->NewRenderbuffer = _mesa_new_soft_renderbuffer;
-   driver->MapRenderbuffer = _mesa_map_soft_renderbuffer;
-   driver->UnmapRenderbuffer = _mesa_unmap_soft_renderbuffer;
+   driver->NewRenderbuffer = _swrast_new_soft_renderbuffer;
+   driver->MapRenderbuffer = _swrast_map_soft_renderbuffer;
+   driver->UnmapRenderbuffer = _swrast_unmap_soft_renderbuffer;
    driver->RenderTexture = _swrast_render_texture;
    driver->FinishRenderTexture = _swrast_finish_render_texture;
    driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer;
index 4f665a746e71746c1d6abdd150a4cb385daf68ff..eeafe22344365f1f7e11bab2fb41c33c7fc6632a 100644 (file)
@@ -25,6 +25,7 @@
  * 
  **************************************************************************/
 
+#include "main/accum.h"
 #include "main/enums.h"
 #include "main/state.h"
 #include "main/bufferobj.h"
index f67bef95566eab5d8c9dd7302e70dab71576e0b5..e4cc5b0864e31866f6d6882ba66d5d097a8b7fa8 100644 (file)
@@ -33,6 +33,7 @@
 #include "main/hash.h"
 #include "main/fbobject.h"
 #include "main/mfeatures.h"
+#include "swrast/s_renderbuffer.h"
 
 #include "utils.h"
 #include "xmlpool.h"
@@ -470,13 +471,13 @@ intelCreateBuffer(__DRIscreen * driScrnPriv,
       }
 
       /* now add any/all software-based renderbuffers we may need */
-      _mesa_add_soft_renderbuffers(fb,
-                                   false, /* never sw color */
-                                   false, /* never sw depth */
-                                   false, /* never sw stencil */
-                                   mesaVis->accumRedBits > 0,
-                                   false, /* never sw alpha */
-                                   false  /* never sw aux */ );
+      _swrast_add_soft_renderbuffers(fb,
+                                     false, /* never sw color */
+                                     false, /* never sw depth */
+                                     false, /* never sw stencil */
+                                     mesaVis->accumRedBits > 0,
+                                     false, /* never sw alpha */
+                                     false  /* never sw aux */ );
       driDrawPriv->driverPrivate = fb;
 
       return true;
index d203617488c6fb6fc5c6ed2dc1803d0599def8a8..43b815114adfa5bb48033b2a8ca58cb11c23fe3d 100644 (file)
@@ -46,6 +46,7 @@
 #include "intel_tex.h"
 
 #include "swrast/swrast.h"
+#include "swrast/s_renderbuffer.h"
 
 static void
 intel_set_span_functions(struct intel_context *intel,
@@ -415,19 +416,19 @@ static span_init_func intel_span_init_funcs[MESA_FORMAT_COUNT] =
    [MESA_FORMAT_XRGB8888] = intel_InitPointers_xRGB8888,
    [MESA_FORMAT_ARGB8888] = intel_InitPointers_ARGB8888,
    [MESA_FORMAT_SARGB8] = intel_InitPointers_ARGB8888,
-   [MESA_FORMAT_Z16] = _mesa_set_renderbuffer_accessors,
-   [MESA_FORMAT_X8_Z24] = _mesa_set_renderbuffer_accessors,
-   [MESA_FORMAT_S8_Z24] = _mesa_set_renderbuffer_accessors,
-   [MESA_FORMAT_S8] = _mesa_set_renderbuffer_accessors,
-   [MESA_FORMAT_R8] = _mesa_set_renderbuffer_accessors,
-   [MESA_FORMAT_GR88] = _mesa_set_renderbuffer_accessors,
-   [MESA_FORMAT_R16] = _mesa_set_renderbuffer_accessors,
-   [MESA_FORMAT_RG1616] = _mesa_set_renderbuffer_accessors,
-   [MESA_FORMAT_RGBA_FLOAT32] = _mesa_set_renderbuffer_accessors,
-   [MESA_FORMAT_RG_FLOAT32] = _mesa_set_renderbuffer_accessors,
-   [MESA_FORMAT_R_FLOAT32] = _mesa_set_renderbuffer_accessors,
-   [MESA_FORMAT_INTENSITY_FLOAT32] = _mesa_set_renderbuffer_accessors,
-   [MESA_FORMAT_LUMINANCE_FLOAT32] = _mesa_set_renderbuffer_accessors,
+   [MESA_FORMAT_Z16] = _swrast_set_renderbuffer_accessors,
+   [MESA_FORMAT_X8_Z24] = _swrast_set_renderbuffer_accessors,
+   [MESA_FORMAT_S8_Z24] = _swrast_set_renderbuffer_accessors,
+   [MESA_FORMAT_S8] = _swrast_set_renderbuffer_accessors,
+   [MESA_FORMAT_R8] = _swrast_set_renderbuffer_accessors,
+   [MESA_FORMAT_GR88] = _swrast_set_renderbuffer_accessors,
+   [MESA_FORMAT_R16] = _swrast_set_renderbuffer_accessors,
+   [MESA_FORMAT_RG1616] = _swrast_set_renderbuffer_accessors,
+   [MESA_FORMAT_RGBA_FLOAT32] = _swrast_set_renderbuffer_accessors,
+   [MESA_FORMAT_RG_FLOAT32] = _swrast_set_renderbuffer_accessors,
+   [MESA_FORMAT_R_FLOAT32] = _swrast_set_renderbuffer_accessors,
+   [MESA_FORMAT_INTENSITY_FLOAT32] = _swrast_set_renderbuffer_accessors,
+   [MESA_FORMAT_LUMINANCE_FLOAT32] = _swrast_set_renderbuffer_accessors,
 };
 
 bool
index c845280f3601c1f7adbfd0665d923ff102837882..424dfdc1993889e6bc161ae7723b869d400a11e7 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "main/framebuffer.h"
 #include "main/renderbuffer.h"
+#include "swrast/s_renderbuffer.h"
 
 static const __DRIextension *nouveau_screen_extensions[];
 
@@ -200,9 +201,9 @@ nouveau_create_buffer(__DRIscreen *dri_screen,
        }
 
        /* Software renderbuffers. */
-       _mesa_add_soft_renderbuffers(fb, GL_FALSE, GL_FALSE, GL_FALSE,
-                                    visual->accumRedBits > 0,
-                                    GL_FALSE, GL_FALSE);
+       _swrast_add_soft_renderbuffers(fb, GL_FALSE, GL_FALSE, GL_FALSE,
+                                       visual->accumRedBits > 0,
+                                       GL_FALSE, GL_FALSE);
 
        drawable->driverPrivate = fb;
 
index 391b9f8c7bfb258422ab66c42846daad4740474e..2e364d028075d4ae1542a7d8be3570965484a27e 100644 (file)
@@ -42,6 +42,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "main/framebuffer.h"
 #include "main/renderbuffer.h"
 #include "main/fbobject.h"
+#include "swrast/s_renderbuffer.h"
 
 #define STANDALONE_MMIO
 #include "radeon_chipset.h"
@@ -651,7 +652,7 @@ radeonCreateBuffer( __DRIscreen *driScrnPriv,
        depth->has_surface = screen->depthHasSurface;
     }
 
-    _mesa_add_soft_renderbuffers(&rfb->base,
+    _swrast_add_soft_renderbuffers(&rfb->base,
            GL_FALSE, /* color */
            swDepth,
            swStencil,
index ebacf8ec20fe6b37ead6e3139fbc2496684cc66a..e3bdc36f954420a4b1c2bf54b8c2bfd09fafd232 100644 (file)
@@ -44,6 +44,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "main/texformat.h"
 #include "main/renderbuffer.h"
 #include "swrast/swrast.h"
+#include "swrast/s_renderbuffer.h"
 
 #include "radeon_common.h"
 #include "radeon_span.h"
@@ -298,13 +299,13 @@ static void radeonSetSpanFunctions(struct radeon_renderbuffer *rrb)
        } else if (rrb->base.Format == MESA_FORMAT_ARGB1555_REV) {
                radeonInitPointers_ARGB1555_REV(&rrb->base);
        } else if (rrb->base.Format == MESA_FORMAT_Z16) {
-               _mesa_set_renderbuffer_accessors(&rrb->base);
+               _swrast_set_renderbuffer_accessors(&rrb->base);
        } else if (rrb->base.Format == MESA_FORMAT_X8_Z24) {
-               _mesa_set_renderbuffer_accessors(&rrb->base);
+               _swrast_set_renderbuffer_accessors(&rrb->base);
        } else if (rrb->base.Format == MESA_FORMAT_S8_Z24) {
-               _mesa_set_renderbuffer_accessors(&rrb->base);
+               _swrast_set_renderbuffer_accessors(&rrb->base);
        } else if (rrb->base.Format == MESA_FORMAT_S8) {
-               _mesa_set_renderbuffer_accessors(&rrb->base);
+               _swrast_set_renderbuffer_accessors(&rrb->base);
        } else {
                fprintf(stderr, "radeonSetSpanFunctions: bad format: 0x%04X\n", rrb->base.Format);
        }
index 629760441ad58fc2fb46d158b91d2ddc6c75d919..ac82dc7d568c83daa58aebf88320d871ff24a7d6 100644 (file)
@@ -38,6 +38,7 @@
 #include "main/imports.h"
 #include "main/renderbuffer.h"
 #include "swrast/swrast.h"
+#include "swrast/s_renderbuffer.h"
 #include "swrast_setup/swrast_setup.h"
 #include "tnl/tnl.h"
 #include "tnl/t_context.h"
@@ -490,13 +491,13 @@ dri_create_buffer(__DRIscreen * sPriv,
     }
 
     /* add software renderbuffers */
-    _mesa_add_soft_renderbuffers(fb,
-                                GL_FALSE, /* color */
-                                visual->haveDepthBuffer,
-                                visual->haveStencilBuffer,
-                                visual->haveAccumBuffer,
-                                GL_FALSE, /* alpha */
-                                GL_FALSE /* aux bufs */);
+    _swrast_add_soft_renderbuffers(fb,
+                                   GL_FALSE, /* color */
+                                   visual->haveDepthBuffer,
+                                   visual->haveStencilBuffer,
+                                   visual->haveAccumBuffer,
+                                   GL_FALSE, /* alpha */
+                                   GL_FALSE /* aux bufs */);
 
     return GL_TRUE;
 
index be3bc6e707c3f8ab91f2572c05c6aa16c97ac7af..ecb7c63dab476678ad643da1b9b9821069eae25a 100644 (file)
@@ -46,6 +46,7 @@
 #include "swrast_setup/swrast_setup.h"
 #include "swrast/s_context.h"
 #include "swrast/s_lines.h"
+#include "swrast/s_renderbuffer.h"
 #include "swrast/s_triangle.h"
 #include "tnl/tnl.h"
 #include "tnl/t_context.h"
@@ -1160,13 +1161,13 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
       /* Create depth/stencil/accum buffers.  We'll create the color
        * buffer later in OSMesaMakeCurrent().
        */
-      _mesa_add_soft_renderbuffers(osmesa->gl_buffer,
-                                   GL_FALSE, /* color */
-                                   osmesa->gl_visual->haveDepthBuffer,
-                                   osmesa->gl_visual->haveStencilBuffer,
-                                   osmesa->gl_visual->haveAccumBuffer,
-                                   GL_FALSE, /* alpha */
-                                   GL_FALSE /* aux */ );
+      _swrast_add_soft_renderbuffers(osmesa->gl_buffer,
+                                     GL_FALSE, /* color */
+                                     osmesa->gl_visual->haveDepthBuffer,
+                                     osmesa->gl_visual->haveStencilBuffer,
+                                     osmesa->gl_visual->haveAccumBuffer,
+                                     GL_FALSE, /* alpha */
+                                     GL_FALSE /* aux */ );
 
       osmesa->format = format;
       osmesa->userRowLength = 0;
index 14d15ed6c027d0369229e5c603a630e717aa6935..675ffdaaa920d68a87dac6618a222e99c7621d0d 100644 (file)
@@ -16,6 +16,7 @@
 #include "drivers/common/meta.h"
 #include "vbo/vbo.h"
 #include "swrast/swrast.h"
+#include "swrast/s_renderbuffer.h"
 #include "swrast_setup/swrast_setup.h"
 #include "tnl/tnl.h"
 #include "tnl/t_context.h"
@@ -1610,13 +1611,13 @@ void WMesaMakeCurrent(WMesaContext c, HDC hdc)
         wmesa_set_renderbuffer_funcs(rb, pwfb->pixelformat, pwfb->cColorBits, 0);
 
        /* Let Mesa own the Depth, Stencil, and Accum buffers */
-        _mesa_add_soft_renderbuffers(&pwfb->Base,
-                                     GL_FALSE, /* color */
-                                     visual->depthBits > 0,
-                                     visual->stencilBits > 0,
-                                     visual->accumRedBits > 0,
-                                     visual->alphaBits >0, 
-                                     GL_FALSE);
+        _swrast_add_soft_renderbuffers(&pwfb->Base,
+                                       GL_FALSE, /* color */
+                                       visual->depthBits > 0,
+                                       visual->stencilBits > 0,
+                                       visual->accumRedBits > 0,
+                                       visual->alphaBits >0, 
+                                       GL_FALSE);
     }
 
     if (c && pwfb)
index 7d602801ab5947cd330bb0e208af2b00435ab211..81b245937645a353f1c9ae4e58967429ded6f1d8 100644 (file)
@@ -73,6 +73,7 @@
 #include "main/teximage.h"
 #include "glapi/glthread.h"
 #include "swrast/swrast.h"
+#include "swrast/s_renderbuffer.h"
 #include "swrast_setup/swrast_setup.h"
 #include "vbo/vbo.h"
 #include "tnl/tnl.h"
@@ -331,13 +332,13 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type,
    /*
     * Other renderbuffer (depth, stencil, etc)
     */
-   _mesa_add_soft_renderbuffers(&b->mesa_buffer,
-                                GL_FALSE,  /* color */
-                                vis->mesa_visual.haveDepthBuffer,
-                                vis->mesa_visual.haveStencilBuffer,
-                                vis->mesa_visual.haveAccumBuffer,
-                                GL_FALSE,  /* software alpha buffer */
-                                vis->mesa_visual.numAuxBuffers > 0 );
+   _swrast_add_soft_renderbuffers(&b->mesa_buffer,
+                                  GL_FALSE,  /* color */
+                                  vis->mesa_visual.haveDepthBuffer,
+                                  vis->mesa_visual.haveStencilBuffer,
+                                  vis->mesa_visual.haveAccumBuffer,
+                                  GL_FALSE,  /* software alpha buffer */
+                                  vis->mesa_visual.numAuxBuffers > 0 );
 
    /* GLX_EXT_texture_from_pixmap */
    b->TextureTarget = 0;
index 11b7c244ea913178a8f3869b12b3d1181a497b98..84e6fcd795c37bed9ab1dc7d47b915c5207cfda4 100644 (file)
@@ -35,6 +35,7 @@
 #include "main/formats.h"
 #include "main/framebuffer.h"
 #include "main/renderbuffer.h"
+#include "swrast/s_renderbuffer.h"
 
 
 #define XMESA_RENDERBUFFER 0x1234
@@ -481,8 +482,8 @@ xmesa_MapRenderbuffer(struct gl_context *ctx,
    }
 
    /* otherwise, this is an ordinary malloc-based renderbuffer */
-   _mesa_map_soft_renderbuffer(ctx, rb, x, y, w, h, mode,
-                               mapOut, rowStrideOut);
+   _swrast_map_soft_renderbuffer(ctx, rb, x, y, w, h, mode,
+                                 mapOut, rowStrideOut);
 }
 
 
@@ -528,7 +529,7 @@ xmesa_UnmapRenderbuffer(struct gl_context *ctx, struct gl_renderbuffer *rb)
    }
 
    /* otherwise, this is an ordinary malloc-based renderbuffer */
-   _mesa_unmap_soft_renderbuffer(ctx, rb);
+   _swrast_unmap_soft_renderbuffer(ctx, rb);
 }