summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_blit.c57
-rw-r--r--src/gallium/drivers/r300/r300_blit.h16
-rw-r--r--src/gallium/drivers/r300/r300_context.c2
3 files changed, 30 insertions, 45 deletions
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c
index 5489d880b18..97c4d33239b 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -85,12 +85,14 @@ void r300_clear(struct pipe_context* pipe,
}
/* Copy a block of pixels from one surface to another using HW. */
-static void r300_hw_copy(struct pipe_context* pipe,
- struct pipe_surface* dst,
- unsigned dstx, unsigned dsty,
- struct pipe_surface* src,
- unsigned srcx, unsigned srcy,
- unsigned width, unsigned height)
+static void r300_hw_copy_region(struct pipe_context* pipe,
+ struct pipe_resource *dst,
+ struct pipe_subresource subdst,
+ unsigned dstx, unsigned dsty, unsigned dstz,
+ struct pipe_resource *src,
+ struct pipe_subresource subsrc,
+ unsigned srcx, unsigned srcy, unsigned srcz,
+ unsigned width, unsigned height)
{
struct r300_context* r300 = r300_context(pipe);
struct r300_textures_state* state =
@@ -111,30 +113,23 @@ static void r300_hw_copy(struct pipe_context* pipe,
(struct pipe_sampler_view**)state->sampler_views);
/* Do a copy */
- util_blitter_copy(r300->blitter,
- dst, dstx, dsty, src, srcx, srcy, width, height, TRUE);
+ util_blitter_copy_region(r300->blitter, dst, subdst, dstx, dsty, dstz,
+ src, subsrc, srcx, srcy, srcz, width, height,
+ TRUE);
}
/* Copy a block of pixels from one surface to another. */
-void r300_surface_copy(struct pipe_context* pipe,
- struct pipe_resource* dst,
- struct pipe_subresource subdst,
- unsigned dstx, unsigned dsty, unsigned dstz,
- struct pipe_resource* src,
- struct pipe_subresource subsrc,
- unsigned srcx, unsigned srcy, unsigned srcz,
- unsigned width, unsigned height)
+void r300_resource_copy_region(struct pipe_context *pipe,
+ struct pipe_resource *dst,
+ struct pipe_subresource subdst,
+ unsigned dstx, unsigned dsty, unsigned dstz,
+ struct pipe_resource *src,
+ struct pipe_subresource subsrc,
+ unsigned srcx, unsigned srcy, unsigned srcz,
+ unsigned width, unsigned height)
{
- struct pipe_screen *screen = pipe->screen;
enum pipe_format old_format = dst->format;
enum pipe_format new_format = old_format;
- struct pipe_surface *srcsurf, *dstsurf;
- unsigned bind;
-
- if (util_format_is_depth_or_stencil(dst->format))
- bind = PIPE_BIND_DEPTH_STENCIL;
- else
- bind = PIPE_BIND_RENDER_TARGET;
if (dst->format != src->format) {
debug_printf("r300: Implementation error: Format mismatch in %s\n"
@@ -180,18 +175,8 @@ void r300_surface_copy(struct pipe_context* pipe,
src, new_format);
}
- srcsurf = screen->get_tex_surface(screen, src,
- subsrc.face, subsrc.level, srcz,
- PIPE_BIND_SAMPLER_VIEW);
-
- dstsurf = screen->get_tex_surface(screen, dst,
- subdst.face, subdst.level, dstz,
- bind);
-
- r300_hw_copy(pipe, dstsurf, dstx, dsty, srcsurf, srcx, srcy, width, height);
-
- pipe_surface_reference(&srcsurf, NULL);
- pipe_surface_reference(&dstsurf, NULL);
+ r300_hw_copy_region(pipe, dst, subdst, dstx, dsty, dstz,
+ src, subsrc, srcx, srcy, srcz, width, height);
if (old_format != new_format) {
dst->format = old_format;
diff --git a/src/gallium/drivers/r300/r300_blit.h b/src/gallium/drivers/r300/r300_blit.h
index 6dfb4534282..a0d97b4c528 100644
--- a/src/gallium/drivers/r300/r300_blit.h
+++ b/src/gallium/drivers/r300/r300_blit.h
@@ -33,14 +33,14 @@ void r300_clear(struct pipe_context* pipe,
double depth,
unsigned stencil);
-void r300_surface_copy(struct pipe_context* pipe,
- struct pipe_resource* dst,
- struct pipe_subresource subdst,
- unsigned dstx, unsigned dsty, unsigned dstz,
- struct pipe_resource* src,
- struct pipe_subresource subsrc,
- unsigned srcx, unsigned srcy, unsigned srcz,
- unsigned width, unsigned height);
+void r300_resource_copy_region(struct pipe_context *pipe,
+ struct pipe_resource *dst,
+ struct pipe_subresource subdst,
+ unsigned dstx, unsigned dsty, unsigned dstz,
+ struct pipe_resource *src,
+ struct pipe_subresource subsrc,
+ unsigned srcx, unsigned srcy, unsigned srcz,
+ unsigned width, unsigned height);
void r300_resource_fill_region(struct pipe_context* pipe,
struct pipe_resource* dst,
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index 406b812f6ae..44120c753a4 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -186,7 +186,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
r300->context.destroy = r300_destroy_context;
r300->context.clear = r300_clear;
- r300->context.resource_copy_region = r300_surface_copy;
+ r300->context.resource_copy_region = r300_resource_copy_region;
r300->context.resource_fill_region = r300_resource_fill_region;
if (r300screen->caps.has_tcl) {