1 /* 2 * Copyright 2019 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef GrDawnProgramDataManager_DEFINED 9 #define GrDawnProgramDataManager_DEFINED 10 11 #include "src/gpu/ganesh/GrUniformDataManager.h" 12 13 #include "src/gpu/ganesh/GrSPIRVUniformHandler.h" 14 #include "src/gpu/ganesh/dawn/GrDawnRingBuffer.h" 15 #include "webgpu/webgpu_cpp.h" 16 17 #include "src/base/SkAutoMalloc.h" 18 19 class GrDawnGpu; 20 class GrDawnUniformBuffer; 21 22 class GrDawnProgramDataManager : public GrUniformDataManager { 23 public: 24 typedef GrSPIRVUniformHandler::UniformInfoArray UniformInfoArray; 25 26 GrDawnProgramDataManager(const UniformInfoArray&, uint32_t uniformBufferSize); 27 uniformBufferSize()28 uint32_t uniformBufferSize() const { return fUniformSize; } 29 30 wgpu::BindGroup uploadUniformBuffers(GrDawnGpu* gpu, wgpu::BindGroupLayout layout); 31 32 private: 33 wgpu::BindGroup fBindGroup; 34 }; 35 36 #endif 37