30 if (desc.fColorAttachment.fTextureInfo.isValid()) {
33 SkASSERT(desc.fSampleCount == desc.fColorAttachment.fTextureInfo.numSamples() ||
34 1 == desc.fColorAttachment.fTextureInfo.numSamples());
37 if (desc.fDepthStencilAttachment.fTextureInfo.isValid()) {
38 SkASSERT(desc.fSampleCount == desc.fDepthStencilAttachment.fTextureInfo.numSamples());
44RenderPassTask::RenderPassTask(DrawPassList passes,
47 : fDrawPasses(
std::move(passes)), fRenderPassDesc(desc), fTarget(
std::move(
target)) {}
55 SKGPU_LOG_W(
"Failed to instantiate RenderPassTask target. Will not create renderpass!");
57 fTarget->dimensions().width(), fTarget->dimensions().height());
63 for (
const auto& drawPass: fDrawPasses) {
64 if (!drawPass->prepareResources(resourceProvider, runtimeDict, fRenderPassDesc)) {
68 return Status::kSuccess;
81 SkASSERT(fTarget && fTarget->isInstantiated());
83 if (fTarget->texture() == replayData.
fTarget) {
95 SkASSERT(fTarget->numSamples() == 1 &&
99 if (!colorAttachment) {
100 SKGPU_LOG_W(
"Could not get Color attachment for RenderPassTask");
101 return Status::kFail;
103 resolveAttachment = fTarget->refTexture();
105 colorAttachment = fTarget->refTexture();
111 SkASSERT(fTarget->isInstantiated());
113 fTarget->texture()->textureInfo(), fTarget->dimensions());
116 if (!depthStencilAttachment) {
117 SKGPU_LOG_W(
"Could not get DepthStencil attachment for RenderPassTask");
118 return Status::kFail;
126 std::move(colorAttachment),
127 std::move(resolveAttachment),
128 std::move(depthStencilAttachment),
131 return Status::kSuccess;
133 return Status::kFail;
#define SKGPU_LOG_W(fmt,...)
virtual SkISize getDepthAttachmentDimensions(const TextureInfo &, const SkISize colorAttachmentDimensions) const
bool addRenderPass(const RenderPassDesc &, sk_sp< Texture > colorTexture, sk_sp< Texture > resolveTexture, sk_sp< Texture > depthStencilTexture, SkRect viewport, const DrawPassList &drawPasses)
void clearReplayTranslation()
void setReplayTranslation(SkIVector translation)
const Caps * caps() const
ResourceProvider * resourceProvider() const
~RenderPassTask() override
static sk_sp< RenderPassTask > Make(DrawPassList, const RenderPassDesc &, sk_sp< TextureProxy > target)
Status addCommands(Context *, CommandBuffer *, ReplayTargetData) override
Status prepareResources(ResourceProvider *, const RuntimeEffectDictionary *) override
sk_sp< Texture > findOrCreateDiscardableMSAAAttachment(SkISize dimensions, const TextureInfo &)
sk_sp< Texture > findOrCreateDepthStencilAttachment(SkISize dimensions, const TextureInfo &)
uint32_t numSamples() const
static bool InstantiateIfNotLazy(ResourceProvider *, TextureProxy *)
static SkRect Make(const SkISize &size)
AttachmentDesc fDepthStencilAttachment
AttachmentDesc fColorResolveAttachment
AttachmentDesc fColorAttachment