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/GrDawnProgramBuilder.h b/src/gpu/dawn/GrDawnProgramBuilder.h
index 319dff9..a98f270 100644
--- a/src/gpu/dawn/GrDawnProgramBuilder.h
+++ b/src/gpu/dawn/GrDawnProgramBuilder.h
@@ -60,8 +60,7 @@
     std::unique_ptr<GrGLSLXferProcessor> fXferProcessor;
     std::unique_ptr<std::unique_ptr<GrGLSLFragmentProcessor>[]> fFragmentProcessors;
     int fFragmentProcessorCnt;
-    dawn::Buffer fGeometryUniformBuffer;
-    dawn::Buffer fFragmentUniformBuffer;
+    dawn::BindGroupLayout fBindGroupLayout;
     dawn::PipelineLayout fPipelineLayout;
     dawn::BindGroup fBindGroup;
     dawn::ColorStateDescriptor fColorState;
@@ -71,8 +70,9 @@
     BuiltinUniformHandles fBuiltinUniformHandles;
 
     void setRenderTargetState(const GrRenderTarget*, GrSurfaceOrigin);
-    void setData(const GrPrimitiveProcessor&, const GrRenderTarget*, GrSurfaceOrigin,
-                 const GrPipeline&);
+    dawn::BindGroup setData(GrDawnGpu* gpu, const GrRenderTarget*, GrSurfaceOrigin origin,
+                            const GrPrimitiveProcessor&, const GrPipeline&,
+                            const GrTextureProxy* const primProcTextures[]);
 };
 
 class GrDawnProgramBuilder : public GrGLSLProgramBuilder {