aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/isl/gen_format_layout.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/intel/isl/gen_format_layout.py')
-rw-r--r--src/intel/isl/gen_format_layout.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/intel/isl/gen_format_layout.py b/src/intel/isl/gen_format_layout.py
index 0ca42dbab8d..53cdd3b8110 100644
--- a/src/intel/isl/gen_format_layout.py
+++ b/src/intel/isl/gen_format_layout.py
@@ -89,6 +89,14 @@ isl_format_layouts[] = {
% endfor
};
+bool
+isl_format_is_valid(enum isl_format format)
+{
+ if (format >= sizeof(isl_format_layouts) / sizeof(isl_format_layouts[0]))
+ return false;
+ return isl_format_layouts[format].name;
+}
+
enum isl_format
isl_format_srgb_to_linear(enum isl_format format)
{