Browse Source

llvmpipe: Allocate texture storage for whole quads.

tags/mesa_7_7_rc1
José Fonseca 16 years ago
parent
commit
838da1d4ae
1 changed files with 11 additions and 3 deletions
  1. 11
    3
      src/gallium/drivers/llvmpipe/lp_texture.c

+ 11
- 3
src/gallium/drivers/llvmpipe/lp_texture.c View File

@@ -66,16 +66,24 @@ llvmpipe_texture_layout(struct llvmpipe_screen *screen,
pf_get_block(lpt->base.format, &lpt->base.block);

for (level = 0; level <= pt->last_level; level++) {
unsigned nblocksx, nblocksy;

pt->width[level] = width;
pt->height[level] = height;
pt->depth[level] = depth;
pt->nblocksx[level] = pf_get_nblocksx(&pt->block, width);
pt->nblocksy[level] = pf_get_nblocksy(&pt->block, height);
lpt->stride[level] = align(pt->nblocksx[level]*pt->block.size, 16);
pt->nblocksy[level] = pf_get_nblocksy(&pt->block, height);

/* Allocate storage for whole quads. This is particularly important
* for depth surfaces, which are currently stored in a swizzled format. */
nblocksx = pf_get_nblocksx(&pt->block, align(width, 2));
nblocksy = pf_get_nblocksy(&pt->block, align(height, 2));

lpt->stride[level] = align(nblocksx*pt->block.size, 16);

lpt->level_offset[level] = buffer_size;

buffer_size += (pt->nblocksy[level] *
buffer_size += (nblocksy *
((pt->target == PIPE_TEXTURE_CUBE) ? 6 : depth) *
lpt->stride[level]);


Loading…
Cancel
Save