From 755f2e2ae597df9208523b0996bbdabf3db463b0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 13 Jun 2011 13:44:35 -0600 Subject: [PATCH] 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 --- 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 +- .../texrender.c => swrast/s_texrender.c} | 26 +++++++++---------- src/mesa/swrast/swrast.h | 10 +++++++ 8 files changed, 35 insertions(+), 44 deletions(-) delete mode 100644 src/mesa/main/texrender.h rename src/mesa/{main/texrender.c => swrast/s_texrender.c} (97%) diff --git a/src/mesa/SConscript b/src/mesa/SConscript index fdb4d5a5814..24e2155c387 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 0dbc7c3e853..8ab129dd73d 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 83f622d437e..8277477c82c 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 d3c9257fb66..0986adec57e 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 cacd091160e..00000000000 --- 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 9b2cb1a3c14..4b2ec08bbb0 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 a7641a5f9a4..52d03c92ac7 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 9b88c70220e..27b74c32486 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. -- 2.30.2