To get array bounds checking.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
ss->texture_timestamp++;
svga_age_texture_view(tex, transfer->level);
if (transfer->resource->target == PIPE_TEXTURE_CUBE)
- tex->defined[transfer->box.z][transfer->level] = TRUE;
+ svga_define_texture_level(tex, transfer->box.z, transfer->level);
else
- tex->defined[0][transfer->level] = TRUE;
+ svga_define_texture_level(tex, 0, transfer->level);
}
FREE(st->swbuf);
}
+/**
+ * Mark the given texture face/level as being defined.
+ */
+static INLINE void
+svga_define_texture_level(struct svga_texture *tex,
+ unsigned face,unsigned level)
+{
+ assert(face < Elements(tex->defined));
+ assert(level < Elements(tex->defined[0]));
+ tex->defined[face][level] = TRUE;
+}
+
+
struct pipe_resource *
svga_texture_create(struct pipe_screen *screen,
const struct pipe_resource *template);