summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r600/r600_cmdbuf.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-07-07 02:12:38 -0400
committerAlex Deucher <alexdeucher@gmail.com>2009-07-07 02:12:38 -0400
commitf74d1c26acaacf688545ecc1ddb996a02e991ccb (patch)
treee247fd470d4ef52d70f3ede27b070af03174d777 /src/mesa/drivers/dri/r600/r600_cmdbuf.c
parent6799bc0b6ba1c1052a247cbae0ef660ad5aba84c (diff)
r6xx/r7xx: add sw blit for tex upload
Can be used for buffer swap as well.
Diffstat (limited to 'src/mesa/drivers/dri/r600/r600_cmdbuf.c')
-rw-r--r--src/mesa/drivers/dri/r600/r600_cmdbuf.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.c b/src/mesa/drivers/dri/r600/r600_cmdbuf.c
index 4609e86bb9..9f26b257d0 100644
--- a/src/mesa/drivers/dri/r600/r600_cmdbuf.c
+++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.c
@@ -645,3 +645,20 @@ void r600InitCmdBuf(context_t *r600) /* from rcommonInitCmdBuf */
}
}
}
+
+void r600_sw_blit(char *srcp, int src_pitch, char *dstp, int dst_pitch,
+ int x, int y, int w, int h, int cpp)
+{
+ char *src = srcp;
+ char *dst = dstp;
+
+ src += (y * src_pitch) + (x * cpp);
+ dst += (y * dst_pitch) + (x * cpp);
+
+ while (h--) {
+ memcpy(dst, src, w * cpp);
+ src += src_pitch;
+ dst += dst_pitch;
+ }
+}
+