ac/surface: add RADEON_SURF_SHAREABLE
authorMarek Olšák <marek.olsak@amd.com>
Fri, 28 Jul 2017 21:01:10 +0000 (23:01 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 4 Aug 2017 00:10:04 +0000 (02:10 +0200)
Shareable textures won't use tile swizzle.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/amd/common/ac_surface.h
src/gallium/drivers/radeon/r600_texture.c

index 3c9e13e..01a71f3 100644 (file)
@@ -67,6 +67,7 @@ enum radeon_micro_mode {
 #define RADEON_SURF_TC_COMPATIBLE_HTILE         (1 << 23)
 #define RADEON_SURF_IMPORTED                    (1 << 24)
 #define RADEON_SURF_OPTIMIZE_FOR_SPACE          (1 << 25)
+#define RADEON_SURF_SHAREABLE                   (1 << 26)
 
 struct legacy_surf_level {
     uint64_t                    offset;
index 3aac3c7..2d58dc9 100644 (file)
@@ -280,8 +280,10 @@ static int r600_init_surface(struct r600_common_screen *rscreen,
                flags |= RADEON_SURF_SCANOUT;
        }
 
+       if (ptex->bind & PIPE_BIND_SHARED)
+               flags |= RADEON_SURF_SHAREABLE;
        if (is_imported)
-               flags |= RADEON_SURF_IMPORTED;
+               flags |= RADEON_SURF_IMPORTED | RADEON_SURF_SHAREABLE;
        if (!(ptex->flags & R600_RESOURCE_FLAG_FORCE_TILING))
                flags |= RADEON_SURF_OPTIMIZE_FOR_SPACE;