struct pipe_transfer *transfer = (struct pipe_transfer*)rtransfer;
struct pipe_resource *texture = transfer->resource;
- ctx->resource_copy_region(ctx, rtransfer->staging_texture,
+ ctx->resource_copy_region(ctx, &rtransfer->staging->b.b.b,
0, 0, 0, 0, texture, transfer->level,
&transfer->box);
}
sbox.depth = 1;
ctx->resource_copy_region(ctx, texture, transfer->level,
transfer->box.x, transfer->box.y, transfer->box.z,
- rtransfer->staging_texture,
+ &rtransfer->staging->b.b.b,
0, &sbox);
}
r600_texture_get_transfer, /* get_transfer */
r600_texture_transfer_destroy, /* transfer_destroy */
r600_texture_transfer_map, /* transfer_map */
- u_default_transfer_flush_region,/* transfer_flush_region */
+ NULL, /* transfer_flush_region */
r600_texture_transfer_unmap, /* transfer_unmap */
- u_default_transfer_inline_write /* transfer_inline_write */
+ NULL /* transfer_inline_write */
};
-DEBUG_GET_ONCE_BOOL_OPTION(use_surface, "R600_SURF", TRUE);
-
static struct r600_resource_texture *
r600_texture_create_object(struct pipe_screen *screen,
const struct pipe_resource *base,
struct r600_screen *rscreen = (struct r600_screen*)screen;
int r;
- /* FIXME ugly temporary hack to allow to switch btw current code
- * and common surface allocator code
- */
- if (debug_get_option_use_surface()) {
- rscreen->use_surface = 1;
- }
-
rtex = CALLOC_STRUCT(r600_resource_texture);
if (rtex == NULL)
return NULL;
if (!(base->flags & R600_RESOURCE_FLAG_TRANSFER) &&
((struct r600_screen*)screen)->chip_class >= EVERGREEN &&
util_format_is_depth_and_stencil(base->format) &&
- !rscreen->use_surface) {
+ !rscreen->use_surface_alloc) {
struct pipe_resource stencil;
unsigned stencil_pitch_override = 0;
rtex->is_depth = true;
r600_setup_miptree(screen, rtex, array_mode);
- if (rscreen->use_surface) {
+ if (rscreen->use_surface_alloc) {
rtex->surface = *surface;
r = r600_setup_surface(screen, rtex, array_mode, pitch_in_bytes_override);
if (r) {
struct pipe_resource *ptex = &rtex->resource.b.b.b;
unsigned base_align = r600_get_base_alignment(screen, ptex->format, array_mode);
- if (rscreen->use_surface) {
+ if (rscreen->use_surface_alloc) {
base_align = rtex->surface.bo_alignment;
} else if (util_format_is_depth_or_stencil(rtex->real_format)) {
/* ugly work around depth buffer need stencil room at end of bo */
if (!(templ->flags & R600_RESOURCE_FLAG_TRANSFER) &&
!(templ->bind & PIPE_BIND_SCANOUT)) {
- if (rscreen->use_surface) {
+ if (rscreen->use_surface_alloc) {
if (permit_hardware_blit(screen, templ)) {
array_mode = V_038000_ARRAY_2D_TILED_THIN1;
}
int r;
boolean use_staging_texture = FALSE;
- if (usage & PIPE_TRANSFER_MAP_PERMANENTLY) {
- return NULL;
- }
-
/* We cannot map a tiled texture directly because the data is
* in a different order, therefore we do detiling using a blit.
*
resource.bind |= PIPE_BIND_SAMPLER_VIEW;
}
/* Create the temporary texture. */
- trans->staging_texture = ctx->screen->resource_create(ctx->screen, &resource);
- if (trans->staging_texture == NULL) {
+ trans->staging = (struct r600_resource*)ctx->screen->resource_create(ctx->screen, &resource);
+ if (trans->staging == NULL) {
R600_ERR("failed to create temporary texture to hold untiled copy\n");
pipe_resource_reference(&trans->transfer.resource, NULL);
FREE(trans);
}
trans->transfer.stride =
- ((struct r600_resource_texture *)trans->staging_texture)->pitch_in_bytes[0];
+ ((struct r600_resource_texture *)trans->staging)->pitch_in_bytes[0];
if (usage & PIPE_TRANSFER_READ) {
r600_copy_to_staging_texture(ctx, trans);
/* Always referenced in the blit. */
struct pipe_resource *texture = transfer->resource;
struct r600_resource_texture *rtex = (struct r600_resource_texture*)texture;
- if (rtransfer->staging_texture) {
+ if (rtransfer->staging) {
if (transfer->usage & PIPE_TRANSFER_WRITE) {
r600_copy_from_staging_texture(ctx, rtransfer);
}
- pipe_resource_reference(&rtransfer->staging_texture, NULL);
+ pipe_resource_reference((struct pipe_resource**)&rtransfer->staging, NULL);
}
if (rtex->is_depth && !rtex->is_flushing_texture) {
unsigned offset = 0;
char *map;
- if (rtransfer->staging_texture) {
- buf = ((struct r600_resource *)rtransfer->staging_texture)->buf;
+ if (rtransfer->staging) {
+ buf = ((struct r600_resource *)rtransfer->staging)->buf;
} else {
struct r600_resource_texture *rtex = (struct r600_resource_texture*)transfer->resource;
struct r600_context *rctx = (struct r600_context*)ctx;
struct pb_buffer *buf;
- if (rtransfer->staging_texture) {
- buf = ((struct r600_resource *)rtransfer->staging_texture)->buf;
+ if (rtransfer->staging) {
+ buf = ((struct r600_resource *)rtransfer->staging)->buf;
} else {
struct r600_resource_texture *rtex = (struct r600_resource_texture*)transfer->resource;