Index: src/gpu/vk/GrVkUniformBuffer.h |
diff --git a/src/gpu/vk/GrVkUniformBuffer.h b/src/gpu/vk/GrVkUniformBuffer.h |
index ed6c8a0aaba435a111b65430bf5661e1696add19..7aa3af6f8d489c87259af6697b0e16eadc92bf2f 100644 |
--- a/src/gpu/vk/GrVkUniformBuffer.h |
+++ b/src/gpu/vk/GrVkUniformBuffer.h |
@@ -15,7 +15,9 @@ class GrVkGpu; |
class GrVkUniformBuffer : public GrVkBuffer { |
public: |
- static GrVkUniformBuffer* Create(GrVkGpu* gpu, size_t size, bool dynamic); |
+ static GrVkUniformBuffer* Create(GrVkGpu* gpu, size_t size); |
+ static const GrVkResource* CreateResource(GrVkGpu* gpu, size_t size); |
+ static const size_t kStandardSize = 256; |
void* map(const GrVkGpu* gpu) { |
return this->vkMap(gpu); |
@@ -29,18 +31,27 @@ public: |
bool* createdNewBuffer) { |
return this->vkUpdateData(gpu, src, srcSizeInBytes, createdNewBuffer); |
} |
- void release(const GrVkGpu* gpu) { |
- this->vkRelease(gpu); |
- } |
- void abandon() { |
- this->vkAbandon(); |
- } |
+ void release(const GrVkGpu* gpu) { this->vkRelease(gpu); } |
+ void abandon() { this->vkAbandon(); } |
private: |
- GrVkUniformBuffer(const GrVkBuffer::Desc& desc, const GrVkBuffer::Resource* resource) |
- : INHERITED(desc, resource) { |
+ class Resource : public GrVkBuffer::Resource { |
+ public: |
+ Resource(VkBuffer buf, const GrVkAlloc& alloc) |
+ : INHERITED(buf, alloc, kUniform_Type) {} |
+ |
+ void onRecycle(GrVkGpu* gpu) const override; |
+ |
+ typedef GrVkBuffer::Resource INHERITED; |
}; |
+ GrVkUniformBuffer(GrVkGpu* gpu, const GrVkBuffer::Desc& desc, |
+ const GrVkUniformBuffer::Resource* resource) |
+ : INHERITED(desc, resource) |
+ , fGpu(gpu) {} |
+ |
+ GrVkGpu* fGpu; |
+ |
typedef GrVkBuffer INHERITED; |
}; |