};
}
+static struct nil_offset4d
+nil_offset4d_div_round_down(struct nil_offset4d num, struct nil_extent4d denom)
+{
+ return (struct nil_offset4d) {
+ .x = num.x / denom.w,
+ .y = num.y / denom.h,
+ .z = num.z / denom.d,
+ .a = num.a / denom.a,
+ };
+}
+
+static struct nil_offset4d
+nil_offset4d_mul(struct nil_offset4d a, struct nil_extent4d b)
+{
+ return (struct nil_offset4d) {
+ .x = a.x * b.w,
+ .y = a.y * b.h,
+ .z = a.z * b.d,
+ .a = a.a * b.a,
+ };
+}
+
static struct nil_extent4d
nil_extent4d_align(struct nil_extent4d ext, struct nil_extent4d align)
{
return nil_extent4d_div_round_up(extent_sa, nil_el_extent_sa(format));
}
+struct nil_offset4d
+nil_offset4d_px_to_el(struct nil_offset4d offset_px,
+ enum pipe_format format,
+ enum nil_sample_layout sample_layout)
+{
+ const struct nil_offset4d offset_sa =
+ nil_offset4d_mul(offset_px, nil_px_extent_sa(sample_layout));
+
+ return nil_offset4d_div_round_down(offset_sa, nil_el_extent_sa(format));
+}
+
static struct nil_extent4d
nil_extent4d_el_to_B(struct nil_extent4d extent_el,
uint32_t B_per_el)
enum pipe_format format,
enum nil_sample_layout sample_layout);
+struct nil_offset4d {
+ uint32_t x;
+ uint32_t y;
+ uint32_t z;
+ uint32_t a;
+};
+
+static inline struct nil_offset4d
+nil_offset4d(uint32_t x, uint32_t y, uint32_t z, uint32_t a)
+{
+ struct nil_offset4d o;
+ o.x = x;
+ o.y = y;
+ o.z = z;
+ o.a = a;
+ return o;
+}
+
+struct nil_offset4d
+nil_offset4d_px_to_el(struct nil_offset4d offset_px,
+ enum pipe_format format,
+ enum nil_sample_layout sample_layout);
+
#define NIL_GOB_WIDTH_B 64
#define NIL_GOB_HEIGHT(gob_height_8) ((gob_height_8) ? 8 : 4)
#define NIL_GOB_DEPTH 1