intel: Fix scatter/gather for depthstencil textures
authorChad Versace <chad@chad-versace.us>
Fri, 7 Oct 2011 19:12:46 +0000 (12:12 -0700)
committerChad Versace <chad@chad-versace.us>
Tue, 18 Oct 2011 18:42:54 +0000 (11:42 -0700)
During anholt's MapTextureImage refactoring, the call to
intel_tex_image_s8z24_create_renderbuffers was missplaced. It needs to
occur *after* the miptree is allocated.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
src/mesa/drivers/dri/intel/intel_tex.c

index 83ba50e39edfdf8d79029b9bd0383e9535a76ed3..fff2daefb957479ae922b9e23eeb386b266c0318 100644 (file)
@@ -66,11 +66,6 @@ intel_alloc_texture_image_buffer(struct gl_context *ctx,
     */
    ctx->Driver.FreeTextureImageBuffer(ctx, image);
 
-   if (intel->must_use_separate_stencil
-       && image->TexFormat == MESA_FORMAT_S8_Z24) {
-      intel_tex_image_s8z24_create_renderbuffers(intel, intel_image);
-   }
-
    if (intel_texobj->mt &&
        intel_miptree_match_image(intel_texobj->mt, image)) {
       intel_miptree_reference(&intel_image->mt, intel_texobj->mt);
@@ -90,6 +85,11 @@ intel_alloc_texture_image_buffer(struct gl_context *ctx,
        */
       intel_miptree_reference(&intel_texobj->mt, intel_image->mt);
 
+      if (intel->must_use_separate_stencil
+          && image->TexFormat == MESA_FORMAT_S8_Z24) {
+         intel_tex_image_s8z24_create_renderbuffers(intel, intel_image);
+      }
+
       DBG("%s: alloc obj %p level %d %dx%dx%d using new miptree %p\n",
           __FUNCTION__, texobj, image->Level,
           width, height, depth, intel_image->mt);