GLfloat *colorBuf, *accBuf;
GLint i;
- acc_surf = screen->get_tex_surface(screen, acc_strb->texture, 0, 0, 0,
- (PIPE_BUFFER_USAGE_CPU_WRITE |
- PIPE_BUFFER_USAGE_CPU_READ));
+ acc_trans = screen->get_tex_transfer(screen, acc_strb->texture, 0, 0, 0,
+ PIPE_TRANSFER_READ, xpos, ypos,
+ width, height);
- color_surf = screen->get_tex_surface(screen, color_strb->texture, 0, 0, 0,
- PIPE_BUFFER_USAGE_CPU_READ);
+ color_trans = screen->get_tex_transfer(screen, color_strb->texture, 0, 0, 0,
+ PIPE_TRANSFER_READ, xpos, ypos,
+ width, height);
- colorBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- accBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ colorBuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
+ accBuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
- pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, colorBuf);
- acc_get_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, accBuf);
+ pipe_get_tile_rgba(color_trans, 0, 0, width, height, colorBuf);
+ acc_get_tile_rgba(pipe, acc_trans, 0, 0, width, height, accBuf);
for (i = 0; i < 4 * width * height; i++) {
accBuf[i] = accBuf[i] + colorBuf[i] * value;
}
- acc_put_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, accBuf);
+ screen->tex_transfer_release(screen, &acc_trans);
+ acc_trans = screen->get_tex_transfer(screen, acc_strb->texture, 0, 0, 0,
+ PIPE_TRANSFER_WRITE, xpos, ypos,
+ width, height);
+ acc_put_tile_rgba(pipe, acc_trans, 0, 0, width, height, accBuf);
+
++<<<<<<< HEAD:src/mesa/state_tracker/st_cb_accum.c
+ free(colorBuf);
+ free(accBuf);
+ screen->tex_transfer_release(screen, &acc_trans);
+ screen->tex_transfer_release(screen, &color_trans);
++=======
+ _mesa_free(colorBuf);
+ _mesa_free(accBuf);
+ pipe_surface_reference(&acc_surf, NULL);
+ pipe_surface_reference(&color_surf, NULL);
++>>>>>>> master:src/mesa/state_tracker/st_cb_accum.c
}
GLfloat *buf;
GLint i;
- acc_surf = screen->get_tex_surface(screen, acc_strb->texture, 0, 0, 0,
- PIPE_BUFFER_USAGE_CPU_WRITE);
+ acc_trans = screen->get_tex_transfer(screen, acc_strb->texture, 0, 0, 0,
+ PIPE_TRANSFER_WRITE, xpos, ypos,
+ width, height);
- color_surf = screen->get_tex_surface(screen, color_strb->texture, 0, 0, 0,
- PIPE_BUFFER_USAGE_CPU_READ);
+ color_trans = screen->get_tex_transfer(screen, color_strb->texture, 0, 0, 0,
+ PIPE_TRANSFER_READ, xpos, ypos,
+ width, height);
- buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
- pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, buf);
+ pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf);
for (i = 0; i < 4 * width * height; i++) {
buf[i] = buf[i] * value;
}
- acc_put_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, buf);
+ acc_put_tile_rgba(pipe, acc_trans, 0, 0, width, height, buf);
++<<<<<<< HEAD:src/mesa/state_tracker/st_cb_accum.c
+ free(buf);
+ screen->tex_transfer_release(screen, &acc_trans);
+ screen->tex_transfer_release(screen, &color_trans);
++=======
+ _mesa_free(buf);
+ pipe_surface_reference(&acc_surf, NULL);
+ pipe_surface_reference(&color_surf, NULL);
++>>>>>>> master:src/mesa/state_tracker/st_cb_accum.c
}
GLfloat *abuf, *cbuf = NULL;
GLint i, ch;
- abuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ abuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
- acc_surf = screen->get_tex_surface(screen, acc_strb->texture, 0, 0, 0,
- PIPE_BUFFER_USAGE_CPU_READ);
+ acc_trans = screen->get_tex_transfer(screen, acc_strb->texture, 0, 0, 0,
+ PIPE_TRANSFER_READ, xpos, ypos,
+ width, height);
- color_surf = screen->get_tex_surface(screen, color_strb->texture, 0, 0, 0,
- (PIPE_BUFFER_USAGE_CPU_READ |
- PIPE_BUFFER_USAGE_CPU_WRITE));
+ color_trans = screen->get_tex_transfer(screen, color_strb->texture, 0, 0, 0,
+ PIPE_TRANSFER_READ_WRITE, xpos, ypos,
+ width, height);
- acc_get_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, abuf);
+ acc_get_tile_rgba(pipe, acc_trans, 0, 0, width, height, abuf);
if (!colormask[0] || !colormask[1] || !colormask[2] || !colormask[3]) {
++<<<<<<< HEAD:src/mesa/state_tracker/st_cb_accum.c
+ cbuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ pipe_get_tile_rgba(color_trans, 0, 0, width, height, cbuf);
++=======
+ cbuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
+ pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, cbuf);
++>>>>>>> master:src/mesa/state_tracker/st_cb_accum.c
}
for (i = 0; i < width * height; i++) {
}
}
- pipe_put_tile_rgba(color_surf, xpos, ypos, width, height, abuf);
+ pipe_put_tile_rgba(color_trans, 0, 0, width, height, abuf);
- free(abuf);
+ _mesa_free(abuf);
if (cbuf)
++<<<<<<< HEAD:src/mesa/state_tracker/st_cb_accum.c
+ free(cbuf);
+ screen->tex_transfer_release(screen, &acc_trans);
+ screen->tex_transfer_release(screen, &color_trans);
++=======
+ _mesa_free(cbuf);
+ pipe_surface_reference(&acc_surf, NULL);
+ pipe_surface_reference(&color_surf, NULL);
++>>>>>>> master:src/mesa/state_tracker/st_cb_accum.c
}
}
}
- free(buffer);
+ _mesa_free(buffer);
/* unmap the stencil buffer */
- screen->surface_unmap(screen, psDraw);
- pipe_surface_reference(&psDraw, NULL);
+ screen->transfer_unmap(screen, ptDraw);
+ screen->tex_transfer_release(screen, &ptDraw);
}
if (type == GL_COLOR) {
/* alternate path using get/put_tile() */
- GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ GLfloat *buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
- pipe_get_tile_rgba(psRead, srcx, srcy, width, height, buf);
- pipe_put_tile_rgba(psTex, 0, 0, width, height, buf);
+ pipe_get_tile_rgba(ptRead, 0, 0, width, height, buf);
+ pipe_put_tile_rgba(ptTex, 0, 0, width, height, buf);
- free(buf);
+ _mesa_free(buf);
}
else {
/* GL_DEPTH */
- GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint));
+ GLuint *buf = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint));
- pipe_get_tile_z(psRead, srcx, srcy, width, height, buf);
- pipe_put_tile_z(psTex, 0, 0, width, height, buf);
+ pipe_get_tile_z(ptRead, 0, 0, width, height, buf);
+ pipe_put_tile_z(ptTex, 0, 0, width, height, buf);
- free(buf);
+ _mesa_free(buf);
}
- pipe_surface_reference(&psRead, NULL);
- }
- pipe_surface_reference(&psTex, NULL);
+ screen->tex_transfer_release(screen, &ptRead);
+ screen->tex_transfer_release(screen, &ptTex);
+ }
/* draw textured quad */
draw_textured_quad(ctx, dstx, dsty, ctx->Current.RasterPos[2],