Skip to content

WIP: virgl: Add support for INVALIDATE_BUFFER and try to streamline flushes

Gert Wollny requested to merge gerddie/mesa:virgl-inline-transfer-checks into master

This MR is a contribution to the discussion in !666 (closed)

The first patch adds support for CAP_INVALIDATE_BUFFER and will set the clean mask when a buffer is invalidated.

The second patch deals with the inline transfer code path and moves the marking of the resource as dirty after the check whether a flush is needed. The logic behind this is that a clean resource shouldn't need a flush and wait.

The ugly truth is that this latter change breaks, e.g. Alien Isolation, that makes a lot use of sequences like

glBindBuffer(GL_UNIFORM_BUFFER, buffer);
glInvalidateBufferData(buffer);
glBufferSubData((GL_UNIFORM_BUFFER, 0, len, data);

My hunch is that there are actually other resources that would need to be flushed and waited for before the command buffer (including the inline transfer) should be send, and that the wait that we were doing in the inline transfers only covered this up.

Merge request reports