Dawn: implement a ring buffer for uniform uploads.

GrDawnGpu vends ring buffer slices out of a persistent (larger) buffer.

GrDawnProgramDataManager::setData() now returns a BindGroup containing
the (possibly new) UBO bindings, as well as the texture and sampler
bindings.
Change-Id: Id6694d6f44a815cfbffe4293779bf9bf558a2365
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235866
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
diff --git a/src/gpu/dawn/GrDawnGpuCommandBuffer.cpp b/src/gpu/dawn/GrDawnGpuCommandBuffer.cpp
index 020207e..312663d 100644
--- a/src/gpu/dawn/GrDawnGpuCommandBuffer.cpp
+++ b/src/gpu/dawn/GrDawnGpuCommandBuffer.cpp
@@ -326,7 +326,8 @@
                                                                colorFormat, hasDepthStencil,
                                                                stencilFormat, &desc);
     SkASSERT(program);
-    program->setData(primProc, fRenderTarget, fOrigin, pipeline);
+    auto bindGroup = program->setData(fGpu, fRenderTarget, fOrigin, primProc, pipeline,
+                                      primProcProxies);
 
     std::vector<dawn::VertexBufferDescriptor> inputs;
     std::vector<dawn::VertexAttributeDescriptor> vertexAttributes;
@@ -404,7 +405,7 @@
     rpDesc.colorStates = colorStates;
     dawn::RenderPipeline renderPipeline = fGpu->device().CreateRenderPipeline(&rpDesc);
     fPassEncoder.SetPipeline(renderPipeline);
-    fPassEncoder.SetBindGroup(0, program->fBindGroup, 0, nullptr);
+    fPassEncoder.SetBindGroup(0, bindGroup, 0, nullptr);
     if (pipeline.isStencilEnabled()) {
         fPassEncoder.SetStencilReference(pipeline.getUserStencil()->fFront.fRef);
     }