st/nine: Dirty MANAGED buffers at Lock time
authorAxel Davy <axel.davy@ens.fr>
Tue, 13 Dec 2016 00:16:21 +0000 (01:16 +0100)
committerAxel Davy <axel.davy@ens.fr>
Tue, 20 Dec 2016 22:47:08 +0000 (23:47 +0100)
Tests suggest MANAGED buffers are made dirty
at Lock time, not at Unlock time.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/buffer9.c

index b22713b35178b77f10deaf16e442e65b2d5f6bc6..ca4e4380277a06b46353bfb36437fdf921e7ad39 100644 (file)
@@ -244,6 +244,9 @@ NineBuffer9_Lock( struct NineBuffer9 *This,
                     nine_csmt_process(This->base.base.device);
             } else
                 u_box_union_2d(&This->managed.dirty_box, &This->managed.dirty_box, &box);
+            /* Tests trying to draw while the buffer is locked show that
+             * MANAGED buffers are made dirty at Lock time */
+            BASEBUF_REGISTER_UPDATE(This);
         }
         *ppbData = (char *)This->managed.data + OffsetToLock;
         DBG("returning pointer %p\n", *ppbData);
@@ -412,8 +415,6 @@ NineBuffer9_Unlock( struct NineBuffer9 *This )
                 nine_context_get_pipe_release(device);
         } else if (This->maps[This->nmaps].should_destroy_buf)
             nine_upload_release_buffer(device->buffer_upload, This->maps[This->nmaps].buf);
-    } else {
-        BASEBUF_REGISTER_UPDATE(This);
     }
     return D3D_OK;
 }