summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_texture.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2009-12-04 00:35:14 +0100
committerRoland Scheidegger <[email protected]>2009-12-04 00:35:14 +0100
commit9c6a9363ef96c00dd0ad63e340b32479e43fea45 (patch)
treec1752752623301c7bc63d25173c396794b74922d /src/gallium/drivers/r300/r300_texture.c
parentcc8a537c57a62a196106b592e510e4c93bd1826e (diff)
parent94b5c28a98850f42fbcdab9ceda1450279e1e6fd (diff)
Merge branch 'gallium-noblocks'
Conflicts: src/gallium/state_trackers/xorg/xorg_exa.c
Diffstat (limited to 'src/gallium/drivers/r300/r300_texture.c')
-rw-r--r--src/gallium/drivers/r300/r300_texture.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index 093a21ebe24..63fc6a235ac 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -105,7 +105,7 @@ unsigned r300_texture_get_stride(struct r300_texture* tex, unsigned level)
return 0;
}
- return align(pf_get_stride(&tex->tex.block, u_minify(tex->tex.width0, level)), 32);
+ return align(pf_get_stride(tex->tex.format, u_minify(tex->tex.width0, level)), 32);
}
static void r300_setup_miptree(struct r300_texture* tex)
@@ -115,11 +115,10 @@ static void r300_setup_miptree(struct r300_texture* tex)
int i;
for (i = 0; i <= base->last_level; i++) {
- base->nblocksx[i] = pf_get_nblocksx(&base->block, u_minify(base->width0, i));
- base->nblocksy[i] = pf_get_nblocksy(&base->block, u_minify(base->height0, i));
+ unsigned nblocksy = pf_get_nblocksy(base->format, u_minify(base->height0, i));
stride = r300_texture_get_stride(tex, i);
- layer_size = stride * base->nblocksy[i];
+ layer_size = stride * nblocksy;
if (base->target == PIPE_TEXTURE_CUBE)
size = layer_size * 6;
@@ -129,7 +128,7 @@ static void r300_setup_miptree(struct r300_texture* tex)
tex->offset[i] = align(tex->size, 32);
tex->size = tex->offset[i] + size;
tex->layer_size[i] = layer_size;
- tex->pitch[i] = stride / base->block.size;
+ tex->pitch[i] = stride / pf_get_blocksize(base->format);
debug_printf("r300: Texture miptree: Level %d "
"(%dx%dx%d px, pitch %d bytes)\n",
@@ -245,7 +244,7 @@ static struct pipe_texture*
tex->tex.screen = screen;
tex->stride_override = *stride;
- tex->pitch[0] = *stride / base->block.size;
+ tex->pitch[0] = *stride / pf_get_blocksize(base->format);
r300_setup_flags(tex);
r300_setup_texture_state(tex, r300_screen(screen)->caps->is_r500);
@@ -283,7 +282,6 @@ r300_video_surface_create(struct pipe_screen *screen,
template.width0 = util_next_power_of_two(width);
template.height0 = util_next_power_of_two(height);
template.depth0 = 1;
- pf_get_block(template.format, &template.block);
template.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER |
PIPE_TEXTURE_USAGE_RENDER_TARGET;