summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_texture.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2012-11-13 00:25:49 +0100
committerMarek Olšák <maraeo@gmail.com>2012-11-13 15:00:37 +0100
commitac4f61b232024c7c83b81a9119a4637ed592c4a1 (patch)
tree8481d469a886f8c07740157fafbe600677fb99b4 /src/gallium/drivers/r600/r600_texture.c
parentfe2ef4b810ad1c2e712881742000bc0950b72660 (diff)
downloadexternal_mesa3d-ac4f61b232024c7c83b81a9119a4637ed592c4a1.zip
external_mesa3d-ac4f61b232024c7c83b81a9119a4637ed592c4a1.tar.gz
external_mesa3d-ac4f61b232024c7c83b81a9119a4637ed592c4a1.tar.bz2
r600g: use LINEAR_ALIGNED tiling for staging textures, reorder the code
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/gallium/drivers/r600/r600_texture.c')
-rw-r--r--src/gallium/drivers/r600/r600_texture.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index ea017d3..b1dbf07 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -494,10 +494,18 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen,
{
struct r600_screen *rscreen = (struct r600_screen*)screen;
struct radeon_surface surface;
- unsigned array_mode = 0;
+ const struct util_format_description *desc = util_format_description(templ->format);
+ unsigned array_mode;
int r;
- if (!(templ->flags & R600_RESOURCE_FLAG_TRANSFER)) {
+ /* Default tiling mode for staging textures. */
+ array_mode = V_038000_ARRAY_LINEAR_ALIGNED;
+
+ /* Tiling doesn't work with the 422 (SUBSAMPLED) formats. That's not an issue,
+ * because 422 formats are used for videos, which prefer linear buffers
+ * for fast uploads anyway. */
+ if (!(templ->flags & R600_RESOURCE_FLAG_TRANSFER) &&
+ desc->layout != UTIL_FORMAT_LAYOUT_SUBSAMPLED) {
if (!(templ->bind & PIPE_BIND_SCANOUT) &&
templ->usage != PIPE_USAGE_STAGING &&
templ->usage != PIPE_USAGE_STREAM) {
@@ -507,10 +515,6 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen,
}
}
- /* XXX tiling is broken for the 422 formats */
- if (util_format_description(templ->format)->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED)
- array_mode = V_038000_ARRAY_LINEAR_ALIGNED;
-
r = r600_init_surface(rscreen, &surface, templ, array_mode,
templ->flags & R600_RESOURCE_FLAG_FLUSHED_DEPTH);
if (r) {