[Mesa-dev] [PATCH v3 3/7] intel/isl: Add support for 1-D compressed textures

Jason Ekstrand jason at jlekstrand.net
Wed Sep 14 20:28:23 UTC 2016


Compressed 1-D textures are a well-defined thing in both GL and Vulkan.

v2: Fix some asserts (Nanley)

Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
---
 src/intel/isl/isl.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index a75fddf..710c990 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:
@@ -527,8 +526,8 @@ isl_calc_phys_level0_extent_sa(const struct isl_device *dev,
       case ISL_DIM_LAYOUT_GEN9_1D:
       case ISL_DIM_LAYOUT_GEN4_2D:
          *phys_level0_sa = (struct isl_extent4d) {
-            .w = info->width,
-            .h = 1,
+            .w = isl_align_npot(info->width, fmtl->bw),
+            .h = fmtl->bh,
             .d = 1,
             .a = info->array_len,
          };
@@ -757,7 +756,7 @@ isl_calc_phys_slice0_extent_sa_gen9_1d(
 {
    MAYBE_UNUSED const struct isl_format_layout *fmtl = isl_format_get_layout(info->format);
 
-   assert(phys_level0_sa->height == 1);
+   assert(phys_level0_sa->height == fmtl->bh);
    assert(phys_level0_sa->depth == 1);
    assert(info->samples == 1);
    assert(image_align_sa->w >= fmtl->bw);
@@ -1567,9 +1566,12 @@ get_image_offset_sa_gen9_1d(const struct isl_surf *surf,
                             uint32_t *x_offset_sa,
                             uint32_t *y_offset_sa)
 {
+   MAYBE_UNUSED const struct isl_format_layout *fmtl =
+      isl_format_get_layout(surf->format);
+
    assert(level < surf->levels);
    assert(layer < surf->phys_level0_sa.array_len);
-   assert(surf->phys_level0_sa.height == 1);
+   assert(surf->phys_level0_sa.height == fmtl->bh);
    assert(surf->phys_level0_sa.depth == 1);
    assert(surf->samples == 1);
 
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list