summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvfx/nvfx_surface.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2010-06-03 17:46:14 +0200
committerRoland Scheidegger <[email protected]>2010-06-03 17:46:14 +0200
commit992382762a74fd834926fd2c3cd9e14a186e2dd5 (patch)
treec4572bb01331b71931b3570b36a7acfc38f79a68 /src/gallium/drivers/nvfx/nvfx_surface.c
parent05863c487756c1c9dc823cf639f77cad4111bd23 (diff)
parenta6e5c6c000df8655de3b41d5809547bb41c88c23 (diff)
Merge branch 'gallium-newclear'
Conflicts: src/gallium/state_trackers/python/p_context.i
Diffstat (limited to 'src/gallium/drivers/nvfx/nvfx_surface.c')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_surface.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_surface.c b/src/gallium/drivers/nvfx/nvfx_surface.c
index fc3a670d400..44e1af2e6a2 100644
--- a/src/gallium/drivers/nvfx/nvfx_surface.c
+++ b/src/gallium/drivers/nvfx/nvfx_surface.c
@@ -30,6 +30,7 @@
#include "nvfx_resource.h"
#include "pipe/p_defines.h"
#include "util/u_inlines.h"
+#include "util/u_pack_color.h"
static void
nvfx_surface_copy(struct pipe_context *pipe,
@@ -55,26 +56,41 @@ nvfx_surface_copy(struct pipe_context *pipe,
}
static void
-nvfx_surface_fill(struct pipe_context *pipe, struct pipe_resource *dest,
- struct pipe_subresource subdst,
- unsigned destx, unsigned desty, unsigned destz,
- unsigned width, unsigned height, unsigned value)
+nvfx_clear_render_target(struct pipe_context *pipe,
+ struct pipe_surface *dst,
+ const float *rgba,
+ unsigned dstx, unsigned dsty,
+ unsigned width, unsigned height)
{
struct nvfx_context *nvfx = nvfx_context(pipe);
- struct pipe_surface *ps;
struct nv04_surface_2d *eng2d = nvfx->screen->eng2d;
+ union util_color uc;
+ util_pack_color(rgba, dst->format, &uc);
+
+ eng2d->fill(eng2d, dst, dstx, dsty, width, height, uc.ui);
+}
- ps = nvfx_miptree_surface_new(pipe->screen, dest, subdst.face,
- subdst.level, destz, 0 /* bind flags */);
-
- eng2d->fill(eng2d, ps, destx, desty, width, height, value);
+static void
+nvfx_clear_depth_stencil(struct pipe_context *pipe,
+ struct pipe_surface *dst,
+ unsigned clear_flags,
+ double depth,
+ unsigned stencil,
+ unsigned dstx, unsigned dsty,
+ unsigned width, unsigned height)
+{
+ struct nvfx_context *nvfx = nvfx_context(pipe);
+ struct nv04_surface_2d *eng2d = nvfx->screen->eng2d;
- nvfx_miptree_surface_del(ps);
+ eng2d->fill(eng2d, dst, dstx, dsty, width, height,
+ util_pack_z_stencil(dst->format, depth, stencil));
}
+
void
nvfx_init_surface_functions(struct nvfx_context *nvfx)
{
nvfx->pipe.resource_copy_region = nvfx_surface_copy;
- nvfx->pipe.resource_fill_region = nvfx_surface_fill;
+ nvfx->pipe.clear_render_target = nvfx_clear_render_target;
+ nvfx->pipe.clear_depth_stencil = nvfx_clear_depth_stencil;
}