#include "swrast/swrast.h"
+#include "main/renderbuffer.h"
#include "main/texobj.h"
#include "main/teximage.h"
#include "main/mipmap.h"
_mesa_free_texmemory(texImage->Data);
texImage->Data = NULL;
}
+
+ if (intelImage->depth_rb) {
+ _mesa_reference_renderbuffer(&intelImage->depth_rb, NULL);
+ }
+
+ if (intelImage->stencil_rb) {
+ _mesa_reference_renderbuffer(&intelImage->stencil_rb, NULL);
+ }
}
/**
}
}
- /* Release the reference to a potentially orphaned buffer.
- * Release any old malloced memory.
- */
- if (intelImage->mt) {
- intel_miptree_release(intel, &intelImage->mt);
- assert(!texImage->Data);
- }
- else if (texImage->Data) {
- _mesa_free_texmemory(texImage->Data);
- texImage->Data = NULL;
- }
-
+ ctx->Driver.FreeTexImageData(ctx, texImage);
assert(!intelImage->mt);
if (intelObj->mt &&
*/
struct intel_mipmap_tree *mt;
GLboolean used_as_render_target;
+
+ /**
+ * \name Renderbuffers for faking packed depth/stencil
+ *
+ * These renderbuffers are non-null only if the intel_context is using
+ * separate stencil and this texture has a packed depth/stencil format. When
+ * glFramebufferTexture is called on this image, the resultant renderbuffer
+ * wrapper reuses these renderbuffers as its own.
+ *
+ * \see intel_wrap_texture
+ * \see intel_tex_image_s8z24_create_renderbuffers
+ * \see intel_tex_image_s8z24_scatter
+ * \see intel_tex_image_s8z24_gather
+ *
+ * \{
+ */
+
+ /**
+ * The depth buffer has format X8_Z24. The x8 bits are undefined unless
+ * intel_tex_image_s8z24_gather has been immediately called. The depth buffer
+ * resuses the image miptree's region and hiz_region as its own.
+ */
+ struct gl_renderbuffer *depth_rb;
+
+ /**
+ * The stencil buffer has format S8 and keeps its data in its own region.
+ */
+ struct gl_renderbuffer *stencil_rb;
+
+ /** \} */
};
static INLINE struct intel_texture_object *