26 attachment->
flags = 0;
29 switch (startLayout) {
33 attachment->
loadOp =
desc.fLoadStoreOps.fLoadOp;
45 SK_ABORT(
"Unexpected attachment layout");
61 return Create(gpu, attachmentFlags, attachmentsDescriptor, kBasicLoadStoreOps,
66 return Create(gpu, attachmentFlags, attachmentsDescriptor, kDiscardLoadStoreOps,
78 AttachmentFlags attachmentFlags = compatibleRenderPass.fAttachmentFlags;
82 return Create(gpu, attachmentFlags, &attachmentsDescriptor, colorOp, resolveOp, stencilOp,
87 AttachmentFlags attachmentFlags,
88 AttachmentsDescriptor* attachmentsDescriptor,
89 const LoadStoreOps& colorOp,
90 const LoadStoreOps& resolveOp,
91 const LoadStoreOps& stencilOp,
92 SelfDependencyFlags selfDepFlags,
93 LoadFromResolve loadFromResolve) {
127 uint32_t numAttachments = attachmentsDescriptor->fAttachmentCount;
130 attachments.reset(numAttachments);
139 uint32_t currentAttachment = 0;
147 subpassDescMain.
flags = 0;
156 int currentDependency = 0;
164 attachmentsDescriptor->fColor.fLoadStoreOps = colorOp;
167 attachmentsDescriptor->fColor,
216 attachmentsDescriptor->fResolve.fLoadStoreOps = resolveOp;
223 attachmentsDescriptor->fResolve,
240 subpassDescLoad.
flags = 0;
266 attachmentsDescriptor->fStencil.fLoadStoreOps = stencilOp;
268 attachmentsDescriptor->fStencil,
286 SkASSERT(numAttachments == currentAttachment);
294 createInfo.
pNext =
nullptr;
295 createInfo.
flags = 0;
304 VkRenderPass renderPass;
319 return new GrVkRenderPass(gpu, renderPass, attachmentFlags, *attachmentsDescriptor,
324 const AttachmentsDescriptor& descriptor,
325 SelfDependencyFlags selfDepFlags,
326 LoadFromResolve loadFromResolve,
327 const VkExtent2D& granularity, uint32_t clearValueCount)
329 , fRenderPass(renderPass)
330 , fAttachmentFlags(
flags)
331 , fAttachmentsDescriptor(descriptor)
332 , fSelfDepFlags(selfDepFlags)
333 , fLoadFromResolve(loadFromResolve)
334 , fGranularity(granularity)
335 , fClearValueCount(clearValueCount) {
338void GrVkRenderPass::freeGPUData()
const {
345 *index = fColorAttachmentIndex;
371 if (
flags != fAttachmentFlags) {
391 if (fSelfDepFlags != selfDepFlags) {
409 if (!
target->getAttachmentsDescriptor(&
desc, &
flags, this->hasResolveAttachment(),
410 this->hasStencilAttachment())) {
419 return this->
isCompatible(renderPass.fAttachmentsDescriptor, renderPass.fAttachmentFlags,
420 renderPass.fSelfDepFlags, renderPass.fLoadFromResolve);
425 return fRenderPass == renderPass;
428bool GrVkRenderPass::equalLoadStoreOps(
const LoadStoreOps& colorOps,
429 const LoadStoreOps& resolveOps,
430 const LoadStoreOps& stencilOps)
const {
451 GenKey(
b, fAttachmentFlags, fAttachmentsDescriptor, fSelfDepFlags,
452 fLoadFromResolve, (uint64_t)fRenderPass);
460 uint64_t externalRenderPass) {
461 b->add32(attachmentFlags);
475 uint32_t extraFlags = (uint32_t)selfDepFlags;
480 b->add32(extraFlags);
484 b->add32((uint32_t)(externalRenderPass & 0xFFFFFFFF));
485 b->add32((uint32_t)(externalRenderPass>>32));
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
GrVkRenderPass::AttachmentsDescriptor::AttachmentDesc AttachmentDesc
void setup_vk_attachment_description(VkAttachmentDescription *attachment, const AttachmentDesc &desc, VkImageLayout startLayout, VkImageLayout endLayout)
#define GR_VK_CALL(IFACE, X)
#define GR_VK_CALL_RESULT(GPU, RESULT, X)
#define SK_ABORT(message,...)
#define INHERITED(method,...)
static constexpr bool SkToBool(const T &x)
bool advancedBlendEquationSupport() const
bool advancedCoherentBlendEquationSupport() const
bool textureBarrierSupport() const
const GrCaps * caps() const
uint32_t maxInputAttachmentDescriptors() const
const GrVkCaps & vkCaps() const
const skgpu::VulkanInterface * vkInterface() const
GrVkRenderPass(const GrVkGpu *gpu, VkRenderPass renderPass, uint32_t colorAttachmentIndex)
bool colorAttachmentIndex(uint32_t *index) const
void genKey(skgpu::KeyBuilder *) const
const VkExtent2D & granularity() const
LoadFromResolve loadFromResolve() const
bool isCompatible(GrVkRenderTarget *target, SelfDependencyFlags selfDepFlags, LoadFromResolve) const
static void GenKey(skgpu::KeyBuilder *, AttachmentFlags, const AttachmentsDescriptor &, SelfDependencyFlags selfDepFlags, LoadFromResolve, uint64_t externalRenderPass)
@ kForNonCoherentAdvBlend
@ kExternal_AttachmentFlag
@ kStencil_AttachmentFlag
@ kResolve_AttachmentFlag
bool isCompatibleExternalRP(VkRenderPass) const
bool stencilAttachmentIndex(uint32_t *index) const
static GrVkRenderPass * Create(GrVkGpu *, const GrVkRenderPass &compatibleRenderPass, const LoadStoreOps &colorOp, const LoadStoreOps &resolveOp, const LoadStoreOps &stencilOp)
static GrVkRenderPass * CreateSimple(GrVkGpu *, AttachmentsDescriptor *, AttachmentFlags, SelfDependencyFlags selfDepFlags, LoadFromResolve)
const LoadStoreOps & resolveOps
uint32_t clearValueCount() const
FlutterSemanticsFlag flags
static float max(float r, float g, float b)
static constexpr bool SampleCountToVkSampleCount(uint32_t samples, VkSampleCountFlagBits *vkSamples)
LoadStoreOps fLoadStoreOps
bool isCompatible(const AttachmentDesc &desc) const
VkAttachmentLoadOp loadOp
VkAttachmentStoreOp stencilStoreOp
VkSampleCountFlagBits samples
VkAttachmentDescriptionFlags flags
VkAttachmentStoreOp storeOp
VkImageLayout initialLayout
VkImageLayout finalLayout
VkAttachmentLoadOp stencilLoadOp
const VkSubpassDescription * pSubpasses
const VkSubpassDependency * pDependencies
const VkAttachmentDescription * pAttachments
VkRenderPassCreateFlags flags
const VkAttachmentReference * pDepthStencilAttachment
VkSubpassDescriptionFlags flags
uint32_t inputAttachmentCount
const VkAttachmentReference * pResolveAttachments
const uint32_t * pPreserveAttachments
const VkAttachmentReference * pInputAttachments
uint32_t colorAttachmentCount
const VkAttachmentReference * pColorAttachments
VkPipelineBindPoint pipelineBindPoint
uint32_t preserveAttachmentCount
@ VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
@ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
@ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
@ VK_IMAGE_LAYOUT_UNDEFINED
@ VK_IMAGE_LAYOUT_GENERAL
@ VK_DEPENDENCY_BY_REGION_BIT
@ VK_PIPELINE_BIND_POINT_GRAPHICS
#define VK_ATTACHMENT_UNUSED
@ VK_ACCESS_INPUT_ATTACHMENT_READ_BIT
@ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT
@ VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT
@ VK_ACCESS_COLOR_ATTACHMENT_READ_BIT
@ VK_ATTACHMENT_LOAD_OP_CLEAR
@ VK_ATTACHMENT_LOAD_OP_LOAD
@ VK_ATTACHMENT_LOAD_OP_DONT_CARE
@ VK_ATTACHMENT_STORE_OP_DONT_CARE
@ VK_ATTACHMENT_STORE_OP_STORE
@ VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT
@ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
@ VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO