diff options
author | Jordan Justen <[email protected]> | 2018-02-26 17:57:19 -0800 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2018-03-05 09:51:01 -0800 |
commit | bd3392423ddc82f1e8fe63c10b673b1bb70decf3 (patch) | |
tree | be3ed2da0f7811987deac01444441ec75e105724 /src/intel/isl/gen_format_layout.py | |
parent | 272bef0601a1bdb5292771aefc8d62fcbdf4c47f (diff) |
intel/isl: Add isl_format_is_valid
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Diffstat (limited to 'src/intel/isl/gen_format_layout.py')
-rw-r--r-- | src/intel/isl/gen_format_layout.py | 8 |
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) { |