From 15f930f77a3c95dfc2de17e80fcf3ffb82dc955b Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Tue, 27 Dec 2011 10:52:44 -0800 Subject: [PATCH] Fix for bug-44103 --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 00a81ca..c9f07d6 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -58,6 +58,10 @@ target_to_target(GLenum target) } } +/** + * @param for_region The caller is intel_miptree_create_for_region(). If true, + * then do not create stencil_mt. + */ static struct intel_mipmap_tree * intel_miptree_create_internal(struct intel_context *intel, GLenum target, @@ -66,7 +70,8 @@ intel_miptree_create_internal(struct intel_context *intel, GLuint last_level, GLuint width0, GLuint height0, - GLuint depth0) + GLuint depth0, + bool for_region) { struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1); int compress_byte = 0; @@ -106,7 +111,8 @@ intel_miptree_create_internal(struct intel_context *intel, mt->cpp = 2; } - if (_mesa_is_depthstencil_format(_mesa_get_format_base_format(format)) && + if (!for_region && + _mesa_is_depthstencil_format(_mesa_get_format_base_format(format)) && (intel->must_use_separate_stencil || (intel->has_separate_stencil && intel->vtbl.is_hiz_depth_format(intel, format)))) { @@ -199,7 +205,8 @@ intel_miptree_create(struct intel_context *intel, mt = intel_miptree_create_internal(intel, target, format, first_level, last_level, width0, - height0, depth0); + height0, depth0, + false); /* * pitch == 0 || height == 0 indicates the null texture */ @@ -234,7 +241,8 @@ intel_miptree_create_for_region(struct intel_context *intel, mt = intel_miptree_create_internal(intel, target, format, 0, 0, - region->width, region->height, 1); + region->width, region->height, 1, + true); if (!mt) return mt; -- 1.7.7.4