#include "intel_winsys.h"
#include "ilo_core.h"
+#include "ilo_debug.h"
#include "ilo_dev.h"
struct ilo_buffer {
ilo_buffer_init(struct ilo_buffer *buf, const struct ilo_dev *dev,
unsigned size, uint32_t bind, uint32_t flags)
{
+ assert(ilo_is_zeroed(buf, sizeof(*buf)));
+
buf->bo_size = size;
/*
{
int i;
- memset(builder, 0, sizeof(*builder));
+ assert(ilo_is_zeroed(builder, sizeof(*builder)));
builder->dev = dev;
builder->winsys = winsys;
#endif
}
+static inline bool
+ilo_is_zeroed(const void *ptr, size_t size)
+{
+#ifdef DEBUG
+ size_t i;
+
+ for (i = 0; i < size; i++) {
+ if (*((const char *) ptr) != 0)
+ return false;
+ }
+
+ return true;
+#else
+ return true;
+#endif
+}
+
#endif /* ILO_DEBUG_H */
{
const struct intel_winsys_info *info;
+ assert(ilo_is_zeroed(dev, sizeof(*dev)));
+
info = intel_winsys_get_info(winsys);
dev->winsys = winsys;
#include "intel_winsys.h"
#include "ilo_core.h"
+#include "ilo_debug.h"
#include "ilo_dev.h"
struct ilo_fence {
static inline void
ilo_fence_init(struct ilo_fence *fence, const struct ilo_dev *dev)
{
- /* no-op */
+ assert(ilo_is_zeroed(fence, sizeof(*fence)));
}
static inline void
struct ilo_image_params params;
bool transfer_only;
+ assert(ilo_is_zeroed(img, sizeof(*img)));
+
/* use transfer layout when the texture is never bound to GPU */
transfer_only = !(templ->bind & ~(PIPE_BIND_TRANSFER_WRITE |
PIPE_BIND_TRANSFER_READ));
{
struct ilo_image_params params;
+ assert(ilo_is_zeroed(img, sizeof(*img)));
+
if ((tiling == GEN6_TILING_X && bo_stride % 512) ||
(tiling == GEN6_TILING_Y && bo_stride % 128) ||
(tiling == GEN8_TILING_W && bo_stride % 64))