Remove need for gpu when unrefing managed resources.
Metal and D3D don't require the GrGpu to delete resources, and for
Vulkan, we'll store the GrVkGpu in each individual resource. This will
allow us to use sk_sp<SomeManagedResource> in the future.
Bug: skia:9935
Change-Id: Id51022b935ad360367976a6bdf60cdda9e3f7dee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276456
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/vk/GrVkDescriptorSet.cpp b/src/gpu/vk/GrVkDescriptorSet.cpp
index ce029fc..5b70e56 100644
--- a/src/gpu/vk/GrVkDescriptorSet.cpp
+++ b/src/gpu/vk/GrVkDescriptorSet.cpp
@@ -11,21 +11,22 @@
#include "src/gpu/vk/GrVkGpu.h"
#include "src/gpu/vk/GrVkResourceProvider.h"
-GrVkDescriptorSet::GrVkDescriptorSet(VkDescriptorSet descSet,
+GrVkDescriptorSet::GrVkDescriptorSet(GrVkGpu* gpu,
+ VkDescriptorSet descSet,
GrVkDescriptorPool* pool,
GrVkDescriptorSetManager::Handle handle)
- : fDescSet(descSet)
+ : INHERITED(gpu)
+ , fDescSet(descSet)
, fPool(pool)
, fHandle(handle) {
fPool->ref();
}
-void GrVkDescriptorSet::freeGPUData(GrGpu* gpu) const {
- fPool->unref(gpu);
+void GrVkDescriptorSet::freeGPUData() const {
+ fPool->unref();
}
-void GrVkDescriptorSet::onRecycle(GrGpu* gpu) const {
- GrVkGpu* vkGpu = (GrVkGpu*)gpu;
- vkGpu->resourceProvider().recycleDescriptorSet(this, fHandle);
+void GrVkDescriptorSet::onRecycle() const {
+ fGpu->resourceProvider().recycleDescriptorSet(this, fHandle);
}