1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "src/gpu/vk/GrVkDescriptorSet.h"
9
10 #include "src/gpu/vk/GrVkDescriptorPool.h"
11 #include "src/gpu/vk/GrVkGpu.h"
12 #include "src/gpu/vk/GrVkResourceProvider.h"
13
GrVkDescriptorSet(GrVkGpu * gpu,VkDescriptorSet descSet,GrVkDescriptorPool * pool,GrVkDescriptorSetManager::Handle handle)14 GrVkDescriptorSet::GrVkDescriptorSet(GrVkGpu* gpu,
15 VkDescriptorSet descSet,
16 GrVkDescriptorPool* pool,
17 GrVkDescriptorSetManager::Handle handle)
18 : INHERITED(gpu)
19 , fDescSet(descSet)
20 , fPool(pool)
21 , fHandle(handle) {
22 fPool->ref();
23 }
24
freeGPUData() const25 void GrVkDescriptorSet::freeGPUData() const {
26 fPool->unref();
27 }
28
onRecycle() const29 void GrVkDescriptorSet::onRecycle() const {
30 fGpu->resourceProvider().recycleDescriptorSet(this, fHandle);
31 }
32
33