aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/fdl/freedreno_layout.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/freedreno/fdl/freedreno_layout.h')
-rw-r--r--src/freedreno/fdl/freedreno_layout.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/freedreno/fdl/freedreno_layout.h b/src/freedreno/fdl/freedreno_layout.h
index e9bc3bdb371..aa46859a2c3 100644
--- a/src/freedreno/fdl/freedreno_layout.h
+++ b/src/freedreno/fdl/freedreno_layout.h
@@ -109,6 +109,12 @@ struct fdl_layout {
*/
uint8_t cpp;
+ /**
+ * Left shift necessary to multiply by cpp. Invalid for NPOT cpp, please
+ * use fdl_cpp_shift() to sanity check you aren't hitting that case.
+ */
+ uint8_t cpp_shift;
+
uint32_t width0, height0, depth0;
uint32_t nr_samples;
enum pipe_format format;
@@ -118,6 +124,13 @@ struct fdl_layout {
};
static inline uint32_t
+fdl_cpp_shift(const struct fdl_layout *layout)
+{
+ assert(util_is_power_of_two_or_zero(layout->cpp));
+ return layout->cpp_shift;
+}
+
+static inline uint32_t
fdl_layer_stride(const struct fdl_layout *layout, unsigned level)
{
if (layout->layer_first)