GrVkDescriptorSet.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #ifndef GrVkDescriptorSet_DEFINED
  8. #define GrVkDescriptorSet_DEFINED
  9. #include "include/gpu/vk/GrVkTypes.h"
  10. #include "src/gpu/vk/GrVkDescriptorSetManager.h"
  11. #include "src/gpu/vk/GrVkResource.h"
  12. class GrVkDescriptorPool;
  13. class GrVkGpu;
  14. class GrVkDescriptorSet : public GrVkRecycledResource {
  15. public:
  16. GrVkDescriptorSet(VkDescriptorSet descSet,
  17. GrVkDescriptorPool* pool,
  18. GrVkDescriptorSetManager::Handle handle);
  19. ~GrVkDescriptorSet() override {}
  20. VkDescriptorSet descriptorSet() const { return fDescSet; }
  21. #ifdef SK_TRACE_VK_RESOURCES
  22. void dumpInfo() const override {
  23. SkDebugf("GrVkDescriptorSet: %d (%d refs)\n", fDescSet, this->getRefCnt());
  24. }
  25. #endif
  26. private:
  27. void freeGPUData(GrVkGpu* gpu) const override;
  28. void abandonGPUData() const override;
  29. void onRecycle(GrVkGpu* gpu) const override;
  30. VkDescriptorSet fDescSet;
  31. SkDEBUGCODE(mutable) GrVkDescriptorPool* fPool;
  32. GrVkDescriptorSetManager::Handle fHandle;
  33. };
  34. #endif