summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2019-05-10 11:06:49 -0700
committerChia-I Wu <[email protected]>2019-05-14 17:00:22 +0000
commit08241624ad669be1ef846c32c08d48c7965795a6 (patch)
treeee08430795070aebda43245298b41e428a6f67fd /src
parent76e45534d274ac1664775bb6c394a32859995059 (diff)
virgl: comment on a sync issue in transfers
Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Alexandros Frantzis <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/virgl/virgl_buffer.c10
-rw-r--r--src/gallium/drivers/virgl/virgl_texture.c10
2 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_buffer.c b/src/gallium/drivers/virgl/virgl_buffer.c
index d4bde39096e..f955b7c624b 100644
--- a/src/gallium/drivers/virgl/virgl_buffer.c
+++ b/src/gallium/drivers/virgl/virgl_buffer.c
@@ -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);
diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c
index 19ae6ff1d3a..53cd038e500 100644
--- a/src/gallium/drivers/virgl/virgl_texture.c
+++ b/src/gallium/drivers/virgl/virgl_texture.c
@@ -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);