Make it easier to insert/remove error branches.
svga = CALLOC_STRUCT(svga_context);
if (svga == NULL)
svga = CALLOC_STRUCT(svga_context);
if (svga == NULL)
svga->pipe.winsys = screen->winsys;
svga->pipe.screen = screen;
svga->pipe.winsys = screen->winsys;
svga->pipe.screen = screen;
svga->swc = svgascreen->sws->context_create(svgascreen->sws);
if(!svga->swc)
svga->swc = svgascreen->sws->context_create(svgascreen->sws);
if(!svga->swc)
svga_init_blend_functions(svga);
svga_init_blit_functions(svga);
svga_init_blend_functions(svga);
svga_init_blit_functions(svga);
svga->debug.disable_shader = debug_get_num_option("SVGA_DISABLE_SHADER", ~0);
if (!svga_init_swtnl(svga))
svga->debug.disable_shader = debug_get_num_option("SVGA_DISABLE_SHADER", ~0);
if (!svga_init_swtnl(svga))
svga->upload_ib = u_upload_create( svga->pipe.screen,
32 * 1024,
16,
PIPE_BUFFER_USAGE_INDEX );
if (svga->upload_ib == NULL)
svga->upload_ib = u_upload_create( svga->pipe.screen,
32 * 1024,
16,
PIPE_BUFFER_USAGE_INDEX );
if (svga->upload_ib == NULL)
svga->upload_vb = u_upload_create( svga->pipe.screen,
128 * 1024,
16,
PIPE_BUFFER_USAGE_VERTEX );
if (svga->upload_vb == NULL)
svga->upload_vb = u_upload_create( svga->pipe.screen,
128 * 1024,
16,
PIPE_BUFFER_USAGE_VERTEX );
if (svga->upload_vb == NULL)
svga->hwtnl = svga_hwtnl_create( svga,
svga->upload_ib,
svga->swc );
if (svga->hwtnl == NULL)
svga->hwtnl = svga_hwtnl_create( svga,
svga->upload_ib,
svga->swc );
if (svga->hwtnl == NULL)
ret = svga_emit_initial_state( svga );
if (ret)
ret = svga_emit_initial_state( svga );
if (ret)
/* Avoid shortcircuiting state with initial value of zero.
*/
/* Avoid shortcircuiting state with initial value of zero.
*/
svga_hwtnl_destroy( svga->hwtnl );
svga_hwtnl_destroy( svga->hwtnl );
u_upload_destroy( svga->upload_vb );
u_upload_destroy( svga->upload_vb );
u_upload_destroy( svga->upload_ib );
u_upload_destroy( svga->upload_ib );
svga_destroy_swtnl(svga);
svga_destroy_swtnl(svga);
svga->swc->destroy(svga->swc);
svga->swc->destroy(svga->swc);