summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_texture.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-01-27 12:35:33 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-01-27 12:35:33 +1100
commita556034514582dc8e1b8b65f56020031d513331b (patch)
tree182aaf4be24733e2943f9e39cfb86bc22f942efb /src/mesa/state_tracker/st_texture.c
parent9043323f1437f9c6791845b3ddbb9af912b45110 (diff)
parentb717de3238a028a3fdfbaf13eb02dbde262f03e7 (diff)
Merge branch 'upstream-gallium-0.1' into darktama-gallium-0.1
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r--src/mesa/state_tracker/st_texture.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index a2bdf846ca..15cc458be8 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -201,6 +201,29 @@ st_texture_image_unmap(struct st_texture_image *stImage)
+/* Upload data to a rectangular sub-region. Lots of choices how to do this:
+ *
+ * - memcpy by span to current destination
+ * - upload data as new buffer and blit
+ *
+ * Currently always memcpy.
+ */
+static void
+st_surface_data(struct pipe_context *pipe,
+ struct pipe_surface *dst,
+ unsigned dstx, unsigned dsty,
+ const void *src, unsigned src_pitch,
+ unsigned srcx, unsigned srcy, unsigned width, unsigned height)
+{
+ pipe_copy_rect(pipe_surface_map(dst),
+ dst->cpp,
+ dst->pitch,
+ dstx, dsty, width, height, src, src_pitch, srcx, srcy);
+
+ pipe_surface_unmap(dst);
+}
+
+
/* Upload data for a particular image.
*/
void
@@ -225,12 +248,12 @@ st_texture_image_data(struct pipe_context *pipe,
dst_surface = pipe->get_tex_surface(pipe, dst, face, level, i);
- pipe->surface_data(pipe, dst_surface,
- 0, 0, /* dstx, dsty */
- srcUB,
- src_row_pitch,
- 0, 0, /* source x, y */
- dst->width[level], height); /* width, height */
+ st_surface_data(pipe, dst_surface,
+ 0, 0, /* dstx, dsty */
+ srcUB,
+ src_row_pitch,
+ 0, 0, /* source x, y */
+ dst->width[level], height); /* width, height */
pipe_surface_reference(&dst_surface, NULL);