31 if (
desc.fColorAttachment.fTextureInfo.isValid()) {
34 SkASSERT(
desc.fSampleCount ==
desc.fColorAttachment.fTextureInfo.numSamples() ||
35 1 ==
desc.fColorAttachment.fTextureInfo.numSamples());
38 if (
desc.fDepthStencilAttachment.fTextureInfo.isValid()) {
39 SkASSERT(
desc.fSampleCount ==
desc.fDepthStencilAttachment.fTextureInfo.numSamples());
45RenderPassTask::RenderPassTask(DrawPassList passes,
48 : fDrawPasses(
std::move(passes)), fRenderPassDesc(
desc), fTarget(
std::move(
target)) {}
57 SKGPU_LOG_W(
"Failed to instantiate RenderPassTask target. Will not create renderpass!");
59 fTarget->dimensions().width(), fTarget->dimensions().height());
65 for (
const auto& drawPass: fDrawPasses) {
66 if (!drawPass->prepareResources(resourceProvider, runtimeDict, fRenderPassDesc)) {
89 SkASSERT(fTarget && fTarget->isInstantiated());
91 if (fTarget->texture() == replayData.
fTarget) {
103 SkASSERT(fTarget->numSamples() == 1 &&
107 if (!colorAttachment) {
108 SKGPU_LOG_W(
"Could not get Color attachment for RenderPassTask");
111 resolveAttachment = fTarget->refTexture();
113 colorAttachment = fTarget->refTexture();
119 SkASSERT(fTarget->isInstantiated());
121 fTarget->texture()->textureInfo(), fTarget->dimensions());
124 if (!depthStencilAttachment) {
125 SKGPU_LOG_W(
"Could not get DepthStencil attachment for RenderPassTask");
134 std::move(colorAttachment),
135 std::move(resolveAttachment),
136 std::move(depthStencilAttachment),
#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 *, ScratchResourceManager *, const RuntimeEffectDictionary *) override
sk_sp< Texture > findOrCreateDiscardableMSAAAttachment(SkISize dimensions, const TextureInfo &)
sk_sp< Texture > findOrCreateDepthStencilAttachment(SkISize dimensions, const TextureInfo &)
void notifyResourcesConsumed()
uint32_t numSamples() const
static bool InstantiateIfNotLazy(ResourceProvider *, TextureProxy *)
static SkRect Make(const SkISize &size)
AttachmentDesc fDepthStencilAttachment
AttachmentDesc fColorResolveAttachment
AttachmentDesc fColorAttachment