summaryrefslogtreecommitdiffstats
path: root/src/intel/isl
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-05-10 12:15:01 -0700
committerJason Ekstrand <[email protected]>2017-05-16 17:04:26 -0700
commit2486c7dd540d6f318265d8b49c0c6205cc9e9315 (patch)
tree2af59a465416628bc84051c0da1a0953f776d730 /src/intel/isl
parent715f47cb348d2ba020507126cff5aabd8b98ac85 (diff)
intel/isl: Refactor gen6_choose_image_alignment_el
Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/intel/isl')
-rw-r--r--src/intel/isl/isl_gen6.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/src/intel/isl/isl_gen6.c b/src/intel/isl/isl_gen6.c
index b74690319e9..6da0be7dc20 100644
--- a/src/intel/isl/isl_gen6.c
+++ b/src/intel/isl/isl_gen6.c
@@ -88,6 +88,8 @@ isl_gen6_choose_image_alignment_el(const struct isl_device *dev,
* | format | halign | valign |
* +------------------------+--------+--------+
* | YUV 4:2:2 formats | 4 | * |
+ * | BC1-5 | 4 | 4 |
+ * | FXT1 | 8 | 4 |
* | uncompressed formats | 4 | * |
* +------------------------+--------+--------+
*
@@ -110,38 +112,32 @@ isl_gen6_choose_image_alignment_el(const struct isl_device *dev,
*/
if (isl_format_is_compressed(info->format)) {
+ /* Compressed formats have an alignment equal to their block size */
*image_align_el = isl_extent3d(1, 1, 1);
return;
}
- if (isl_format_is_yuv(info->format)) {
- *image_align_el = isl_extent3d(4, 2, 1);
- return;
- }
-
- if (info->samples > 1) {
- *image_align_el = isl_extent3d(4, 4, 1);
- return;
- }
-
- if (isl_surf_usage_is_depth_or_stencil(info->usage) &&
- !ISL_DEV_USE_SEPARATE_STENCIL(dev)) {
- /* interleaved depthstencil buffer */
- *image_align_el = isl_extent3d(4, 4, 1);
- return;
- }
-
if (isl_surf_usage_is_depth(info->usage)) {
- /* separate depth buffer */
+ /* depth buffer (possibly interleaved with stencil) */
*image_align_el = isl_extent3d(4, 4, 1);
return;
}
if (isl_surf_usage_is_stencil(info->usage)) {
/* separate stencil buffer */
+ assert(!isl_surf_usage_is_depth(info->usage));
*image_align_el = isl_extent3d(4, 2, 1);
return;
}
+ if (info->samples > 1) {
+ *image_align_el = isl_extent3d(4, 4, 1);
+ return;
+ }
+
+ /* For everything else, 4x2 is always a valid alignment. Since this is
+ * also the smallest alignment we can specify, we use 4x2 for everything
+ * else because it uses the least memory.
+ */
*image_align_el = isl_extent3d(4, 2, 1);
}