struct svga_context *svga = NULL;
enum pipe_error ret;
+ SVGA_STATS_TIME_PUSH(svgascreen->sws, SVGA_STATS_TIME_CREATECONTEXT);
+
svga = CALLOC_STRUCT(svga_context);
if (!svga)
- goto cleanup;
+ goto done;
LIST_INITHEAD(&svga->dirty_buffers);
svga->pipe.stream_uploader = u_upload_create(&svga->pipe, 1024 * 1024,
PIPE_BIND_VERTEX_BUFFER |
PIPE_BIND_INDEX_BUFFER,
- PIPE_USAGE_STREAM);
+ PIPE_USAGE_STREAM, 0);
if (!svga->pipe.stream_uploader)
goto cleanup;
svga->pipe.const_uploader = u_upload_create(&svga->pipe, 128 * 1024,
PIPE_BIND_CONSTANT_BUFFER,
- PIPE_USAGE_STREAM);
+ PIPE_USAGE_STREAM, 0);
if (!svga->pipe.const_uploader)
goto cleanup;
svga->const0_upload = u_upload_create(&svga->pipe,
CONST0_UPLOAD_DEFAULT_SIZE,
PIPE_BIND_CONSTANT_BUFFER,
- PIPE_USAGE_STREAM);
+ PIPE_USAGE_STREAM, 0);
if (!svga->const0_upload)
goto cleanup;
svga->pred.query_id = SVGA3D_INVALID_ID;
svga->disable_rasterizer = FALSE;
- return &svga->pipe;
+ goto done;
cleanup:
svga_destroy_swtnl(svga);
util_bitmask_destroy(svga->stream_output_id_bm);
util_bitmask_destroy(svga->query_id_bm);
FREE(svga);
- return NULL;
+ svga = NULL;
+
+done:
+ SVGA_STATS_TIME_POP(svgascreen->sws);
+ return svga ? &svga->pipe:NULL;
}