#include "util/u_debug.h"
#include "util/u_atomic.h"
#include "util/u_box.h"
+#include "util/u_math.h"
#ifdef __cplusplus
*ptr = view;
}
+/* you have to call pipe_reference_init(&ps->reference, 1) yourself if it is just allocated */
+static INLINE void
+pipe_surface_init(struct pipe_surface* ps, struct pipe_resource *pt,
+ unsigned face, unsigned level, unsigned zslice, unsigned flags)
+{
+ pipe_resource_reference(&ps->texture, pt);
+ ps->format = pt->format;
+ ps->width = u_minify(pt->width0, level);
+ ps->height = u_minify(pt->height0, level);
+ ps->usage = flags;
+ ps->face = face;
+ ps->level = level;
+ ps->zslice = zslice;
+}
/*
* Convenience wrappers for screen buffer functions.