diff options
author | Marek Olšák <[email protected]> | 2010-06-03 03:42:03 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-06-03 03:46:34 +0200 |
commit | e0d72814be13fbe8fec6a96978e92b1ec662c69c (patch) | |
tree | ab9dd72dfb320f82333b0445defb8059dc834684 /src/gallium/drivers | |
parent | 88008dfaa4838de893af9844863bad8da96ce9c8 (diff) |
r300g: set the minimum texture stride to 64 bytes on RS600, RS690, and RS740
I hope I've done it right. No way to test it here...
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/r300/r300_texture.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 4e5dc5568f8..4823755fb7a 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -696,7 +696,7 @@ static boolean r300_texture_macro_switch(struct r300_texture *tex, unsigned r300_texture_get_stride(struct r300_screen* screen, struct r300_texture* tex, unsigned level) { - unsigned tile_width, width; + unsigned tile_width, width, stride; if (tex->stride_override) return tex->stride_override; @@ -715,7 +715,19 @@ unsigned r300_texture_get_stride(struct r300_screen* screen, tex->mip_macrotile[level]); width = align(width, tile_width); - return util_format_get_stride(tex->b.b.format, width); + stride = util_format_get_stride(tex->b.b.format, width); + + /* Some IGPs need a minimum stride of 64 bytes, hmm... + * This doesn't seem to apply to tiled textures, according to r300c. */ + if (!tex->microtile && !tex->mip_macrotile[level] && + (screen->caps.family == CHIP_FAMILY_RS600 || + screen->caps.family == CHIP_FAMILY_RS690 || + screen->caps.family == CHIP_FAMILY_RS740)) { + return stride < 64 ? 64 : stride; + } + + /* The alignment to 32 bytes is sort of implied by the layout... */ + return stride; } else { return align(util_format_get_stride(tex->b.b.format, width), 32); } |