diff options
author | Roland Scheidegger <[email protected]> | 2010-05-21 20:02:22 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2010-05-21 20:02:22 +0200 |
commit | 3293bcdc80cdfa20a2381aae2b94505bdf95d857 (patch) | |
tree | 16ab1ae66010f6d8b1325dbfa9006126a8e95771 /src/gallium/drivers/nvfx/nvfx_surface.c | |
parent | 8504c5d931e47765a15fdaec2df2cb6502a1bd5c (diff) | |
parent | ce65caba846b03b5ef4144e311b85cfd48ab9bbb (diff) |
Merge branch 'gallium-msaa'
Conflicts:
src/mesa/state_tracker/st_gen_mipmap.c
src/mesa/state_tracker/st_texture.c
Diffstat (limited to 'src/gallium/drivers/nvfx/nvfx_surface.c')
-rw-r--r-- | src/gallium/drivers/nvfx/nvfx_surface.c | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_surface.c b/src/gallium/drivers/nvfx/nvfx_surface.c index 2e115650aeb..fc3a670d400 100644 --- a/src/gallium/drivers/nvfx/nvfx_surface.c +++ b/src/gallium/drivers/nvfx/nvfx_surface.c @@ -27,35 +27,54 @@ **************************************************************************/ #include "nvfx_context.h" +#include "nvfx_resource.h" #include "pipe/p_defines.h" #include "util/u_inlines.h" static void nvfx_surface_copy(struct pipe_context *pipe, - struct pipe_surface *dest, unsigned destx, unsigned desty, - struct pipe_surface *src, unsigned srcx, unsigned srcy, + struct pipe_resource *dest, struct pipe_subresource subdst, + unsigned destx, unsigned desty, unsigned destz, + struct pipe_resource *src, struct pipe_subresource subsrc, + unsigned srcx, unsigned srcy, unsigned srcz, unsigned width, unsigned height) { struct nvfx_context *nvfx = nvfx_context(pipe); struct nv04_surface_2d *eng2d = nvfx->screen->eng2d; + struct pipe_surface *ps_dst, *ps_src; - eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height); + ps_src = nvfx_miptree_surface_new(pipe->screen, dest, subsrc.face, + subsrc.level, srcz, 0 /* bind flags */); + ps_dst = nvfx_miptree_surface_new(pipe->screen, dest, subdst.face, + subdst.level, destz, 0 /* bindflags */); + + eng2d->copy(eng2d, ps_dst, destx, desty, ps_src, srcx, srcy, width, height); + + nvfx_miptree_surface_del(ps_src); + nvfx_miptree_surface_del(ps_dst); } static void -nvfx_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest, - unsigned destx, unsigned desty, unsigned width, - unsigned height, unsigned value) +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) { struct nvfx_context *nvfx = nvfx_context(pipe); + struct pipe_surface *ps; struct nv04_surface_2d *eng2d = nvfx->screen->eng2d; - eng2d->fill(eng2d, dest, destx, desty, width, height, value); + 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); + + nvfx_miptree_surface_del(ps); } void nvfx_init_surface_functions(struct nvfx_context *nvfx) { - nvfx->pipe.surface_copy = nvfx_surface_copy; - nvfx->pipe.surface_fill = nvfx_surface_fill; + nvfx->pipe.resource_copy_region = nvfx_surface_copy; + nvfx->pipe.resource_fill_region = nvfx_surface_fill; } |