#define ILO_RESOURCE_H
#include "core/intel_winsys.h"
-#include "core/ilo_buffer.h"
#include "core/ilo_image.h"
+#include "core/ilo_vma.h"
#include "ilo_common.h"
#include "ilo_screen.h"
* flags, the slice has been cleared to ilo_texture_slice::clear_value.
*/
ILO_TEXTURE_CLEAR = 1 << 6,
-
- /*
- * Set when HiZ can be enabled.
- *
- * It is never set in resolve flags. When set in slice flags, the slice
- * can have HiZ enabled. It is to be noted that this bit is always set for
- * either all or none of the slices in a level, allowing quick check in
- * case of layered rendering.
- */
- ILO_TEXTURE_HIZ = 1 << 7,
};
/**
bool imported;
+ enum pipe_format image_format;
struct ilo_image image;
+ struct ilo_vma vma;
+ struct ilo_vma aux_vma;
/* XXX thread-safety */
struct ilo_texture_slice *slices[PIPE_MAX_TEXTURE_LEVELS];
struct ilo_buffer_resource {
struct pipe_resource base;
- struct ilo_buffer buffer;
+ uint32_t bo_size;
+ struct ilo_vma vma;
};
-static inline struct ilo_buffer *
-ilo_buffer(struct pipe_resource *res)
+static inline struct ilo_buffer_resource *
+ilo_buffer_resource(struct pipe_resource *res)
{
- return (res && res->target == PIPE_BUFFER) ?
- &((struct ilo_buffer_resource *) res)->buffer : NULL;
+ return (struct ilo_buffer_resource *)
+ ((res && res->target == PIPE_BUFFER) ? res : NULL);
}
static inline struct ilo_texture *
ilo_resource_rename_bo(struct pipe_resource *res);
/**
- * Return the bo of the resource.
+ * Return the VMA of the resource.
*/
-static inline struct intel_bo *
-ilo_resource_get_bo(struct pipe_resource *res)
+static inline const struct ilo_vma *
+ilo_resource_get_vma(struct pipe_resource *res)
{
return (res->target == PIPE_BUFFER) ?
- ilo_buffer(res)->bo : ilo_texture(res)->image.bo;
+ &((struct ilo_buffer_resource *) res)->vma :
+ &((struct ilo_texture *) res)->vma;
}
static inline struct ilo_texture_slice *
}
}
-static inline bool
-ilo_texture_can_enable_hiz(const struct ilo_texture *tex, unsigned level,
- unsigned first_slice, unsigned num_slices)
-{
- /*
- * Either all or none of the slices in the same level have ILO_TEXTURE_HIZ
- * set. It suffices to check only the first slice.
- */
- const struct ilo_texture_slice *slice =
- ilo_texture_get_slice(tex, level, 0);
-
- return (tex->image.aux_bo && (slice->flags & ILO_TEXTURE_HIZ));
-}
-
#endif /* ILO_RESOURCE_H */