r600g: Handle PIPE_TRANSFER_MAP_DIRECTLY.
authorMichel Dänzer <michel.daenzer@amd.com>
Mon, 22 Aug 2011 13:44:43 +0000 (15:44 +0200)
committerMichel Dänzer <michel@daenzer.net>
Fri, 26 Aug 2011 16:21:18 +0000 (18:21 +0200)
If the state tracker tries to map the resource directly but we can't or don't
want to do that, fail to create a transfer.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/r600/r600_texture.c

index e41fe11ac97f71c40287e44086761860e1f0bd4e..7c1bd9d8ec62c4bd867c3fb58228291e306d307e 100644 (file)
@@ -647,6 +647,9 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
                (texture->flags & R600_RESOURCE_FLAG_TRANSFER))
                use_staging_texture = FALSE;
 
+       if (use_staging_texture && (usage & PIPE_TRANSFER_MAP_DIRECTLY))
+               return NULL;
+
        trans = CALLOC_STRUCT(r600_transfer);
        if (trans == NULL)
                return NULL;