Add ddl support to drawing to wrapped vulkan secondary command buffers.
Bug: skia:
Change-Id: I3ddb6b1e923b8c1733b6a0e219efffa36e665fa2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/189282
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index d65320a..d4f5555 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -691,7 +691,8 @@
sk_sp<GrRenderTargetProxy> GrProxyProvider::createLazyRenderTargetProxy(
LazyInstantiateCallback&& callback, const GrBackendFormat& format,
const GrSurfaceDesc& desc, GrSurfaceOrigin origin, GrInternalSurfaceFlags surfaceFlags,
- const TextureInfo* textureInfo, SkBackingFit fit, SkBudgeted budgeted) {
+ const TextureInfo* textureInfo, SkBackingFit fit, SkBudgeted budgeted,
+ bool wrapsVkSecondaryCB) {
SkASSERT((desc.fWidth <= 0 && desc.fHeight <= 0) ||
(desc.fWidth > 0 && desc.fHeight > 0));
@@ -714,13 +715,21 @@
: LazyInstantiationType::kMultipleUse;
if (textureInfo) {
+ // Wrapped vulkan secondary command buffers don't support texturing since we won't have an
+ // actual VkImage to texture from.
+ SkASSERT(!wrapsVkSecondaryCB);
return sk_sp<GrRenderTargetProxy>(new GrTextureRenderTargetProxy(
std::move(callback), lazyType, format, desc, origin, textureInfo->fMipMapped,
fit, budgeted, surfaceFlags));
}
+ GrRenderTargetProxy::WrapsVkSecondaryCB vkSCB =
+ wrapsVkSecondaryCB ? GrRenderTargetProxy::WrapsVkSecondaryCB::kYes
+ : GrRenderTargetProxy::WrapsVkSecondaryCB::kNo;
+
return sk_sp<GrRenderTargetProxy>(new GrRenderTargetProxy(
- std::move(callback), lazyType, format, desc, origin, fit, budgeted, surfaceFlags));
+ std::move(callback), lazyType, format, desc, origin, fit, budgeted, surfaceFlags,
+ vkSCB));
}
sk_sp<GrTextureProxy> GrProxyProvider::MakeFullyLazyProxy(LazyInstantiateCallback&& callback,