diff options
author | Marek Olšák <[email protected]> | 2013-01-25 18:27:05 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2013-01-26 14:58:52 +0100 |
commit | 26c872c2a22f25ec95065a71770b19b6a9eb06c7 (patch) | |
tree | a2e1f770d43c7a973b6a33f0578089dba0e9919e /src/gallium/drivers/r600/r600_texture.c | |
parent | edc38330da7cc9f87c94d8873f4d2244fc422807 (diff) |
r600g: don't use radeon_surface_level::npix_x/y/z
npix_x/y/z is wrong with NPOT textures, since it's always aligned to POT
if the level is non-zero, so we can't use that.
This fixes piglit/spec/EXT_texture_shared_exponent/fbo-generatemipmap-formats.
Diffstat (limited to 'src/gallium/drivers/r600/r600_texture.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_texture.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 45a30f85df4..340fa112f94 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -514,9 +514,9 @@ r600_texture_create_object(struct pipe_screen *screen, "nblk_z=%u, pitch_bytes=%u, mode=%u\n", i, (unsigned long long)rtex->surface.level[i].offset, (unsigned long long)rtex->surface.level[i].slice_size, - rtex->surface.level[i].npix_x, - rtex->surface.level[i].npix_y, - rtex->surface.level[i].npix_z, + u_minify(rtex->resource.b.b.width0, i), + u_minify(rtex->resource.b.b.height0, i), + u_minify(rtex->resource.b.b.depth0, i), rtex->surface.level[i].nblk_x, rtex->surface.level[i].nblk_y, rtex->surface.level[i].nblk_z, @@ -531,9 +531,9 @@ r600_texture_create_object(struct pipe_screen *screen, "nblk_z=%u, pitch_bytes=%u, mode=%u\n", i, (unsigned long long)rtex->surface.stencil_level[i].offset, (unsigned long long)rtex->surface.stencil_level[i].slice_size, - rtex->surface.stencil_level[i].npix_x, - rtex->surface.stencil_level[i].npix_y, - rtex->surface.stencil_level[i].npix_z, + u_minify(rtex->resource.b.b.width0, i), + u_minify(rtex->resource.b.b.height0, i), + u_minify(rtex->resource.b.b.depth0, i), rtex->surface.stencil_level[i].nblk_x, rtex->surface.stencil_level[i].nblk_y, rtex->surface.stencil_level[i].nblk_z, @@ -612,15 +612,14 @@ struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe, } static struct pipe_surface *r600_create_surface(struct pipe_context *pipe, - struct pipe_resource *texture, + struct pipe_resource *tex, const struct pipe_surface *templ) { - struct r600_texture *rtex = (struct r600_texture*)texture; unsigned level = templ->u.tex.level; - return r600_create_surface_custom(pipe, texture, templ, - rtex->surface.level[level].npix_x, - rtex->surface.level[level].npix_y); + return r600_create_surface_custom(pipe, tex, templ, + u_minify(tex->width0, level), + u_minify(tex->height0, level)); } static void r600_surface_destroy(struct pipe_context *pipe, |