diff options
author | Roland Scheidegger <sroland@vmware.com> | 2010-06-03 17:46:14 +0200 |
---|---|---|
committer | Roland Scheidegger <sroland@vmware.com> | 2010-06-03 17:46:14 +0200 |
commit | 992382762a74fd834926fd2c3cd9e14a186e2dd5 (patch) | |
tree | c4572bb01331b71931b3570b36a7acfc38f79a68 /src/gallium/drivers/nv50/nv50_surface.c | |
parent | 05863c487756c1c9dc823cf639f77cad4111bd23 (diff) | |
parent | a6e5c6c000df8655de3b41d5809547bb41c88c23 (diff) |
Merge branch 'gallium-newclear'
Conflicts:
src/gallium/state_trackers/python/p_context.i
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_surface.c')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_surface.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index 40b8d25533..5535610e0a 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -27,6 +27,7 @@ #include "nv50_resource.h" #include "pipe/p_defines.h" #include "util/u_inlines.h" +#include "util/u_pack_color.h" #include "util/u_tile.h" #include "util/u_format.h" @@ -221,50 +222,49 @@ nv50_surface_copy(struct pipe_context *pipe, nv50_miptree_surface_del(ps_dst); } +/* XXX this should probably look more along the lines of nv50_clear */ static void -nv50_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) +nv50_clear_render_target(struct pipe_context *pipe, + struct pipe_surface *dst, + const float *rgba, + unsigned dstx, unsigned dsty, + unsigned width, unsigned height) { struct nv50_context *nv50 = nv50_context(pipe); - struct pipe_surface *ps; struct nv50_screen *screen = nv50->screen; struct nouveau_channel *chan = screen->eng2d->channel; struct nouveau_grobj *eng2d = screen->eng2d; int format, ret; + union util_color uc; + util_pack_color(rgba, dst->format, &uc); - format = nv50_format(dest->format); + format = nv50_format(dst->format); if (format < 0) return; - ps = nv50_miptree_surface_new(pipe->screen, dest, subdst.face, - subdst.level, destz, 0 /* bind flags */); - WAIT_RING (chan, 32); - ret = nv50_surface_set(screen, ps, 1); + ret = nv50_surface_set(screen, dst, 1); if (ret) return; BEGIN_RING(chan, eng2d, NV50_2D_DRAW_SHAPE, 3); OUT_RING (chan, NV50_2D_DRAW_SHAPE_RECTANGLES); OUT_RING (chan, format); - OUT_RING (chan, value); + OUT_RING (chan, uc.ui); BEGIN_RING(chan, eng2d, NV50_2D_DRAW_POINT32_X(0), 4); - OUT_RING (chan, destx); - OUT_RING (chan, desty); + OUT_RING (chan, dstx); + OUT_RING (chan, dsty); OUT_RING (chan, width); OUT_RING (chan, height); - nv50_miptree_surface_del(ps); } void nv50_init_surface_functions(struct nv50_context *nv50) { nv50->pipe.resource_copy_region = nv50_surface_copy; - nv50->pipe.resource_fill_region = nv50_surface_fill; + nv50->pipe.clear_render_target = nv50_clear_render_target; } |