Mesa (master): mesa: move texrender.c to swrast

Brian Paul brianp at kemper.freedesktop.org
Mon Jun 13 12:46:24 PDT 2011


Module: Mesa
Branch: master
Commit: 755f2e2ae597df9208523b0996bbdabf3db463b0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=755f2e2ae597df9208523b0996bbdabf3db463b0

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Jun 13 13:44:35 2011 -0600

mesa: move texrender.c to swrast

This stuff is really for software rendering, it's not core Mesa.
A small step toward pushing the FetchTexel() stuff down into swrast.

Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/SConscript                                |    2 +-
 src/mesa/drivers/common/driverfuncs.c              |    5 +--
 src/mesa/drivers/dri/intel/intel_fbo.c             |    8 +++---
 src/mesa/drivers/dri/radeon/radeon_fbo.c           |    8 +++---
 src/mesa/main/texrender.h                          |   18 -------------
 src/mesa/sources.mak                               |    2 +-
 .../{main/texrender.c => swrast/s_texrender.c}     |   26 ++++++++++----------
 src/mesa/swrast/swrast.h                           |   10 +++++++
 8 files changed, 35 insertions(+), 44 deletions(-)

diff --git a/src/mesa/SConscript b/src/mesa/SConscript
index fdb4d5a..24e2155 100644
--- a/src/mesa/SConscript
+++ b/src/mesa/SConscript
@@ -121,7 +121,6 @@ main_sources = [
     'main/texobj.c',
     'main/texpal.c',
     'main/texparam.c',
-    'main/texrender.c',
     'main/texstate.c',
     'main/texstore.c',
     'main/texturebarrier.c',
@@ -174,6 +173,7 @@ swrast_sources = [
     'swrast/s_stencil.c',
     'swrast/s_texcombine.c',
     'swrast/s_texfilter.c',
+    'swrast/s_texrender.c',
     'swrast/s_triangle.c',
     'swrast/s_zoom.c',
 ]
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index 0dbc7c3..8ab129d 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -40,7 +40,6 @@
 #include "main/texstore.h"
 #include "main/bufferobj.h"
 #include "main/fbobject.h"
-#include "main/texrender.h"
 #include "main/samplerobj.h"
 #include "main/syncobj.h"
 #include "main/texturebarrier.h"
@@ -183,8 +182,8 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
 
    driver->NewFramebuffer = _mesa_new_framebuffer;
    driver->NewRenderbuffer = _mesa_new_soft_renderbuffer;
-   driver->RenderTexture = _mesa_render_texture;
-   driver->FinishRenderTexture = _mesa_finish_render_texture;
+   driver->RenderTexture = _swrast_render_texture;
+   driver->FinishRenderTexture = _swrast_finish_render_texture;
    driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer;
    driver->ValidateFramebuffer = _mesa_validate_framebuffer;
 
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 83f622d..8277477 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -35,7 +35,7 @@
 #include "main/renderbuffer.h"
 #include "main/context.h"
 #include "main/teximage.h"
-#include "main/texrender.h"
+#include "swrast/s_texrender.h"
 #include "drivers/common/meta.h"
 
 #include "intel_context.h"
@@ -557,7 +557,7 @@ intel_render_texture(struct gl_context * ctx,
        * (has a border, width/height 0, etc.)
        */
       _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
-      _mesa_render_texture(ctx, fb, att);
+      _swrast_render_texture(ctx, fb, att);
       return;
    }
    else if (!irb) {
@@ -568,14 +568,14 @@ intel_render_texture(struct gl_context * ctx,
       }
       else {
          /* fallback to software rendering */
-         _mesa_render_texture(ctx, fb, att);
+         _swrast_render_texture(ctx, fb, att);
          return;
       }
    }
 
    if (!intel_update_wrapper(ctx, irb, newImage)) {
        _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
-       _mesa_render_texture(ctx, fb, att);
+       _swrast_render_texture(ctx, fb, att);
        return;
    }
 
diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index d3c9257..0986ade 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -35,7 +35,7 @@
 #include "main/framebuffer.h"
 #include "main/renderbuffer.h"
 #include "main/context.h"
-#include "main/texrender.h"
+#include "swrast/s_texrender.h"
 #include "drivers/common/meta.h"
 
 #include "radeon_common.h"
@@ -557,7 +557,7 @@ radeon_render_texture(struct gl_context * ctx,
       /* Fallback on drawing to a texture without a miptree.
        */
       _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
-      _mesa_render_texture(ctx, fb, att);
+      _swrast_render_texture(ctx, fb, att);
       return;
    }
    else if (!rrb) {
@@ -568,14 +568,14 @@ radeon_render_texture(struct gl_context * ctx,
       }
       else {
          /* fallback to software rendering */
-         _mesa_render_texture(ctx, fb, att);
+         _swrast_render_texture(ctx, fb, att);
          return;
       }
    }
 
    if (!radeon_update_wrapper(ctx, rrb, newImage)) {
        _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
-       _mesa_render_texture(ctx, fb, att);
+       _swrast_render_texture(ctx, fb, att);
        return;
    }
 
diff --git a/src/mesa/main/texrender.h b/src/mesa/main/texrender.h
deleted file mode 100644
index cacd091..0000000
--- a/src/mesa/main/texrender.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef TEXRENDER_H
-#define TEXRENDER_H
-
-struct gl_context;
-struct gl_framebuffer;
-struct gl_renderbuffer_attachment;
-
-extern void
-_mesa_render_texture(struct gl_context *ctx,
-                     struct gl_framebuffer *fb,
-                     struct gl_renderbuffer_attachment *att);
-
-extern void
-_mesa_finish_render_texture(struct gl_context *ctx,
-                            struct gl_renderbuffer_attachment *att);
-
-
-#endif /* TEXRENDER_H */
diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak
index 9b2cb1a..4b2ec08 100644
--- a/src/mesa/sources.mak
+++ b/src/mesa/sources.mak
@@ -92,7 +92,6 @@ MAIN_SOURCES = \
 	main/texobj.c \
 	main/texpal.c \
 	main/texparam.c \
-	main/texrender.c \
 	main/texstate.c \
 	main/texstore.c \
 	main/texturebarrier.c \
@@ -145,6 +144,7 @@ SWRAST_SOURCES = \
 	swrast/s_stencil.c \
 	swrast/s_texcombine.c \
 	swrast/s_texfilter.c \
+	swrast/s_texrender.c \
 	swrast/s_triangle.c \
 	swrast/s_zoom.c
 
diff --git a/src/mesa/main/texrender.c b/src/mesa/swrast/s_texrender.c
similarity index 97%
rename from src/mesa/main/texrender.c
rename to src/mesa/swrast/s_texrender.c
index a7641a5..52d03c9 100644
--- a/src/mesa/main/texrender.c
+++ b/src/mesa/swrast/s_texrender.c
@@ -1,12 +1,12 @@
 
-#include "context.h"
-#include "colormac.h"
-#include "fbobject.h"
-#include "macros.h"
-#include "texfetch.h"
-#include "teximage.h"
-#include "texrender.h"
-#include "renderbuffer.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/fbobject.h"
+#include "main/macros.h"
+#include "main/texfetch.h"
+#include "main/teximage.h"
+#include "main/renderbuffer.h"
+#include "swrast/swrast.h"
 
 
 /*
@@ -628,9 +628,9 @@ update_wrapper(struct gl_context *ctx, struct gl_renderbuffer_attachment *att)
  * \sa _mesa_framebuffer_renderbuffer
  */
 void
-_mesa_render_texture(struct gl_context *ctx,
-                     struct gl_framebuffer *fb,
-                     struct gl_renderbuffer_attachment *att)
+_swrast_render_texture(struct gl_context *ctx,
+                       struct gl_framebuffer *fb,
+                       struct gl_renderbuffer_attachment *att)
 {
    (void) fb;
 
@@ -642,8 +642,8 @@ _mesa_render_texture(struct gl_context *ctx,
 
 
 void
-_mesa_finish_render_texture(struct gl_context *ctx,
-                            struct gl_renderbuffer_attachment *att)
+_swrast_finish_render_texture(struct gl_context *ctx,
+                              struct gl_renderbuffer_attachment *att)
 {
    /* do nothing */
    /* The renderbuffer texture wrapper will get deleted by the
diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h
index 9b88c70..27b74c3 100644
--- a/src/mesa/swrast/swrast.h
+++ b/src/mesa/swrast/swrast.h
@@ -206,6 +206,16 @@ extern void
 _swrast_eject_texture_images(struct gl_context *ctx);
 
 
+extern void
+_swrast_render_texture(struct gl_context *ctx,
+                       struct gl_framebuffer *fb,
+                       struct gl_renderbuffer_attachment *att);
+
+extern void
+_swrast_finish_render_texture(struct gl_context *ctx,
+                              struct gl_renderbuffer_attachment *att);
+
+
 
 /**
  * The driver interface for the software rasterizer.



More information about the mesa-commit mailing list