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 | |
| 8 | #ifndef GrVkDescriptorSet_DEFINED |
| 9 | #define GrVkDescriptorSet_DEFINED |
| 10 | |
| 11 | #include "GrVkDescriptorSetManager.h" |
| 12 | #include "GrVkResource.h" |
Greg Daniel | 487132b | 2018-12-20 14:09:36 -0500 | [diff] [blame] | 13 | #include "vk/GrVkTypes.h" |
egdaniel | a95220d | 2016-07-21 11:50:37 -0700 | [diff] [blame] | 14 | |
| 15 | class GrVkDescriptorPool; |
| 16 | class GrVkGpu; |
| 17 | |
| 18 | class GrVkDescriptorSet : public GrVkRecycledResource { |
| 19 | public: |
| 20 | GrVkDescriptorSet(VkDescriptorSet descSet, |
| 21 | GrVkDescriptorPool* pool, |
| 22 | GrVkDescriptorSetManager::Handle handle); |
| 23 | |
| 24 | ~GrVkDescriptorSet() override {} |
| 25 | |
| 26 | VkDescriptorSet descriptorSet() const { return fDescSet; } |
| 27 | |
| 28 | #ifdef SK_TRACE_VK_RESOURCES |
| 29 | void dumpInfo() const override { |
| 30 | SkDebugf("GrVkDescriptorSet: %d (%d refs)\n", fDescSet, this->getRefCnt()); |
| 31 | } |
| 32 | #endif |
| 33 | |
| 34 | private: |
Ethan Nicholas | 8e265a7 | 2018-12-12 16:22:40 -0500 | [diff] [blame] | 35 | void freeGPUData(GrVkGpu* gpu) const override; |
Greg Daniel | cef213c | 2017-04-21 11:52:27 -0400 | [diff] [blame] | 36 | void abandonGPUData() const override; |
egdaniel | a95220d | 2016-07-21 11:50:37 -0700 | [diff] [blame] | 37 | void onRecycle(GrVkGpu* gpu) const override; |
| 38 | |
| 39 | VkDescriptorSet fDescSet; |
| 40 | SkDEBUGCODE(mutable) GrVkDescriptorPool* fPool; |
| 41 | GrVkDescriptorSetManager::Handle fHandle; |
| 42 | }; |
| 43 | |
| 44 | #endif |