diff options
author | Jason Ekstrand <[email protected]> | 2017-02-08 17:21:54 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-05-09 11:16:33 -0700 |
commit | dad67cc24576622ef989a9bb66a5b13cc275cfae (patch) | |
tree | 0cefa044709d415b71bb360643a21f585089a42e /src/intel/isl/isl.h | |
parent | 23d703de1fb140bb2ed4da247961d89a69f27140 (diff) |
intel/isl: Add an isl_swizzle_supports_rendering helper
This helper encodes more details, specifically about Haswell, than the
previous asserts in isl_surface_state.c.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/isl/isl.h')
-rw-r--r-- | src/intel/isl/isl.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h index c50b78d4701..fc1ff5f3f88 100644 --- a/src/intel/isl/isl.h +++ b/src/intel/isl/isl.h @@ -1731,6 +1731,19 @@ bool isl_color_value_is_zero(union isl_color_value value, bool isl_color_value_is_zero_one(union isl_color_value value, enum isl_format format); +static inline bool +isl_swizzle_is_identity(struct isl_swizzle swizzle) +{ + return swizzle.r == ISL_CHANNEL_SELECT_RED && + swizzle.g == ISL_CHANNEL_SELECT_GREEN && + swizzle.b == ISL_CHANNEL_SELECT_BLUE && + swizzle.a == ISL_CHANNEL_SELECT_ALPHA; +} + +bool +isl_swizzle_supports_rendering(const struct gen_device_info *devinfo, + struct isl_swizzle swizzle); + #define isl_surf_init(dev, surf, ...) \ isl_surf_init_s((dev), (surf), \ &(struct isl_surf_init_info) { __VA_ARGS__ }); |