44 {
46 desc.fWriteSwizzle = writeSwizzle;
47 desc.fSampleCount = 1;
48
49
51 if (requiresMSAA) {
52 if (caps->msaaRenderToSingleSampledSupport()) {
53 desc.fColorAttachment.fTextureInfo = targetInfo;
54 desc.fColorAttachment.fLoadOp = loadOp;
55 desc.fColorAttachment.fStoreOp = storeOp;
56 desc.fSampleCount = caps->defaultMSAASamplesCount();
57 } else {
58
59
60 auto msaaTextureInfo = caps->getDefaultMSAATextureInfo(targetInfo,
Discardable::kYes);
61 if (msaaTextureInfo.isValid()) {
62 desc.fColorAttachment.fTextureInfo = msaaTextureInfo;
65 } else {
67 }
69
70 desc.fColorResolveAttachment.fTextureInfo = targetInfo;
73 } else {
75 }
76 desc.fColorResolveAttachment.fStoreOp = storeOp;
77
78 desc.fSampleCount = msaaTextureInfo.numSamples();
79 } else {
80
81 desc.fColorAttachment.fTextureInfo = targetInfo;
82 desc.fColorAttachment.fLoadOp = loadOp;
83 desc.fColorAttachment.fStoreOp = storeOp;
84 }
85 }
86 } else {
87 desc.fColorAttachment.fTextureInfo = targetInfo;
88 desc.fColorAttachment.fLoadOp = loadOp;
89 desc.fColorAttachment.fStoreOp = storeOp;
90 }
91 desc.fClearColor = clearColor;
92
94 desc.fDepthStencilAttachment.fTextureInfo = caps->getDefaultDepthStencilTextureInfo(
95 depthStencilFlags,
desc.fSampleCount, targetInfo.isProtected());
96
97
99 desc.fClearDepth = 0.f;
100 desc.fClearStencil = 0;
102 }
103
105}