summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/softpipe/sp_texture.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-02-12 14:53:25 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-02-12 14:53:25 -0700
commit4da1cdf78fa3b954840650fa46cf72da5daf149f (patch)
tree0496f6f4364e3608f7bb7af2a549a9ba3a898252 /src/mesa/pipe/softpipe/sp_texture.c
parentb61b1a295b13a0ff2cf98c8d07e62147d71c08b9 (diff)
gallium: clean-up, simplification of mipmapped textures
Remove pipe_texture->first_level (always implicitly zero). This means there's never any unused mipmap levels at the top. In the state tracker, we no longer re-layout mipmapped textures if the MinLod/MaxLod texture parameters change. It's up to the driver to obey the pipe_sampler->min/max_lod clamps.
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_texture.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_texture.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/pipe/softpipe/sp_texture.c b/src/mesa/pipe/softpipe/sp_texture.c
index fd2cc3dbbb..6de7a9b543 100644
--- a/src/mesa/pipe/softpipe/sp_texture.c
+++ b/src/mesa/pipe/softpipe/sp_texture.c
@@ -61,7 +61,7 @@ softpipe_texture_layout(struct softpipe_texture * spt)
spt->buffer_size = 0;
- for ( level = pt->first_level ; level <= pt->last_level ; level++ ) {
+ for (level = 0; level <= pt->last_level; level++) {
pt->width[level] = width;
pt->height[level] = height;
pt->depth[level] = depth;
@@ -139,6 +139,8 @@ softpipe_get_tex_surface(struct pipe_context *pipe,
struct softpipe_texture *spt = softpipe_texture(pt);
struct pipe_surface *ps;
+ assert(level <= pt->last_level);
+
ps = pipe->winsys->surface_alloc(pipe->winsys);
if (ps) {
assert(ps->refcount);