[Mesa-dev] [v3 03/19] intel/isl: Add extent4d minify
Topi Pohjolainen
topi.pohjolainen at gmail.com
Mon May 15 12:07:53 UTC 2017
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
src/intel/isl/isl_priv.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/intel/isl/isl_priv.h b/src/intel/isl/isl_priv.h
index 3c4cc1e..5ccb860 100644
--- a/src/intel/isl/isl_priv.h
+++ b/src/intel/isl/isl_priv.h
@@ -151,6 +151,21 @@ isl_extent3d_el_to_sa(enum isl_format fmt, struct isl_extent3d extent_el)
};
}
+static inline struct isl_extent4d
+isl_extent4d_minify(const struct isl_extent4d *extent,
+ enum isl_surf_dim dim, unsigned levels)
+{
+ struct isl_extent4d e = {
+ .width = isl_minify(extent->width, levels),
+ .height = isl_minify(extent->height, levels),
+ .depth = dim == ISL_SURF_DIM_3D ?
+ isl_minify(extent->depth, levels) : extent->depth,
+ .array_len = extent->array_len
+ };
+
+ return e;
+}
+
void
isl_gen4_surf_fill_state_s(const struct isl_device *dev, void *state,
const struct isl_surf_fill_state_info *restrict info);
--
2.9.3
More information about the mesa-dev
mailing list