Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: src/gpu/vk/GrVkDescriptorSet.cpp

Issue 2163673002: Setup system in Vulkan to reuse VkDescriptorSet allocations. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkDescriptorSet.h ('k') | src/gpu/vk/GrVkDescriptorSetManager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkDescriptorSet.cpp
diff --git a/src/gpu/vk/GrVkDescriptorSet.cpp b/src/gpu/vk/GrVkDescriptorSet.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..47a997f5506e7c6669b5de0ecb18aecbce026723
--- /dev/null
+++ b/src/gpu/vk/GrVkDescriptorSet.cpp
@@ -0,0 +1,34 @@
+/*
+* Copyright 2016 Google Inc.
+*
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE file.
+*/
+
+#include "GrVkDescriptorSet.h"
+
+#include "GrVkDescriptorPool.h"
+#include "GrVkGpu.h"
+#include "GrVkResourceProvider.h"
+
+GrVkDescriptorSet::GrVkDescriptorSet(VkDescriptorSet descSet,
+ GrVkDescriptorPool* pool,
+ GrVkDescriptorSetManager::Handle handle)
+ : fDescSet(descSet)
+ , fPool(pool)
+ , fHandle(handle) {
+ fPool->ref();
+}
+
+void GrVkDescriptorSet::freeGPUData(const GrVkGpu* gpu) const {
+ fPool->unref(gpu);
+}
+
+void GrVkDescriptorSet::onRecycle(GrVkGpu* gpu) const {
+ gpu->resourceProvider().recycleDescriptorSet(this, fHandle);
+}
+
+void GrVkDescriptorSet::abandonSubResources() const {
+ fPool->unrefAndAbandon();
+}
+
« no previous file with comments | « src/gpu/vk/GrVkDescriptorSet.h ('k') | src/gpu/vk/GrVkDescriptorSetManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698