summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-02-24 13:55:25 +1000
committerDave Airlie <airlied@redhat.com>2011-02-25 09:18:42 +1000
commitc9bca01819ef0fa3c64a28e26bd63953cf7f1364 (patch)
treeeba23dc975223e8c60466fb5beba0e5756bfae15 /src
parent79ad6f5375253faff89bbc7eb6dc5949ba63e0ef (diff)
r600g: bc 4/5 or rgtc textures need to be tiled as well.
Make the s3tc upload code more generic. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r600/r600_blit.c16
-rw-r--r--src/gallium/drivers/r600/r600_texture.c4
2 files changed, 10 insertions, 10 deletions
diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c
index 9865ea17ae..04408a5cc8 100644
--- a/src/gallium/drivers/r600/r600_blit.c
+++ b/src/gallium/drivers/r600/r600_blit.c
@@ -225,7 +225,7 @@ struct texture_orig_info {
unsigned height0;
};
-static void r600_s3tc_to_blittable(struct pipe_resource *tex,
+static void r600_compressed_to_blittable(struct pipe_resource *tex,
unsigned level,
struct texture_orig_info *orig)
{
@@ -253,7 +253,7 @@ static void r600_s3tc_to_blittable(struct pipe_resource *tex,
}
-static void r600_reset_blittable_to_s3tc(struct pipe_resource *tex,
+static void r600_reset_blittable_to_compressed(struct pipe_resource *tex,
unsigned level,
struct texture_orig_info *orig)
{
@@ -282,13 +282,13 @@ static void r600_resource_copy_region(struct pipe_context *ctx,
restore_orig[0] = restore_orig[1] = FALSE;
- if (util_format_is_s3tc(src->format)) {
- r600_s3tc_to_blittable(src, src_level, &orig_info[0]);
+ if (util_format_is_compressed(src->format)) {
+ r600_compressed_to_blittable(src, src_level, &orig_info[0]);
restore_orig[0] = TRUE;
}
- if (util_format_is_s3tc(dst->format)) {
- r600_s3tc_to_blittable(dst, dst_level, &orig_info[1]);
+ if (util_format_is_compressed(dst->format)) {
+ r600_compressed_to_blittable(dst, dst_level, &orig_info[1]);
restore_orig[1] = TRUE;
/* translate the dst box as well */
dstx = util_format_get_nblocksx(orig_info[1].format, dstx);
@@ -299,10 +299,10 @@ static void r600_resource_copy_region(struct pipe_context *ctx,
src, src_level, src_box);
if (restore_orig[0])
- r600_reset_blittable_to_s3tc(src, src_level, &orig_info[0]);
+ r600_reset_blittable_to_compressed(src, src_level, &orig_info[0]);
if (restore_orig[1])
- r600_reset_blittable_to_s3tc(dst, dst_level, &orig_info[1]);
+ r600_reset_blittable_to_compressed(dst, dst_level, &orig_info[1]);
}
void r600_init_blit_functions(struct r600_pipe_context *rctx)
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 095558d033..87143ee54c 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -292,7 +292,7 @@ static boolean permit_hardware_blit(struct pipe_screen *screen,
bind = PIPE_BIND_RENDER_TARGET;
/* hackaround for S3TC */
- if (util_format_is_s3tc(res->format))
+ if (util_format_is_compressed(res->format))
return TRUE;
if (!screen->is_format_supported(screen,
@@ -424,7 +424,7 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen,
}
if (!(templ->flags & R600_RESOURCE_FLAG_TRANSFER) &&
- util_format_is_s3tc(templ->format))
+ util_format_is_compressed(templ->format))
array_mode = V_038000_ARRAY_1D_TILED_THIN1;
return (struct pipe_resource *)r600_texture_create_object(screen, templ, array_mode,