Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 6913d1b

Browse files
rphilliSkia Commit-Bot
authored andcommitted
Make it clear that GrVkRenderPass::Create is modifying its AttachmentsDescriptor parameter
This is pulled out of: https://skia-review.googlesource.com/c/skia/+/288462 ([Omnibus] Add program pre-compilation to Vulkan backend) Bug: skia:9455 Change-Id: I2a24096edf6bb07945444272a022e5569dbf47b1 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288744 Reviewed-by: Greg Daniel <[email protected]> Commit-Queue: Robert Phillips <[email protected]>
1 parent 7359165 commit 6913d1b

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/gpu/vk/GrVkRenderPass.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,25 @@ GrVkRenderPass* GrVkRenderPass::CreateSimple(GrVkGpu* gpu, const GrVkRenderTarge
5151
// Get attachment information from render target. This includes which attachments the render
5252
// target has (color, stencil) and the attachments format and sample count.
5353
target.getAttachmentsDescriptor(&attachmentsDescriptor, &attachmentFlags);
54-
return Create(gpu, attachmentFlags, attachmentsDescriptor, kBasicLoadStoreOps,
54+
return Create(gpu, attachmentFlags, &attachmentsDescriptor, kBasicLoadStoreOps,
5555
kBasicLoadStoreOps);
5656
}
5757

5858
GrVkRenderPass* GrVkRenderPass::Create(GrVkGpu* gpu,
59-
const GrVkRenderPass& compatibleRenderPass,
60-
const LoadStoreOps& colorOp,
61-
const LoadStoreOps& stencilOp) {
59+
const GrVkRenderPass& compatibleRenderPass,
60+
const LoadStoreOps& colorOp,
61+
const LoadStoreOps& stencilOp) {
6262
AttachmentFlags attachmentFlags = compatibleRenderPass.fAttachmentFlags;
6363
AttachmentsDescriptor attachmentsDescriptor = compatibleRenderPass.fAttachmentsDescriptor;
64-
return Create(gpu, attachmentFlags, attachmentsDescriptor, colorOp, stencilOp);
64+
return Create(gpu, attachmentFlags, &attachmentsDescriptor, colorOp, stencilOp);
6565
}
6666

6767
GrVkRenderPass* GrVkRenderPass::Create(GrVkGpu* gpu,
6868
AttachmentFlags attachmentFlags,
69-
AttachmentsDescriptor& attachmentsDescriptor,
69+
AttachmentsDescriptor* attachmentsDescriptor,
7070
const LoadStoreOps& colorOp,
7171
const LoadStoreOps& stencilOp) {
72-
uint32_t numAttachments = attachmentsDescriptor.fAttachmentCount;
72+
uint32_t numAttachments = attachmentsDescriptor->fAttachmentCount;
7373
// Attachment descriptions to be set on the render pass
7474
SkTArray<VkAttachmentDescription> attachments(numAttachments);
7575
attachments.reset(numAttachments);
@@ -95,9 +95,9 @@ GrVkRenderPass* GrVkRenderPass::Create(GrVkGpu* gpu,
9595

9696
if (attachmentFlags & kColor_AttachmentFlag) {
9797
// set up color attachment
98-
attachmentsDescriptor.fColor.fLoadStoreOps = colorOp;
98+
attachmentsDescriptor->fColor.fLoadStoreOps = colorOp;
9999
setup_vk_attachment_description(&attachments[currentAttachment],
100-
attachmentsDescriptor.fColor,
100+
attachmentsDescriptor->fColor,
101101
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
102102
// setup subpass use of attachment
103103
colorRef.attachment = currentAttachment++;
@@ -118,9 +118,9 @@ GrVkRenderPass* GrVkRenderPass::Create(GrVkGpu* gpu,
118118

119119
if (attachmentFlags & kStencil_AttachmentFlag) {
120120
// set up stencil attachment
121-
attachmentsDescriptor.fStencil.fLoadStoreOps = stencilOp;
121+
attachmentsDescriptor->fStencil.fLoadStoreOps = stencilOp;
122122
setup_vk_attachment_description(&attachments[currentAttachment],
123-
attachmentsDescriptor.fStencil,
123+
attachmentsDescriptor->fStencil,
124124
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);
125125
// setup subpass use of attachment
126126
stencilRef.attachment = currentAttachment++;
@@ -168,7 +168,7 @@ GrVkRenderPass* GrVkRenderPass::Create(GrVkGpu* gpu,
168168
renderPass,
169169
&granularity));
170170

171-
return new GrVkRenderPass(gpu, renderPass, attachmentFlags, attachmentsDescriptor, granularity,
171+
return new GrVkRenderPass(gpu, renderPass, attachmentFlags, *attachmentsDescriptor, granularity,
172172
clearValueCount);
173173
}
174174

src/gpu/vk/GrVkRenderPass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class GrVkRenderPass : public GrVkManagedResource {
131131

132132
static GrVkRenderPass* Create(GrVkGpu* gpu,
133133
AttachmentFlags,
134-
AttachmentsDescriptor&,
134+
AttachmentsDescriptor*,
135135
const LoadStoreOps& colorOps,
136136
const LoadStoreOps& stencilOps);
137137

0 commit comments

Comments
 (0)