svga_buffer_create_hw_storage(struct svga_screen *ss,
struct svga_buffer *sbuf)
{
+ assert(!sbuf->user);
+
if(!sbuf->hwbuf) {
unsigned alignment = sbuf->base.alignment;
unsigned usage = 0;
if(sbuf->handle)
svga_buffer_destroy_host_surface(ss, sbuf);
+ if(sbuf->uploaded.buffer)
+ pipe_buffer_reference(&sbuf->uploaded.buffer, NULL);
+
if(sbuf->hwbuf)
svga_buffer_destroy_hw_storage(ss, sbuf);
/**
- * Copy the contents of the user buffer / malloc buffer to a hardware buffer.
+ * Copy the contents of the malloc buffer to a hardware buffer.
*/
static INLINE enum pipe_error
svga_buffer_update_hw(struct svga_screen *ss, struct svga_buffer *sbuf)
{
+ assert(!sbuf->user);
if(!sbuf->hwbuf) {
enum pipe_error ret;
void *map;
sbuf = svga_buffer(buf);
assert(!sbuf->map.count);
+ assert(!sbuf->user);
if(!sbuf->handle) {
ret = svga_buffer_create_host_surface(ss, sbuf);