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_state.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_state.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_state.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 3ec21d20ef8..f3f7acb32c2 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -1071,7 +1071,7 @@ r600_create_sampler_view_custom(struct pipe_context *ctx, last_level = state->u.tex.last_level - offset_level; width = width_first_level; height = height_first_level; - depth = tmp->surface.level[offset_level].npix_z; + depth = u_minify(texture->depth0, offset_level); pitch = tmp->surface.level[offset_level].nblk_x * util_format_get_blockwidth(state->format); if (texture->target == PIPE_TEXTURE_1D_ARRAY) { @@ -1135,11 +1135,9 @@ r600_create_sampler_view(struct pipe_context *ctx, struct pipe_resource *tex, const struct pipe_sampler_view *state) { - struct r600_texture *rtex = (struct r600_texture*)tex; - return r600_create_sampler_view_custom(ctx, tex, state, - rtex->surface.level[state->u.tex.first_level].npix_x, - rtex->surface.level[state->u.tex.first_level].npix_y); + u_minify(tex->width0, state->u.tex.first_level), + u_minify(tex->height0, state->u.tex.first_level)); } static void r600_emit_clip_state(struct r600_context *rctx, struct r600_atom *atom) |