Lines Matching defs:resource

39 void *si_buffer_map(struct si_context *sctx, struct si_resource *resource,
42 return sctx->ws->buffer_map(sctx->ws, resource->buf, &sctx->gfx_cs, usage);
172 /* Allocate a new resource. */
232 struct si_resource *resource = &tex->buffer;
239 radeon_bo_reference(((struct si_screen*)screen)->ws, &resource->buf, NULL);
244 /* Reallocate the buffer a update all resource bindings where the buffer is
303 static void si_invalidate_resource(struct pipe_context *ctx, struct pipe_resource *resource)
306 struct si_resource *buf = si_resource(resource);
309 if (resource->target == PIPE_BUFFER)
313 static void *si_buffer_get_transfer(struct pipe_context *ctx, struct pipe_resource *resource,
328 pipe_resource_reference(&transfer->b.b.resource, resource);
337 static void *si_buffer_transfer_map(struct pipe_context *ctx, struct pipe_resource *resource,
342 struct si_resource *buf = si_resource(resource);
345 assert(resource->target == PIPE_BUFFER);
346 assert(box->x + box->width <= resource->width0);
372 /* If discarding the entire range, discard the whole resource instead. */
373 if (usage & PIPE_MAP_DISCARD_RANGE && box->x == 0 && box->width == resource->width0) {
433 return si_buffer_get_transfer(ctx, resource, usage, box, ptransfer, data, staging,
456 si_copy_buffer(sctx, &staging->b.b, resource, box->x % SI_MAP_BUFFER_ALIGNMENT,
466 return si_buffer_get_transfer(ctx, resource, usage, box, ptransfer, data, staging, 0);
478 return si_buffer_get_transfer(ctx, resource, usage, box, ptransfer, data, NULL, 0);
486 struct si_resource *buf = si_resource(transfer->resource);
493 si_copy_buffer(sctx, transfer->resource, &stransfer->staging->b.b, box->x, src_offset,
523 sctx->ws->buffer_unmap(sctx->ws, si_resource(stransfer->b.b.resource)->buf);
527 pipe_resource_reference(&transfer->resource, NULL);
731 static bool si_resource_commit(struct pipe_context *pctx, struct pipe_resource *resource,
735 struct si_resource *res = si_resource(resource);
750 if (resource->target == PIPE_BUFFER)