summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-05-13 12:38:44 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-05-20 14:21:48 +0200
commitaf9a49259f97b37c8a9731e863f21828c6e0e593 (patch)
tree3f2c1fa6cbbade822d2c21866aeddc0763926292
parentee624940901fc1d8e3d7156bdc636de6aeb17724 (diff)
r600g: Add support for PIPE_BIND_CURSORcursor
-rw-r--r--src/gallium/drivers/r600/r600_texture.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 7ffea6961d..2cf75be43e 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -86,7 +86,8 @@ unsigned r600_texture_get_offset(struct r600_resource_texture *rtex,
static unsigned r600_get_block_alignment(struct pipe_screen *screen,
enum pipe_format format,
- unsigned array_mode)
+ unsigned array_mode,
+ unsigned bind)
{
struct r600_screen* rscreen = (struct r600_screen *)screen;
unsigned pixsize = util_format_get_blocksize(format);
@@ -107,7 +108,10 @@ static unsigned r600_get_block_alignment(struct pipe_screen *screen,
break;
case V_038000_ARRAY_LINEAR_GENERAL:
default:
- p_align = rscreen->tiling_info->group_bytes / pixsize;
+ if (bind & PIPE_BIND_CURSOR)
+ p_align = 64;
+ else
+ p_align = rscreen->tiling_info->group_bytes / pixsize;
break;
}
return p_align;
@@ -141,7 +145,7 @@ static unsigned r600_get_base_alignment(struct pipe_screen *screen,
{
struct r600_screen* rscreen = (struct r600_screen *)screen;
unsigned pixsize = util_format_get_blocksize(format);
- int p_align = r600_get_block_alignment(screen, format, array_mode);
+ int p_align = r600_get_block_alignment(screen, format, array_mode, 0);
int h_align = r600_get_height_alignment(screen, array_mode);
int b_align;
@@ -184,7 +188,8 @@ static unsigned r600_texture_get_nblocksx(struct pipe_screen *screen,
nblocksx = util_format_get_nblocksx(ptex->format, width);
block_align = r600_get_block_alignment(screen, ptex->format,
- rtex->array_mode[level]);
+ rtex->array_mode[level],
+ ptex->bind);
nblocksx = align(nblocksx, block_align);
return nblocksx;
}
@@ -222,7 +227,7 @@ static void r600_texture_set_array_mode(struct pipe_screen *screen,
unsigned w, h, tile_height, tile_width;
tile_height = r600_get_height_alignment(screen, array_mode);
- tile_width = r600_get_block_alignment(screen, ptex->format, array_mode);
+ tile_width = r600_get_block_alignment(screen, ptex->format, array_mode, ptex->bind);
w = mip_minify(ptex->width0, level);
h = mip_minify(ptex->height0, level);
@@ -416,7 +421,7 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen,
if (force_tiling && permit_hardware_blit(screen, templ)) {
if (!(templ->flags & R600_RESOURCE_FLAG_TRANSFER) &&
- !(templ->bind & PIPE_BIND_SCANOUT)) {
+ !(templ->bind & (PIPE_BIND_SCANOUT | PIPE_BIND_CURSOR))) {
array_mode = V_038000_ARRAY_2D_TILED_THIN1;
}
}