Recycle small uniform buffers.
BUG=skia:5031
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2159333002
Review-Url: https://codereview.chromium.org/2159333002
diff --git a/src/gpu/vk/GrVkBuffer.h b/src/gpu/vk/GrVkBuffer.h
index 232de17..b400e09 100644
--- a/src/gpu/vk/GrVkBuffer.h
+++ b/src/gpu/vk/GrVkBuffer.h
@@ -53,7 +53,7 @@
bool fDynamic;
};
- class Resource : public GrVkResource {
+ class Resource : public GrVkRecycledResource {
public:
Resource(VkBuffer buf, const GrVkAlloc& alloc, Type type)
: INHERITED(), fBuffer(buf), fAlloc(alloc), fType(type) {}
@@ -70,7 +70,9 @@
private:
void freeGPUData(const GrVkGpu* gpu) const override;
- typedef GrVkResource INHERITED;
+ void onRecycle(GrVkGpu* gpu) const override { this->unref(gpu); }
+
+ typedef GrVkRecycledResource INHERITED;
};
// convenience routine for raw buffer creation