r300: add support for EXT_framebuffer_blit
authorMaciej Cencora <m.cencora@gmail.com>
Mon, 24 Aug 2009 12:52:33 +0000 (14:52 +0200)
committerMaciej Cencora <m.cencora@gmail.com>
Mon, 24 Aug 2009 12:52:33 +0000 (14:52 +0200)
src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/radeon/radeon_common_context.c
src/mesa/drivers/dri/radeon/radeon_fbo.c

index ca8021df16a0243e317dd6d5ecdc367c48c2b08b..5b5c064aca733b1a33915e44033517095e004c69 100644 (file)
@@ -80,6 +80,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define need_GL_EXT_blend_equation_separate
 #define need_GL_EXT_blend_func_separate
 #define need_GL_EXT_blend_minmax
+#define need_GL_EXT_framebuffer_blit
 #define need_GL_EXT_framebuffer_object
 #define need_GL_EXT_fog_coord
 #define need_GL_EXT_gpu_program_parameters
@@ -143,6 +144,7 @@ const struct dri_extension card_extensions[] = {
 
 
 const struct dri_extension mm_extensions[] = {
+  { "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions },
   { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions },
   { NULL, NULL }
 };
index ef296e491eb5e2669f732d684f14bc91fa9050a8..b76efa8eaa4a7394cecaf69e5989f4ebd39ab9e1 100644 (file)
@@ -37,6 +37,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "utils.h"
 #include "vblank.h"
 #include "drirenderbuffer.h"
+#include "drivers/common/meta.h"
 #include "main/context.h"
 #include "main/framebuffer.h"
 #include "main/renderbuffer.h"
@@ -207,6 +208,9 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
        driContextPriv->driverPrivate = radeon;
 
        meta_init_metaops(ctx, &radeon->meta);
+
+       _mesa_meta_init(ctx);
+
        /* DRI fields */
        radeon->dri.context = driContextPriv;
        radeon->dri.screen = sPriv;
@@ -300,47 +304,48 @@ void radeonDestroyContext(__DRIcontextPrivate *driContextPriv )
        radeonContextPtr radeon = (radeonContextPtr) driContextPriv->driverPrivate;
        radeonContextPtr current = ctx ? RADEON_CONTEXT(ctx) : NULL;
 
+       assert(radeon);
+
+       _mesa_meta_free(radeon->glCtx);
+
        if (radeon == current) {
                radeon_firevertices(radeon);
                _mesa_make_current(NULL, NULL, NULL);
        }
 
-       assert(radeon);
-       if (radeon) {
-               if (!is_empty_list(&radeon->dma.reserved)) {
-                       rcommonFlushCmdBuf( radeon, __FUNCTION__ );
-               }
+       if (!is_empty_list(&radeon->dma.reserved)) {
+               rcommonFlushCmdBuf( radeon, __FUNCTION__ );
+       }
 
-               radeonFreeDmaRegions(radeon);
-               radeonReleaseArrays(radeon->glCtx, ~0);
-               meta_destroy_metaops(&radeon->meta);
-               if (radeon->vtbl.free_context)
-                       radeon->vtbl.free_context(radeon->glCtx);
-               _swsetup_DestroyContext( radeon->glCtx );
-               _tnl_DestroyContext( radeon->glCtx );
-               _vbo_DestroyContext( radeon->glCtx );
-               _swrast_DestroyContext( radeon->glCtx );
-
-               /* free atom list */
-               /* free the Mesa context */
-               _mesa_destroy_context(radeon->glCtx);
-
-               /* _mesa_destroy_context() might result in calls to functions that
-                * depend on the DriverCtx, so don't set it to NULL before.
-                *
-                * radeon->glCtx->DriverCtx = NULL;
-                */
-               /* free the option cache */
-               driDestroyOptionCache(&radeon->optionCache);
-
-               rcommonDestroyCmdBuf(radeon);
-
-               radeon_destroy_atom_list(radeon);
-
-               if (radeon->state.scissor.pClipRects) {
-                       FREE(radeon->state.scissor.pClipRects);
-                       radeon->state.scissor.pClipRects = 0;
-               }
+       radeonFreeDmaRegions(radeon);
+       radeonReleaseArrays(radeon->glCtx, ~0);
+       meta_destroy_metaops(&radeon->meta);
+       if (radeon->vtbl.free_context)
+               radeon->vtbl.free_context(radeon->glCtx);
+       _swsetup_DestroyContext( radeon->glCtx );
+       _tnl_DestroyContext( radeon->glCtx );
+       _vbo_DestroyContext( radeon->glCtx );
+       _swrast_DestroyContext( radeon->glCtx );
+
+       /* free atom list */
+       /* free the Mesa context */
+       _mesa_destroy_context(radeon->glCtx);
+
+       /* _mesa_destroy_context() might result in calls to functions that
+        * depend on the DriverCtx, so don't set it to NULL before.
+        *
+        * radeon->glCtx->DriverCtx = NULL;
+        */
+       /* free the option cache */
+       driDestroyOptionCache(&radeon->optionCache);
+
+       rcommonDestroyCmdBuf(radeon);
+
+       radeon_destroy_atom_list(radeon);
+
+       if (radeon->state.scissor.pClipRects) {
+               FREE(radeon->state.scissor.pClipRects);
+               radeon->state.scissor.pClipRects = 0;
        }
 #ifdef RADEON_BO_TRACK
        track = fopen("/tmp/tracklog", "w");
index 8303917b0b2ab41e41c601846c3f206815baaaf7..3d7c9708e1a9e413a1c5ab52f26ffdfd10bacb11 100644 (file)
@@ -35,6 +35,7 @@
 #include "main/context.h"
 #include "main/texformat.h"
 #include "main/texrender.h"
+#include "drivers/common/meta.h"
 
 #include "radeon_common.h"
 #include "radeon_mipmap_tree.h"
@@ -571,14 +572,6 @@ radeon_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
 {
 }
 
-static void
-radeon_blit_framebuffer(GLcontext *ctx,
-                       GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
-                       GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
-                       GLbitfield mask, GLenum filter)
-{
-}
-
 void radeon_fbo_init(struct radeon_context *radeon)
 {
   radeon->glCtx->Driver.NewFramebuffer = radeon_new_framebuffer;
@@ -589,7 +582,7 @@ void radeon_fbo_init(struct radeon_context *radeon)
   radeon->glCtx->Driver.FinishRenderTexture = radeon_finish_render_texture;
   radeon->glCtx->Driver.ResizeBuffers = radeon_resize_buffers;
   radeon->glCtx->Driver.ValidateFramebuffer = radeon_validate_framebuffer;
-  radeon->glCtx->Driver.BlitFramebuffer = radeon_blit_framebuffer;
+  radeon->glCtx->Driver.BlitFramebuffer = _mesa_meta_blit_framebuffer;
 }