Index: src/gpu/vk/GrVkUniformBuffer.cpp |
diff --git a/src/gpu/vk/GrVkUniformBuffer.cpp b/src/gpu/vk/GrVkUniformBuffer.cpp |
index c3899b01b9437595f0174d9bc4f18df9e60e4560..ac013f7dfe7a8b3ae178d992eec5a3dd4892c3f9 100644 |
--- a/src/gpu/vk/GrVkUniformBuffer.cpp |
+++ b/src/gpu/vk/GrVkUniformBuffer.cpp |
@@ -82,6 +82,18 @@ const GrVkResource* GrVkUniformBuffer::CreateResource(GrVkGpu* gpu, size_t size) |
return resource; |
} |
+const GrVkBuffer::Resource* GrVkUniformBuffer::createResource(GrVkGpu* gpu, |
+ const GrVkBuffer::Desc& descriptor) { |
+ const GrVkResource* vkResource; |
+ if (descriptor.fSizeInBytes <= GrVkUniformBuffer::kStandardSize) { |
+ GrVkResourceProvider& provider = gpu->resourceProvider(); |
+ vkResource = provider.findOrCreateStandardUniformBufferResource(); |
+ } else { |
+ vkResource = CreateResource(gpu, descriptor.fSizeInBytes); |
+ } |
+ return (const GrVkBuffer::Resource*) vkResource; |
+} |
+ |
void GrVkUniformBuffer::Resource::onRecycle(GrVkGpu* gpu) const { |
if (fAlloc.fSize <= GrVkUniformBuffer::kStandardSize) { |
gpu->resourceProvider().recycleStandardUniformBufferResource(this); |