summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang, Jianxun <jianxun.zhang@intel.com>2023-03-31 20:35:13 -0700
committerMarge Bot <emma+marge@anholt.net>2023-05-15 18:49:13 +0000
commit7f84eee3c6b2c68e112508b302aa8716dc11b695 (patch)
treea7392ca36792edae0ef6d3e8dc964a2ae420075f
parent1404c180e93c4b5ce717d8df3bc598b1f21ba816 (diff)
downloadmesa-7f84eee3c6b2c68e112508b302aa8716dc11b695.tar.gz
intel/isl: Fix map between sRGB and linear formats
Some SRGB formats don't get the expected linear counterparts in isl_format_srgb_to_linear() in the generated isl_format_layout.c. The replace() of string in python returns the unchanged input string when no replacement occurred, so the first rule ('_SRGB', '') returns the original SRGB format name that passes the following check unintendedly. Another quirk is needed for a pair of formats not following the patterns of other formats. Signed-off-by: Zhang, Jianxun <jianxun.zhang@intel.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22247>
-rw-r--r--src/intel/isl/gen_format_layout.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/intel/isl/gen_format_layout.py b/src/intel/isl/gen_format_layout.py
index 72c8ad8f038..3a21c27298a 100644
--- a/src/intel/isl/gen_format_layout.py
+++ b/src/intel/isl/gen_format_layout.py
@@ -253,12 +253,14 @@ def get_srgb_to_linear_map(formats):
('_SRGB', ''),
('SRGB', 'RGB'),
('U8SRGB', 'FLT16'),
+ # Quirk: ETC2_EAC_SRGB8_A8 -> ETC2_EAC_RGBA8
+ ('SRGB8_A8', 'RGBA8'),
]
found = False
for rep in replacements:
rgb_name = fmt.name.replace(rep[0], rep[1])
- if rgb_name in names:
+ if rgb_name in names and rgb_name != fmt.name:
found = True
yield fmt.name, rgb_name
break