Mesa (master): i965/Gen7: Move decision to allocate MCS surface into intel_mipmap_create
Chris Forbes
chrisf at kemper.freedesktop.org
Sat Dec 7 03:13:06 UTC 2013
Module: Mesa
Branch: master
Commit: b1604841c2407c336f1069844649e51a3d135115
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1604841c2407c336f1069844649e51a3d135115
Author: Chris Forbes <chrisf at ijw.co.nz>
Date: Sun Dec 1 11:44:39 2013 +1300
i965/Gen7: Move decision to allocate MCS surface into intel_mipmap_create
This gives us correct behavior for both renderbuffers (which previously
worked) and multisample textures (which would never get an MCS surface
allocated, even if CMS layout was selected)
Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441 at gmail.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index c3e75e5..c0f0673 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -611,6 +611,14 @@ intel_miptree_create(struct brw_context *brw,
return NULL;
}
+
+ if (mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {
+ if (!intel_miptree_alloc_mcs(brw, mt, num_samples)) {
+ intel_miptree_release(&mt);
+ return NULL;
+ }
+ }
+
/* If this miptree is capable of supporting fast color clears, set
* mcs_state appropriately to ensure that fast clears will occur.
* Allocation of the MCS miptree will be deferred until the first fast
@@ -829,12 +837,6 @@ intel_miptree_create_for_renderbuffer(struct brw_context *brw,
goto fail;
}
- if (mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {
- ok = intel_miptree_alloc_mcs(brw, mt, num_samples);
- if (!ok)
- goto fail;
- }
-
return mt;
fail:
More information about the mesa-commit
mailing list