else
transfer = slab_alloc(&rctx->pool_transfers);
- transfer->transfer.resource = NULL;
- pipe_resource_reference(&transfer->transfer.resource, resource);
- transfer->transfer.level = 0;
- transfer->transfer.usage = usage;
- transfer->transfer.box = *box;
- transfer->transfer.stride = 0;
- transfer->transfer.layer_stride = 0;
+ transfer->b.b.resource = NULL;
+ pipe_resource_reference(&transfer->b.b.resource, resource);
+ transfer->b.b.level = 0;
+ transfer->b.b.usage = usage;
+ transfer->b.b.box = *box;
+ transfer->b.b.stride = 0;
+ transfer->b.b.layer_stride = 0;
+ transfer->b.staging = NULL;
transfer->offset = offset;
transfer->staging = staging;
- *ptransfer = &transfer->transfer;
+ *ptransfer = &transfer->b.b;
return data;
}
!(transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT))
r600_buffer_do_flush_region(ctx, transfer, &transfer->box);
- if (rtransfer->staging)
- r600_resource_reference(&rtransfer->staging, NULL);
-
+ r600_resource_reference(&rtransfer->staging, NULL);
+ assert(rtransfer->b.staging == NULL); /* for threaded context only */
pipe_resource_reference(&transfer->resource, NULL);
/* Don't use pool_transfers_unsync. We are always in the driver
trans = CALLOC_STRUCT(r600_transfer);
if (!trans)
return NULL;
- pipe_resource_reference(&trans->transfer.resource, texture);
- trans->transfer.level = level;
- trans->transfer.usage = usage;
- trans->transfer.box = *box;
+ pipe_resource_reference(&trans->b.b.resource, texture);
+ trans->b.b.level = level;
+ trans->b.b.usage = usage;
+ trans->b.b.box = *box;
if (rtex->is_depth) {
struct r600_texture *staging_depth;
/* Just get the strides. */
r600_texture_get_offset(rctx->screen, staging_depth, level, NULL,
- &trans->transfer.stride,
- &trans->transfer.layer_stride);
+ &trans->b.b.stride,
+ &trans->b.b.layer_stride);
} else {
/* XXX: only readback the rectangle which is being mapped? */
/* XXX: when discard is true, no need to read back from depth texture */
offset = r600_texture_get_offset(rctx->screen, staging_depth,
level, box,
- &trans->transfer.stride,
- &trans->transfer.layer_stride);
+ &trans->b.b.stride,
+ &trans->b.b.layer_stride);
}
trans->staging = (struct r600_resource*)staging_depth;
/* Just get the strides. */
r600_texture_get_offset(rctx->screen, staging, 0, NULL,
- &trans->transfer.stride,
- &trans->transfer.layer_stride);
+ &trans->b.b.stride,
+ &trans->b.b.layer_stride);
if (usage & PIPE_TRANSFER_READ)
r600_copy_to_staging_texture(ctx, trans);
} else {
/* the resource is mapped directly */
offset = r600_texture_get_offset(rctx->screen, rtex, level, box,
- &trans->transfer.stride,
- &trans->transfer.layer_stride);
+ &trans->b.b.stride,
+ &trans->b.b.layer_stride);
buf = &rtex->resource;
}
return NULL;
}
- *ptransfer = &trans->transfer;
+ *ptransfer = &trans->b.b;
return map + offset;
}