r600g: properly check whether texture is busy in get_transfer
This commit is contained in:
parent
d334d591a7
commit
81c0484862
|
@ -792,6 +792,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
|
||||||
unsigned usage,
|
unsigned usage,
|
||||||
const struct pipe_box *box)
|
const struct pipe_box *box)
|
||||||
{
|
{
|
||||||
|
struct r600_context *rctx = (struct r600_context*)ctx;
|
||||||
struct r600_resource_texture *rtex = (struct r600_resource_texture*)texture;
|
struct r600_resource_texture *rtex = (struct r600_resource_texture*)texture;
|
||||||
struct pipe_resource resource;
|
struct pipe_resource resource;
|
||||||
struct r600_transfer *trans;
|
struct r600_transfer *trans;
|
||||||
|
@ -815,15 +816,10 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
|
||||||
if ((usage & PIPE_TRANSFER_READ) && u_box_volume(box) > 1024)
|
if ((usage & PIPE_TRANSFER_READ) && u_box_volume(box) > 1024)
|
||||||
use_staging_texture = TRUE;
|
use_staging_texture = TRUE;
|
||||||
|
|
||||||
/* XXX: Use a staging texture for uploads if the underlying BO
|
/* Use a staging texture for uploads if the underlying BO is busy. */
|
||||||
* is busy. No interface for checking that currently? so do
|
if (!(usage & PIPE_TRANSFER_READ) &&
|
||||||
* it eagerly whenever the transfer doesn't require a readback
|
(rctx->ws->cs_is_buffer_referenced(rctx->cs, rtex->resource.cs_buf) ||
|
||||||
* and might block.
|
rctx->ws->buffer_is_busy(rtex->resource.buf, RADEON_USAGE_READWRITE)))
|
||||||
*/
|
|
||||||
if ((usage & PIPE_TRANSFER_WRITE) &&
|
|
||||||
!(usage & (PIPE_TRANSFER_READ |
|
|
||||||
PIPE_TRANSFER_DONTBLOCK |
|
|
||||||
PIPE_TRANSFER_UNSYNCHRONIZED)))
|
|
||||||
use_staging_texture = TRUE;
|
use_staging_texture = TRUE;
|
||||||
|
|
||||||
if (!permit_hardware_blit(ctx->screen, texture) ||
|
if (!permit_hardware_blit(ctx->screen, texture) ||
|
||||||
|
|
Loading…
Reference in New Issue