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

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

Issue 2035853002: Add support for finding/creating general GrVkRenderPass from the VkResourceProvider. (Closed) Base URL: https://skia.googlesource.com/skia.git@renderPass
Patch Set: Created 4 years, 7 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
Index: src/gpu/vk/GrVkResourceProvider.h
diff --git a/src/gpu/vk/GrVkResourceProvider.h b/src/gpu/vk/GrVkResourceProvider.h
index 79be726a34336bd19475a5cfe7f593e819e5e488..641aad780321dccbaaad03330ec269c776d62266 100644
--- a/src/gpu/vk/GrVkResourceProvider.h
+++ b/src/gpu/vk/GrVkResourceProvider.h
@@ -12,6 +12,7 @@
#include "GrResourceHandle.h"
#include "GrVkDescriptorPool.h"
#include "GrVkPipelineState.h"
+#include "GrVkRenderPass.h"
#include "GrVkResource.h"
#include "GrVkUtil.h"
#include "SkTArray.h"
@@ -27,7 +28,6 @@ class GrTextureParams;
class GrVkCommandBuffer;
class GrVkGpu;
class GrVkPipeline;
-class GrVkRenderPass;
class GrVkRenderTarget;
class GrVkSampler;
@@ -59,21 +59,23 @@ public:
// findCompatibleRenderPass(GrVkRenderTarget&, CompatibleRPHandle*).
const GrVkRenderPass* findCompatibleRenderPass(const CompatibleRPHandle& compatibleHandle);
-#if 0
- // TODO:
+ // Finds or creates a render pass that matches the target and LoadStoreOps, increments the
+ // refcount, and returns. The caller can optionally pass in a pointer to a CompatibleRPHandle.
+ // If this is non null it will be set to a handle that can be used in the furutre to quickly
+ // return a GrVkRenderPasses without the need inspecting a GrVkRenderTarget.
const GrVkRenderPass* findRenderPass(const GrVkRenderTarget& target,
- VkAttachmentLoadOp colorLoad,
- VkAttachmentStoreOp colorStore,
- VkAttachmentLoadOp stencilLoad,
- VkAttachmentStoreOp stencilStore,
+ const GrVkRenderPass::LoadStoreOps& colorOps,
+ const GrVkRenderPass::LoadStoreOps& resolveOps,
+ const GrVkRenderPass::LoadStoreOps& stencilOps,
CompatibleRPHandle* compatibleHandle = nullptr);
+ // The CompatibleRPHandle must be a valid handle previously set by a call to findRenderPass or
+ // findCompatibleRenderPass.
const GrVkRenderPass* findRenderPass(const CompatibleRPHandle& compatibleHandle,
- VkAttachmentLoadOp colorLoad,
- VkAttachmentStoreOp colorStore,
- VkAttachmentLoadOp stencilLoad,
- VkAttachmentStoreOp stencilStore);
-#endif
+ const GrVkRenderPass::LoadStoreOps& colorOps,
+ const GrVkRenderPass::LoadStoreOps& resolveOps,
+ const GrVkRenderPass::LoadStoreOps& stencilOps);
+
GrVkCommandBuffer* createCommandBuffer();
void checkCommandBuffers();
@@ -175,6 +177,11 @@ private:
return fRenderPasses[0];
}
+ GrVkRenderPass* getRenderPass(const GrVkGpu* gpu,
+ const GrVkRenderPass::LoadStoreOps& colorOps,
+ const GrVkRenderPass::LoadStoreOps& resolveOps,
+ const GrVkRenderPass::LoadStoreOps& stencilOps);
+
void releaseResources(const GrVkGpu* gpu);
void abandonResources();

Powered by Google App Engine
This is Rietveld 408576698