Add support to gpu command buffers to wrap an external command buffer.
Bug: skia:
Change-Id: Ic679d292f42c61f9f1c36315ae605504a0283306
Reviewed-on: https://skia-review.googlesource.com/c/179521
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/vk/GrVkRenderTarget.h b/src/gpu/vk/GrVkRenderTarget.h
index dc695fc..6ee547d 100644
--- a/src/gpu/vk/GrVkRenderTarget.h
+++ b/src/gpu/vk/GrVkRenderTarget.h
@@ -20,6 +20,7 @@
class GrVkFramebuffer;
class GrVkGpu;
class GrVkImageView;
+class GrVkSecondaryCommandBuffer;
class GrVkStencilAttachment;
struct GrVkImageInfo;
@@ -67,7 +68,10 @@
return fCachedSimpleRenderPass;
}
- bool wrapsSecondaryCommandBuffer() const { return fSecondaryCommandBuffer != VK_NULL_HANDLE; }
+ bool wrapsSecondaryCommandBuffer() const { return fSecondaryCommandBuffer != nullptr; }
+ GrVkSecondaryCommandBuffer* getExternalSecondaryCommandBuffer() const {
+ return fSecondaryCommandBuffer;
+ }
// override of GrRenderTarget
ResolveType getResolveType() const override {
@@ -152,7 +156,7 @@
const GrVkImageInfo& info,
sk_sp<GrVkImageLayout> layout,
const GrVkRenderPass* renderPass,
- VkCommandBuffer secondaryCommandBuffer);
+ GrVkSecondaryCommandBuffer* secondaryCommandBuffer);
bool completeStencilAttachment() override;
@@ -167,10 +171,11 @@
// This is a handle to be used to quickly get compatible GrVkRenderPasses for this render target
GrVkResourceProvider::CompatibleRPHandle fCompatibleRPHandle;
- // Handle to an external secondary command buffer which this GrVkRenderTarget represents. If
- // this is not VK_NULL_HANDLE then the GrVkRenderTarget does not have a real VkImage backing it,
- // and is limited in what it can be used for.
- VkCommandBuffer fSecondaryCommandBuffer = VK_NULL_HANDLE;
+ // If this render target wraps an external VkCommandBuffer, then this pointer will be non-null
+ // and will point to the GrVk object that, in turn, wraps the external VkCommandBuffer. In this
+ // case the render target will not be backed by an actual VkImage and will thus be limited in
+ // terms of what it can be used for.
+ GrVkSecondaryCommandBuffer* fSecondaryCommandBuffer = nullptr;
};
#endif