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

Unified Diff: src/gpu/vk/GrVkCopyManager.h

Issue 2274663005: Add GrVkCopyPipeline to handle vulkan copies as draws (Closed) Base URL: https://skia.googlesource.com/skia.git@compatibleCopyDS
Patch Set: indent nits Created 4 years, 3 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/GrVkCommandBuffer.cpp ('k') | src/gpu/vk/GrVkCopyManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkCopyManager.h
diff --git a/src/gpu/vk/GrVkCopyManager.h b/src/gpu/vk/GrVkCopyManager.h
new file mode 100644
index 0000000000000000000000000000000000000000..e19a14402d07404bc4013a9f61491cb61f7d6810
--- /dev/null
+++ b/src/gpu/vk/GrVkCopyManager.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+*/
+
+#ifndef GrVkCopyManager_DEFINED
+#define GrVkCopyManager_DEFINED
+
+#include "GrVkDescriptorSetManager.h"
+
+#include "vk/GrVkDefines.h"
+
+class GrSurface;
+class GrVkCopyPipeline;
+class GrVkGpu;
+class GrVkUniformBuffer;
+class GrVkVertexBuffer;
+struct SkIPoint;
+struct SkIRect;
+
+class GrVkCopyManager {
+public:
+ GrVkCopyManager()
+ : fVertShaderModule(VK_NULL_HANDLE)
+ , fFragShaderModule(VK_NULL_HANDLE)
+ , fPipelineLayout(VK_NULL_HANDLE)
+ , fUniformBuffer(nullptr) {}
+
+ bool copySurfaceAsDraw(GrVkGpu* gpu,
+ GrSurface* dst,
+ GrSurface* src,
+ const SkIRect& srcRect,
+ const SkIPoint& dstPoint);
+
+ void destroyResources(GrVkGpu* gpu);
+ void abandonResources();
+
+private:
+ bool createCopyProgram(GrVkGpu* gpu);
+
+ // Everything below is only created once and shared by all copy draws/pipelines
+ VkShaderModule fVertShaderModule;
+ VkShaderModule fFragShaderModule;
+ VkPipelineShaderStageCreateInfo fShaderStageInfo[2];
+
+ GrVkDescriptorSetManager::Handle fSamplerDSHandle;
+ VkPipelineLayout fPipelineLayout;
+
+ SkAutoTUnref<GrVkVertexBuffer> fVertexBuffer;
+ GrVkUniformBuffer* fUniformBuffer;
+};
+
+#endif
« no previous file with comments | « src/gpu/vk/GrVkCommandBuffer.cpp ('k') | src/gpu/vk/GrVkCopyManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698