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 3c9e13e3f2132ae00cc328fb1a37ed6e3299b155..01a71f32b2f6df92c0ac807a378262a541e8cc2d 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 3aac3c78a987057cfed88ef6f64f4158bfb4af7e..2d58dc9649942d43b39fcd4bf68b60a0494fa8f7 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;