[Mesa-dev] [PATCH 2/6] intel/isl: Fix up asserts in calc_phys_level0_extent_sa

Jason Ekstrand jason at jlekstrand.net
Fri Sep 2 22:50:43 UTC 2016


First, compressed 1D textures should be allowed.  There's nothing in the
Vulkan spec (or in GL as far as I can remember) that dissallows them.  It
just waists a bit of vertical space because it's only one pixel tall.

Second, the assertion that a format is uncompressed in the multisample
layouts isn't quite right either.  What we really want to assert is that
the format supports multisampling which is a bit more complicated query.
---
 src/intel/isl/isl.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index c460ddb..f8f5802 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -518,7 +518,6 @@ isl_calc_phys_level0_extent_sa(const struct isl_device *dev,
       assert(info->height == 1);
       assert(info->depth == 1);
       assert(info->samples == 1);
-      assert(!isl_format_is_compressed(info->format));
 
       switch (dim_layout) {
       case ISL_DIM_LAYOUT_GEN4_3D:
@@ -558,7 +557,7 @@ isl_calc_phys_level0_extent_sa(const struct isl_device *dev,
       case ISL_MSAA_LAYOUT_ARRAY:
          assert(info->depth == 1);
          assert(info->levels == 1);
-         assert(!isl_format_is_compressed(info->format));
+         assert(isl_format_supports_multisampling(dev->info, info->format));
 
          *phys_level0_sa = (struct isl_extent4d) {
             .w = info->width,
@@ -571,7 +570,7 @@ isl_calc_phys_level0_extent_sa(const struct isl_device *dev,
       case ISL_MSAA_LAYOUT_INTERLEAVED:
          assert(info->depth == 1);
          assert(info->levels == 1);
-         assert(!isl_format_is_compressed(info->format));
+         assert(isl_format_supports_multisampling(dev->info, info->format));
 
          *phys_level0_sa = (struct isl_extent4d) {
             .w = info->width,
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list