aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkUniformBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/vk/GrVkUniformBuffer.cpp')
-rw-r--r--src/gpu/vk/GrVkUniformBuffer.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gpu/vk/GrVkUniformBuffer.cpp b/src/gpu/vk/GrVkUniformBuffer.cpp
index c3899b01b9..ac013f7dfe 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);