[graphite] Expose Dawn async buffer mapping through Buffer class
Previously this was a hidden detail of DawnBuffer. onMap would trigger
an async mapping and then busy wait. Now Buffer has an async mapping
interface that the rest of Graphite uses.
For GPU->CPU xfers buffers can be attached to CommandBuffer. When the
command buffer is submitted. These get asynchronously mapped after the
command buffer is submitted and the wrapping GpuWorkSubmission doesn't
consider the work finished until maps are done. Context uses this in
read pixels methods.
kXferCpuToGpu buffers are already pre-mapped on creation prior to this
change. After this change they are remapped asynchronously before being
added back to ResourceCache. Thus, all map() calls on them return
immediately as they are either pre-mapped or re-mapped before use.
In order to enable compute unit tests to examine buffers a tick
virtual is added to GraphiteTestContext to force async mappings to
Reviewed-by: Greg Daniel <email@example.com>
Commit-Queue: Brian Salomon <firstname.lastname@example.org>
34 files changed