diff options
author | Marek Olšák <[email protected]> | 2018-12-14 16:03:00 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-01-02 15:01:59 -0500 |
commit | 3ae57957be0296eea6799655e5f945db714c2584 (patch) | |
tree | b5e524929c34f7742cb7f0855469a6eee052cd8b /src/gallium/drivers/radeonsi/si_texture.c | |
parent | edfca1f8dc92ce89895b9429e376e03b4876ea23 (diff) |
radeonsi: always unmap texture CPU mappings on 32-bit CPU architectures
Team Fortress 2 32-bit version runs out of the CPU address space.
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_texture.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_texture.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 9df12e0f5bd..c169d4e443d 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -1798,6 +1798,12 @@ static void *si_texture_transfer_map(struct pipe_context *ctx, buf = &tex->buffer; } + /* Always unmap texture CPU mappings on 32-bit architectures, so that + * we don't run out of the CPU address space. + */ + if (sizeof(void*) == 4) + usage |= RADEON_TRANSFER_TEMPORARY; + if (!(map = si_buffer_map_sync_with_rings(sctx, buf, usage))) goto fail_trans; @@ -1819,6 +1825,16 @@ static void si_texture_transfer_unmap(struct pipe_context *ctx, struct pipe_resource *texture = transfer->resource; struct si_texture *tex = (struct si_texture*)texture; + /* Always unmap texture CPU mappings on 32-bit architectures, so that + * we don't run out of the CPU address space. + */ + if (sizeof(void*) == 4) { + struct r600_resource *buf = + stransfer->staging ? stransfer->staging : &tex->buffer; + + sctx->ws->buffer_unmap(buf->buf); + } + if ((transfer->usage & PIPE_TRANSFER_WRITE) && stransfer->staging) { if (tex->is_depth && tex->buffer.b.b.nr_samples <= 1) { ctx->resource_copy_region(ctx, texture, transfer->level, |