summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-08-17 23:24:00 +0200
committerMarek Olšák <[email protected]>2017-08-22 13:29:47 +0200
commitfdef2f0fd19ac6f2715a802d1e14b8ddfa094f11 (patch)
treeaa04ee49e7d28c91d1d5813f1c380fa408a395b3 /src/gallium/drivers
parent113278ee79a6366ad88a4f584aa1c0310d71b479 (diff)
radeonsi/gfx9: properly handle imported textures with unexpected swizzle mode
Cc: 17.2 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/radeon/r600_texture.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index 22850e0c87d..47fd56fa6bf 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -356,7 +356,9 @@ static void r600_surface_import_metadata(struct r600_common_screen *rscreen,
*array_mode = RADEON_SURF_MODE_LINEAR_ALIGNED;
*is_scanout = metadata->u.gfx9.swizzle_mode == 0 ||
- metadata->u.gfx9.swizzle_mode % 4 == 2;
+ metadata->u.gfx9.swizzle_mode % 4 == 2;
+
+ surf->u.gfx9.surf.swizzle_mode = metadata->u.gfx9.swizzle_mode;
} else {
surf->u.legacy.pipe_config = metadata->u.legacy.pipe_config;
surf->u.legacy.bankw = metadata->u.legacy.bankw;
@@ -1521,11 +1523,6 @@ static struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen
if (rscreen->apply_opaque_metadata)
rscreen->apply_opaque_metadata(rscreen, rtex, &metadata);
- /* Validate that addrlib arrived at the same surface parameters. */
- if (rscreen->chip_class >= GFX9) {
- assert(metadata.u.gfx9.swizzle_mode == surface.u.gfx9.surf.swizzle_mode);
- }
-
assert(rtex->surface.tile_swizzle == 0);
return &rtex->resource.b.b;
}