summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-08-07 13:32:11 -0600
committerBrian Paul <[email protected]>2008-08-07 13:32:43 -0600
commit275b09f2569c8bea5dcca1643c93aa6a43d7e2a2 (patch)
tree5bd9b687f0e2acf051ffe65ddc343f2e0750345c /src/mesa/state_tracker
parentae2195caf56d2eb782475254c68858a25ee7c857 (diff)
gallium: fix a few bugs on the fallback CopyTex[Sub]Image() path.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 1f94a0b9ef0..d8d2d2aaeac 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1073,9 +1073,9 @@ fallback_copy_texsubimage(GLcontext *ctx,
st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
- /* determine bottom-to-top vs. top-to-bottom order */
+ /* determine bottom-to-top vs. top-to-bottom order for src renderbuffer */
if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
- destY = height - 1 - destY;
+ srcY = strb->Base.Height - 1 - srcY;
yStep = -1;
}
else {
@@ -1083,9 +1083,6 @@ fallback_copy_texsubimage(GLcontext *ctx,
}
src_surf = strb->surface;
- src_surf = screen->get_tex_surface(screen, strb->texture, face, level, destZ,
- PIPE_BUFFER_USAGE_CPU_READ);
-
dest_surf = screen->get_tex_surface(screen, pt, face, level, destZ,
PIPE_BUFFER_USAGE_CPU_WRITE);
@@ -1098,7 +1095,7 @@ fallback_copy_texsubimage(GLcontext *ctx,
const GLboolean scaleOrBias = (ctx->Pixel.DepthScale != 1.0F ||
ctx->Pixel.DepthBias != 0.0F);
- for (row = 0; row < height; row++, srcY++, destY += yStep) {
+ for (row = 0; row < height; row++, srcY += yStep, destY++) {
uint data[MAX_WIDTH];
pipe_get_tile_z(src_surf, srcX, srcY, width, 1, data);
if (scaleOrBias) {
@@ -1109,7 +1106,7 @@ fallback_copy_texsubimage(GLcontext *ctx,
}
else {
/* RGBA format */
- for (row = 0; row < height; row++, srcY++, destY += yStep) {
+ for (row = 0; row < height; row++, srcY += yStep, destY++) {
float data[4 * MAX_WIDTH];
pipe_get_tile_rgba(src_surf, srcX, srcY, width, 1, data);
/* XXX we're ignoring convolution for now */
@@ -1123,7 +1120,6 @@ fallback_copy_texsubimage(GLcontext *ctx,
}
screen->tex_surface_release(screen, &dest_surf);
- screen->tex_surface_release(screen, &src_surf);
}