egdaniel | a95220d | 2016-07-21 11:50:37 -0700 | [diff] [blame] | 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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "src/gpu/vk/GrVkDescriptorSet.h" |
egdaniel | a95220d | 2016-07-21 11:50:37 -0700 | [diff] [blame] | 9 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 10 | #include "src/gpu/vk/GrVkDescriptorPool.h" |
| 11 | #include "src/gpu/vk/GrVkGpu.h" |
| 12 | #include "src/gpu/vk/GrVkResourceProvider.h" |
egdaniel | a95220d | 2016-07-21 11:50:37 -0700 | [diff] [blame] | 13 | |
| 14 | GrVkDescriptorSet::GrVkDescriptorSet(VkDescriptorSet descSet, |
| 15 | GrVkDescriptorPool* pool, |
| 16 | GrVkDescriptorSetManager::Handle handle) |
| 17 | : fDescSet(descSet) |
| 18 | , fPool(pool) |
| 19 | , fHandle(handle) { |
| 20 | fPool->ref(); |
| 21 | } |
| 22 | |
Jim Van Verth | 3e19216 | 2020-03-10 16:23:16 -0400 | [diff] [blame] | 23 | void GrVkDescriptorSet::freeGPUData(GrGpu* gpu) const { |
egdaniel | a95220d | 2016-07-21 11:50:37 -0700 | [diff] [blame] | 24 | fPool->unref(gpu); |
| 25 | } |
| 26 | |
Jim Van Verth | 3e19216 | 2020-03-10 16:23:16 -0400 | [diff] [blame] | 27 | void GrVkDescriptorSet::onRecycle(GrGpu* gpu) const { |
| 28 | GrVkGpu* vkGpu = (GrVkGpu*)gpu; |
| 29 | vkGpu->resourceProvider().recycleDescriptorSet(this, fHandle); |
egdaniel | a95220d | 2016-07-21 11:50:37 -0700 | [diff] [blame] | 30 | } |
| 31 | |