From c5c7b69bda3fb49fd88b846feb6e65289a04488a Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Sat, 20 Feb 2010 20:04:54 +0100 Subject: nv30, nv40: unify identical nv[34]0_clear.c --- src/gallium/drivers/nv30/Makefile | 1 - src/gallium/drivers/nv30/nv30_clear.c | 14 -------------- src/gallium/drivers/nv30/nv30_context.c | 2 +- src/gallium/drivers/nv30/nv30_context.h | 4 ---- src/gallium/drivers/nv40/Makefile | 1 - src/gallium/drivers/nv40/nv40_clear.c | 14 -------------- src/gallium/drivers/nv40/nv40_context.c | 2 +- src/gallium/drivers/nv40/nv40_context.h | 4 ---- src/gallium/drivers/nvfx/Makefile | 6 ++---- src/gallium/drivers/nvfx/nvfx_clear.c | 14 ++++++++++++++ src/gallium/drivers/nvfx/nvfx_context.h | 4 ++++ 11 files changed, 22 insertions(+), 44 deletions(-) delete mode 100644 src/gallium/drivers/nv30/nv30_clear.c delete mode 100644 src/gallium/drivers/nv40/nv40_clear.c create mode 100644 src/gallium/drivers/nvfx/nvfx_clear.c (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/nv30/Makefile b/src/gallium/drivers/nv30/Makefile index ed02075d13..27f19da75c 100644 --- a/src/gallium/drivers/nv30/Makefile +++ b/src/gallium/drivers/nv30/Makefile @@ -4,7 +4,6 @@ include $(TOP)/configs/current LIBNAME = nv30 C_SOURCES = \ - nv30_clear.c \ nv30_context.c \ nv30_draw.c \ nv30_fragprog.c \ diff --git a/src/gallium/drivers/nv30/nv30_clear.c b/src/gallium/drivers/nv30/nv30_clear.c deleted file mode 100644 index e7ba73de7c..0000000000 --- a/src/gallium/drivers/nv30/nv30_clear.c +++ /dev/null @@ -1,14 +0,0 @@ -#include "pipe/p_context.h" -#include "pipe/p_defines.h" -#include "pipe/p_state.h" -#include "util/u_clear.h" - -#include "nv30_context.h" - -void -nv30_clear(struct pipe_context *pipe, unsigned buffers, - const float *rgba, double depth, unsigned stencil) -{ - util_clear(pipe, &nvfx_context(pipe)->framebuffer, buffers, rgba, depth, - stencil); -} diff --git a/src/gallium/drivers/nv30/nv30_context.c b/src/gallium/drivers/nv30/nv30_context.c index afed8bb952..74be578705 100644 --- a/src/gallium/drivers/nv30/nv30_context.c +++ b/src/gallium/drivers/nv30/nv30_context.c @@ -62,7 +62,7 @@ nv30_create(struct pipe_screen *pscreen, void *priv) nvfx->pipe.destroy = nv30_destroy; nvfx->pipe.draw_arrays = nv30_draw_arrays; nvfx->pipe.draw_elements = nv30_draw_elements; - nvfx->pipe.clear = nv30_clear; + nvfx->pipe.clear = nvfx_clear; nvfx->pipe.flush = nv30_flush; nvfx->pipe.is_texture_referenced = nouveau_is_texture_referenced; diff --git a/src/gallium/drivers/nv30/nv30_context.h b/src/gallium/drivers/nv30/nv30_context.h index 2fc148cded..8032bcd979 100644 --- a/src/gallium/drivers/nv30/nv30_context.h +++ b/src/gallium/drivers/nv30/nv30_context.h @@ -51,10 +51,6 @@ extern void nv30_draw_elements(struct pipe_context *pipe, unsigned mode, unsigned start, unsigned count); -/* nv30_clear.c */ -extern void nv30_clear(struct pipe_context *pipe, unsigned buffers, - const float *rgba, double depth, unsigned stencil); - /* nvfx_context.c */ struct pipe_context * nv30_create(struct pipe_screen *pscreen, void *priv); diff --git a/src/gallium/drivers/nv40/Makefile b/src/gallium/drivers/nv40/Makefile index 50e5e72b4e..031c943de5 100644 --- a/src/gallium/drivers/nv40/Makefile +++ b/src/gallium/drivers/nv40/Makefile @@ -4,7 +4,6 @@ include $(TOP)/configs/current LIBNAME = nv40 C_SOURCES = \ - nv40_clear.c \ nv40_context.c \ nv40_draw.c \ nv40_fragprog.c \ diff --git a/src/gallium/drivers/nv40/nv40_clear.c b/src/gallium/drivers/nv40/nv40_clear.c deleted file mode 100644 index 79de90434d..0000000000 --- a/src/gallium/drivers/nv40/nv40_clear.c +++ /dev/null @@ -1,14 +0,0 @@ -#include "pipe/p_context.h" -#include "pipe/p_defines.h" -#include "pipe/p_state.h" -#include "util/u_clear.h" - -#include "nv40_context.h" - -void -nv40_clear(struct pipe_context *pipe, unsigned buffers, - const float *rgba, double depth, unsigned stencil) -{ - util_clear(pipe, &nvfx_context(pipe)->framebuffer, buffers, rgba, depth, - stencil); -} diff --git a/src/gallium/drivers/nv40/nv40_context.c b/src/gallium/drivers/nv40/nv40_context.c index 6cc3a339e6..cb249dd5d7 100644 --- a/src/gallium/drivers/nv40/nv40_context.c +++ b/src/gallium/drivers/nv40/nv40_context.c @@ -62,7 +62,7 @@ nv40_create(struct pipe_screen *pscreen, void *priv) nvfx->pipe.destroy = nv40_destroy; nvfx->pipe.draw_arrays = nv40_draw_arrays; nvfx->pipe.draw_elements = nv40_draw_elements; - nvfx->pipe.clear = nv40_clear; + nvfx->pipe.clear = nvfx_clear; nvfx->pipe.flush = nv40_flush; nvfx->pipe.is_texture_referenced = nouveau_is_texture_referenced; diff --git a/src/gallium/drivers/nv40/nv40_context.h b/src/gallium/drivers/nv40/nv40_context.h index 7227c4a438..f9c0a9eb29 100644 --- a/src/gallium/drivers/nv40/nv40_context.h +++ b/src/gallium/drivers/nv40/nv40_context.h @@ -57,10 +57,6 @@ extern void nv40_draw_elements(struct pipe_context *pipe, unsigned mode, unsigned start, unsigned count); -/* nv40_clear.c */ -extern void nv40_clear(struct pipe_context *pipe, unsigned buffers, - const float *rgba, double depth, unsigned stencil); - /* nvfx_context.c */ struct pipe_context * nv40_create(struct pipe_screen *pscreen, void *priv); diff --git a/src/gallium/drivers/nvfx/Makefile b/src/gallium/drivers/nvfx/Makefile index 05cdda0cc0..6959efa390 100644 --- a/src/gallium/drivers/nvfx/Makefile +++ b/src/gallium/drivers/nvfx/Makefile @@ -3,9 +3,7 @@ include $(TOP)/configs/current LIBNAME = nvfx -nvfx_dummy.c: - touch nvfx_dummy.c - -C_SOURCES = nvfx_dummy.c +C_SOURCES = \ + nvfx_clear.c include ../../Makefile.template diff --git a/src/gallium/drivers/nvfx/nvfx_clear.c b/src/gallium/drivers/nvfx/nvfx_clear.c new file mode 100644 index 0000000000..2be70fcee4 --- /dev/null +++ b/src/gallium/drivers/nvfx/nvfx_clear.c @@ -0,0 +1,14 @@ +#include "pipe/p_context.h" +#include "pipe/p_defines.h" +#include "pipe/p_state.h" +#include "util/u_clear.h" + +#include "nvfx_context.h" + +void +nvfx_clear(struct pipe_context *pipe, unsigned buffers, + const float *rgba, double depth, unsigned stencil) +{ + util_clear(pipe, &nvfx_context(pipe)->framebuffer, buffers, rgba, depth, + stencil); +} diff --git a/src/gallium/drivers/nvfx/nvfx_context.h b/src/gallium/drivers/nvfx/nvfx_context.h index 87bad54e63..0aaa4964e2 100644 --- a/src/gallium/drivers/nvfx/nvfx_context.h +++ b/src/gallium/drivers/nvfx/nvfx_context.h @@ -181,4 +181,8 @@ struct nvfx_state_entry { } dirty; }; +/* nvfx_clear.c */ +extern void nvfx_clear(struct pipe_context *pipe, unsigned buffers, + const float *rgba, double depth, unsigned stencil); + #endif -- cgit v1.2.3