瀏覽代碼

nv50: account for pesky prefetch in size calculation of linear textures

tags/mesa-9.2-rc1
Christoph Bumiller 12 年之前
父節點
當前提交
ba9b0b682f
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6
    1
      src/gallium/drivers/nv50/nv50_miptree.c

+ 6
- 1
src/gallium/drivers/nv50/nv50_miptree.c 查看文件

@@ -217,6 +217,7 @@ nv50_miptree_init_layout_linear(struct nv50_miptree *mt)
{
struct pipe_resource *pt = &mt->base.base;
const unsigned blocksize = util_format_get_blocksize(pt->format);
unsigned h = pt->height0;

if (util_format_is_depth_or_stencil(pt->format))
return FALSE;
@@ -228,7 +229,11 @@ nv50_miptree_init_layout_linear(struct nv50_miptree *mt)

mt->level[0].pitch = align(pt->width0 * blocksize, 64);

mt->total_size = mt->level[0].pitch * pt->height0;
/* Account for very generous prefetch (allocate size as if tiled). */
h = MAX2(h, 8);
h = util_next_power_of_two(h);

mt->total_size = mt->level[0].pitch * h;

return TRUE;
}

Loading…
取消
儲存