radeonsi: ignore PIPE_BIND_LINEAR in si_is_format_supported v2
authorChristian König <christian.koenig@amd.com>
Thu, 14 Jan 2016 12:38:10 +0000 (13:38 +0100)
committerChristian König <christian.koenig@amd.com>
Tue, 29 Mar 2016 15:28:35 +0000 (17:28 +0200)
Linear layout should work for all not compressed or depth/stencil formats.

v2: restrict it a bit more

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_state.c

index a2b0da90ec9e080451cb678943ac6fceb6fdd388..10d691a92f18f7c0f10c4aba958f14d4ab364613 100644 (file)
@@ -2046,6 +2046,11 @@ boolean si_is_format_supported(struct pipe_screen *screen,
        if (usage & PIPE_BIND_TRANSFER_WRITE)
                retval |= PIPE_BIND_TRANSFER_WRITE;
 
+       if ((usage & PIPE_BIND_LINEAR) &&
+           !util_format_is_compressed(format) &&
+           !(usage & PIPE_BIND_DEPTH_STENCIL))
+               retval |= PIPE_BIND_LINEAR;
+
        return retval == usage;
 }