intel: Allocate s8z24 separate renderbuffers from AllocTextureImageBuffer().
authorEric Anholt <eric@anholt.net>
Wed, 28 Sep 2011 19:30:45 +0000 (12:30 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 3 Oct 2011 20:29:37 +0000 (13:29 -0700)
Before, we were only allocating these from our TexImage, so if the
texture image was set up in any other way (non-accelerated
glGenerateMipmaps()), they'd be missing or wrong.

src/mesa/drivers/dri/intel/intel_tex.c
src/mesa/drivers/dri/intel/intel_tex.h
src/mesa/drivers/dri/intel/intel_tex_image.c

index c7d57f7caf9073f85c37b32a4b589259ee50c322..ba1e364b9e97ab36d6b656d75596a62d251afb8c 100644 (file)
@@ -60,6 +60,11 @@ intel_alloc_texture_image_buffer(struct gl_context *ctx,
    struct gl_texture_object *texobj = image->TexObject;
    struct intel_texture_object *intel_texobj = intel_texture_object(texobj);
 
+   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);
index d0757b7d746c2350f91ba49aa05d5404471d544e..fb97c431d862d46b142d4f010025155a0ee4ecb1 100644 (file)
@@ -68,6 +68,9 @@ void intel_tex_map_images(struct intel_context *intel,
 
 void intel_tex_unmap_images(struct intel_context *intel,
                             struct intel_texture_object *intelObj);
+bool
+intel_tex_image_s8z24_create_renderbuffers(struct intel_context *intel,
+                                          struct intel_texture_image *image);
 
 void intel_tex_image_s8z24_scatter(struct intel_context *intel,
                                   struct intel_texture_image *intel_image);
index 7c2831e9d22bce680a3d8628e31b6ca1701184ef..c0f609f603d5887932fa4727baca7e81f0c0962f 100644 (file)
@@ -282,7 +282,7 @@ intel_tex_image_s8z24_gather(struct intel_context *intel,
    intel_tex_image_s8z24_scattergather(intel, intel_image, false);
 }
 
-static bool
+bool
 intel_tex_image_s8z24_create_renderbuffers(struct intel_context *intel,
                                           struct intel_texture_image *image)
 {