mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 17:48:10 +02:00
iris: maps
This commit is contained in:
parent
49896861ce
commit
6c7a276470
2 changed files with 30 additions and 8 deletions
|
|
@ -196,11 +196,11 @@ iris_bo_reference(struct iris_bo *bo)
|
|||
*/
|
||||
void iris_bo_unreference(struct iris_bo *bo);
|
||||
|
||||
#define MAP_READ 0x01
|
||||
#define MAP_WRITE 0x02
|
||||
#define MAP_ASYNC 0x20
|
||||
#define MAP_PERSISTENT 0x40
|
||||
#define MAP_COHERENT 0x80
|
||||
#define MAP_READ PIPE_TRANSFER_READ
|
||||
#define MAP_WRITE PIPE_TRANSFER_WRITE
|
||||
#define MAP_ASYNC PIPE_TRANSFER_UNSYNCHRONIZED
|
||||
#define MAP_PERSISTENT PIPE_TRANSFER_PERSISTENT
|
||||
#define MAP_COHERENT PIPE_TRANSFER_COHERENT
|
||||
/* internal */
|
||||
#define MAP_INTERNAL_MASK (0xff << 24)
|
||||
#define MAP_RAW (0x01 << 24)
|
||||
|
|
|
|||
|
|
@ -102,19 +102,25 @@ iris_set_active_query_state(struct pipe_context *pipe, boolean enable)
|
|||
* transfer
|
||||
*/
|
||||
static void *
|
||||
iris_transfer_map(struct pipe_context *pipe,
|
||||
iris_transfer_map(struct pipe_context *ctx,
|
||||
struct pipe_resource *resource,
|
||||
unsigned level,
|
||||
enum pipe_transfer_usage usage,
|
||||
const struct pipe_box *box,
|
||||
struct pipe_transfer **ptransfer)
|
||||
{
|
||||
struct pipe_transfer *transfer;
|
||||
struct iris_context *ice = (struct iris_context *)ctx;
|
||||
struct iris_resource *res = (struct iris_resource *)resource;
|
||||
struct pipe_transfer *transfer;
|
||||
|
||||
// PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE
|
||||
// PIPE_TRANSFER_DISCARD_RANGE
|
||||
// PIPE_TRANSFER_MAP_DIRECTLY
|
||||
|
||||
transfer = calloc(1, sizeof(struct pipe_transfer));
|
||||
if (!transfer)
|
||||
return NULL;
|
||||
|
||||
pipe_resource_reference(&transfer->resource, resource);
|
||||
transfer->level = level;
|
||||
transfer->usage = usage;
|
||||
|
|
@ -123,7 +129,23 @@ iris_transfer_map(struct pipe_context *pipe,
|
|||
transfer->layer_stride = 1;
|
||||
*ptransfer = transfer;
|
||||
|
||||
return NULL;
|
||||
#if 0
|
||||
if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED) &&
|
||||
iris_batch_references(&ice->batch, res->bo)) {
|
||||
iris_batch_flush(&ice->batch);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((usage & PIPE_TRANSFER_DONTBLOCK) && iris_bo_busy(res->bo))
|
||||
return NULL;
|
||||
|
||||
usage &= (PIPE_TRANSFER_READ |
|
||||
PIPE_TRANSFER_WRITE |
|
||||
PIPE_TRANSFER_UNSYNCHRONIZED |
|
||||
PIPE_TRANSFER_PERSISTENT |
|
||||
PIPE_TRANSFER_COHERENT);
|
||||
|
||||
return iris_bo_map(&ice->dbg, res->bo, usage);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue