st/mesa: fix levels in initial texture creation
authorDave Airlie <airlied@redhat.com>
Sun, 7 Apr 2013 04:29:59 +0000 (14:29 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 8 Apr 2013 22:56:06 +0000 (23:56 +0100)
calim pointed out we were getting mipmap levels for array multisamples,
this didn't make sense. So then I noticed this function takes last_level
so we are passing in a too high value here.

I think this should fix the case he was seeing.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/state_tracker/st_cb_texture.c

index 0cd0d77af22e79a600a1dfa1ab534b5c40fa4c52..2d16920a8c8ac30763ceb8ff3780ad31e2338f5f 100644 (file)
@@ -1662,7 +1662,7 @@ st_AllocTextureStorage(struct gl_context *ctx,
    stObj->pt = st_texture_create(st,
                                  gl_target_to_pipe(texObj->Target),
                                  fmt,
-                                 levels,
+                                 levels - 1,
                                  ptWidth,
                                  ptHeight,
                                  ptDepth,