Mesa (master): isl: make format layout channels accessible by index

Lionel Landwerlin llandwerlin at kemper.freedesktop.org
Fri Oct 6 16:14:03 UTC 2017


Module: Mesa
Branch: master
Commit: 5e9f52ff4dec2cb3479083666a4edd94d30d77e9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5e9f52ff4dec2cb3479083666a4edd94d30d77e9

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Tue Jun  6 20:00:46 2017 +0100

isl: make format layout channels accessible by index

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Chad Versace <chadversary at chromium.org>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/intel/isl/isl.h | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
index df275f85c4..98de4c0f57 100644
--- a/src/intel/isl/isl.h
+++ b/src/intel/isl/isl.h
@@ -994,15 +994,18 @@ struct isl_format_layout {
    uint8_t bh; /**< Block height, in pixels */
    uint8_t bd; /**< Block depth, in pixels */
 
-   struct {
-      struct isl_channel_layout r; /**< Red channel */
-      struct isl_channel_layout g; /**< Green channel */
-      struct isl_channel_layout b; /**< Blue channel */
-      struct isl_channel_layout a; /**< Alpha channel */
-      struct isl_channel_layout l; /**< Luminance channel */
-      struct isl_channel_layout i; /**< Intensity channel */
-      struct isl_channel_layout p; /**< Palette channel */
-   } channels;
+   union {
+      struct {
+         struct isl_channel_layout r; /**< Red channel */
+         struct isl_channel_layout g; /**< Green channel */
+         struct isl_channel_layout b; /**< Blue channel */
+         struct isl_channel_layout a; /**< Alpha channel */
+         struct isl_channel_layout l; /**< Luminance channel */
+         struct isl_channel_layout i; /**< Intensity channel */
+         struct isl_channel_layout p; /**< Palette channel */
+      } channels;
+      struct isl_channel_layout channels_array[7];
+   };
 
    enum isl_colorspace colorspace;
    enum isl_txc txc;




More information about the mesa-commit mailing list