u_upload_data(st->constbuf_uploader, 0, sizeof(constants),
st->ctx->Const.UniformBufferOffsetAlignment,
&constants, &cb.buffer_offset, &cb.buffer);
+ if (!cb.buffer)
+ goto fail_constant_upload;
+
u_upload_unmap(st->constbuf_uploader);
} else {
cb.buffer = NULL;
cso_save_constant_buffer_slot0(st->cso_context, PIPE_SHADER_FRAGMENT);
cso_set_constant_buffer(st->cso_context, PIPE_SHADER_FRAGMENT, 0, &cb);
+
+ pipe_resource_reference(&cb.buffer, NULL);
}
/* Framebuffer_state */
cso_restore_fragment_shader(st->cso_context);
cso_restore_stream_outputs(st->cso_context);
cso_restore_constant_buffer_slot0(st->cso_context, PIPE_SHADER_FRAGMENT);
+fail_constant_upload:
cso_restore_vertex_elements(st->cso_context);
cso_restore_aux_vertex_buffer_slot(st->cso_context);
fail_vertex_upload: