summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel/intel_context.c
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2011-11-16 23:14:39 -0800
committerChad Versace <[email protected]>2011-11-22 10:50:49 -0800
commita2e44b0813e956440c451c107cf5564b56cbe98e (patch)
tree4aad4a2c5bef3b8c1ccb3e8d34f5ee8d6d60f79c /src/mesa/drivers/dri/intel/intel_context.c
parent3eb12dfaeed03f77e31943eea164acb03e86bbc9 (diff)
intel: Replace intel_mipmap_tree::hiz_region with a miptree [v2]
This is required to correctly implement HiZ for mipmapped and multi-layered textures. v2: Accomodate refcount fixes in intel_process_dri2_buffer_*() that were introduced in v2 of commit intel: Replace intel_renderbuffer::region with a miptree [v2] Reviewed-by: Eric Anholt <eric@anholt> Signed-off-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_context.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 3f55c512357..9af21c8dace 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -1357,8 +1357,8 @@ intel_process_dri2_buffer_with_separate_stencil(struct intel_context *intel,
rb->mt->region->name == buffer->name) ||
(buffer->attachment == __DRI_BUFFER_HIZ &&
rb->mt &&
- rb->mt->hiz_region &&
- rb->mt->hiz_region->name == buffer->name)) {
+ rb->mt->hiz_mt &&
+ rb->mt->hiz_mt->region->name == buffer->name)) {
return;
}
@@ -1388,10 +1388,10 @@ intel_process_dri2_buffer_with_separate_stencil(struct intel_context *intel,
}
/* Release the buffer storage now in case we have to return early
- * due to region allocation failure.
+ * due to failure to allocate new storage.
*/
if (buffer->attachment == __DRI_BUFFER_HIZ) {
- intel_region_release(&rb->mt->hiz_region);
+ intel_miptree_release(&rb->mt->hiz_mt);
} else {
intel_miptree_release(&rb->mt);
}
@@ -1407,15 +1407,18 @@ intel_process_dri2_buffer_with_separate_stencil(struct intel_context *intel,
if (!region)
return;
+ struct intel_mipmap_tree *mt =
+ intel_miptree_create_for_region(intel,
+ GL_TEXTURE_2D,
+ rb->Base.Format,
+ region);
+ intel_region_release(&region);
+
/* Associate buffer with new storage. */
if (buffer->attachment == __DRI_BUFFER_HIZ) {
- rb->mt->hiz_region = region;
+ rb->mt->hiz_mt = mt;
} else {
- rb->mt = intel_miptree_create_for_region(intel,
- GL_TEXTURE_2D,
- rb->Base.Format,
- region);
- intel_region_release(&region);
+ rb->mt = mt;
}
}