virgl: comment on a sync issue in transfers

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This commit is contained in:
Chia-I Wu 2019-05-10 11:06:49 -07:00
parent 76e45534d2
commit 08241624ad
2 changed files with 20 additions and 0 deletions

View file

@ -53,6 +53,16 @@ static void *virgl_buffer_transfer_map(struct pipe_context *ctx,
vs->vws->transfer_get(vs->vws, vbuf->hw_res, box, trans->base.stride,
trans->l_stride, trans->offset, level);
/* XXX Consider
*
* glBufferSubData(GL_ARRAY_BUFFER, 0, 12, data1);
* glDrawArrays(..);
* glFlush();
* glBufferSubData(GL_ARRAY_BUFFER, 0, 12, data2)
*
* readback and flush are both false in the second glBufferSubData call.
* The draw call might end up seeing data2.
*/
if (readback || flush)
vs->vws->resource_wait(vs->vws, vbuf->hw_res);

View file

@ -143,6 +143,16 @@ static void *texture_transfer_map_plain(struct pipe_context *ctx,
vws->transfer_get(vws, vtex->hw_res, box, trans->base.stride,
trans->l_stride, trans->offset, level);
/* XXX Consider
*
* glTexImage2D(..., data1);
* glDrawArrays();
* glFlush();
* glTexImage2D(..., data2);
*
* readback and flush are both false in the second glTexImage2D call. The
* draw call might end up seeing data2.
*/
if (readback || flush)
vws->resource_wait(vws, vtex->hw_res);