r600g: don't call debug_get_bool_option for tiling more than once

This commit is contained in:
Keith Whitwell 2010-11-03 10:31:55 +00:00
parent b3462601cb
commit ee07e0e39a
1 changed files with 7 additions and 1 deletions

View File

@ -306,8 +306,14 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen,
const struct pipe_resource *templ)
{
unsigned array_mode = 0;
static int force_tiling = -1;
if (debug_get_bool_option("R600_FORCE_TILING", FALSE)) {
/* Would like some magic "get_bool_option_once" routine.
*/
if (force_tiling == -1)
force_tiling = debug_get_bool_option("R600_FORCE_TILING", FALSE);
if (force_tiling) {
if (!(templ->flags & R600_RESOURCE_FLAG_TRANSFER) &&
!(templ->bind & PIPE_BIND_SCANOUT)) {
array_mode = V_038000_ARRAY_2D_TILED_THIN1;