if (ret)
goto retry;
- if (svga->curr.any_user_vertex_buffers) {
- ret = svga_hwtnl_flush( svga->hwtnl );
- if (ret)
- goto retry;
- }
-
return PIPE_OK;
retry:
if (ret)
goto retry;
- if (svga->curr.any_user_vertex_buffers) {
- ret = svga_hwtnl_flush( svga->hwtnl );
- if (ret)
- goto retry;
- }
-
return 0;
retry:
* Host surface handle.
*
* This is a platform independent abstraction for host SID. We create when
- * trying to bind
+ * trying to bind.
+ *
+ * Only set for non-user buffers.
*/
struct svga_winsys_surface *handle;
* A piece of GMR memory, with the same size of the buffer. It is created
* when mapping the buffer, and will be used to upload vertex data to the
* host.
+ *
+ * Only set for non-user buffers.
*/
struct svga_winsys_buffer *hwbuf;
svga_buffer_create_host_surface(struct svga_screen *ss,
struct svga_buffer *sbuf)
{
+ assert(!sbuf->user);
+
if(!sbuf->handle) {
sbuf->key.flags = 0;
struct svga_buffer *sbuf = svga_buffer(resource);
assert(sbuf->user);
+ assert(!sbuf->dma.pending);
+ assert(!sbuf->handle);
+ assert(!sbuf->hwbuf);
/*
* Release any uploaded user buffer.
pipe_mutex_lock(ss->swc_mutex);
- if (offset + size > resource->width0) {
- /*
- * User buffers shouldn't have DMA directly, unless
- * SVGA_COMBINE_USERBUFFERS is not set.
- */
-
- if (sbuf->dma.pending) {
- svga_buffer_upload_flush(svga, sbuf);
- }
-
- if (sbuf->handle) {
- svga_buffer_destroy_host_surface(ss, sbuf);
- }
-
- if (sbuf->hwbuf) {
- svga_buffer_destroy_hw_storage(ss, sbuf);
- }
-
- sbuf->key.size.width = sbuf->b.b.width0 = offset + size;
- }
+ sbuf->key.size.width = sbuf->b.b.width0 = offset + size;
pipe_mutex_unlock(ss->swc_mutex);
* userbuffers now and try to combine multiple userbuffers from
* multiple draw calls into a single host buffer for performance.
*/
- if (svga->curr.any_user_vertex_buffers &&
- SVGA_COMBINE_USERBUFFERS)
- {
+ if (svga->curr.any_user_vertex_buffers) {
ret = upload_user_buffers( svga );
if (ret)
return ret;