Skip to content

Commit 4da991d

Browse files
committed
Fix possible undef values in storeOp trackers
1 parent bb91123 commit 4da991d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source_common/trackers/render_pass.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ RenderPass::RenderPass(VkRenderPass _handle, const VkRenderPassCreateInfo& creat
124124
auto& attachDesc = createInfo.pAttachments[attachRef.attachment];
125125

126126
// Canonicalize read-only attachments as storeOp=NONE
127-
VkAttachmentStoreOp depthStoreOp;
127+
VkAttachmentStoreOp depthStoreOp = attachDesc.storeOp;
128128
switch (attachRef.layout)
129129
{
130130
case VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL:
@@ -143,7 +143,7 @@ RenderPass::RenderPass(VkRenderPass _handle, const VkRenderPassCreateInfo& creat
143143
attachments.emplace_back(RenderPassAttachName::DEPTH, attachDesc.loadOp, depthStoreOp, false);
144144

145145
// Canonicalize read-only attachments as storeOp=NONE
146-
VkAttachmentStoreOp stencilStoreOp;
146+
VkAttachmentStoreOp stencilStoreOp = attachDesc.stencilStoreOp;
147147
switch (attachRef.layout)
148148
{
149149
case VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL:
@@ -214,7 +214,7 @@ RenderPass::RenderPass(VkRenderPass _handle, const VkRenderPassCreateInfo2& crea
214214
auto& attachDesc = createInfo.pAttachments[attachRef.attachment];
215215

216216
// Canonicalize read-only attachments as storeOp=NONE
217-
VkAttachmentStoreOp depthStoreOp;
217+
VkAttachmentStoreOp depthStoreOp = attachDesc.storeOp;
218218
switch (attachRef.layout)
219219
{
220220
case VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL:
@@ -233,7 +233,7 @@ RenderPass::RenderPass(VkRenderPass _handle, const VkRenderPassCreateInfo2& crea
233233
attachments.emplace_back(RenderPassAttachName::DEPTH, attachDesc.loadOp, depthStoreOp, false);
234234

235235
// Canonicalize read-only attachments as storeOp=NONE
236-
VkAttachmentStoreOp stencilStoreOp;
236+
VkAttachmentStoreOp stencilStoreOp = attachDesc.stencilStoreOp;
237237
switch (attachRef.layout)
238238
{
239239
case VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL:
@@ -294,7 +294,7 @@ RenderPass::RenderPass(const VkRenderingInfo& createInfo)
294294
auto& attachRef = *createInfo.pDepthAttachment;
295295

296296
// Canonicalize read-only attachments as storeOp=NONE
297-
VkAttachmentStoreOp depthStoreOp;
297+
VkAttachmentStoreOp depthStoreOp = attachRef.storeOp;
298298
switch (attachRef.imageLayout)
299299
{
300300
case VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL:
@@ -328,7 +328,7 @@ RenderPass::RenderPass(const VkRenderingInfo& createInfo)
328328
auto& attachRef = *createInfo.pStencilAttachment;
329329

330330
// Canonicalize read-only attachments as storeOp=NONE
331-
VkAttachmentStoreOp stencilStoreOp;
331+
VkAttachmentStoreOp stencilStoreOp = attachRef.storeOp;
332332
switch (attachRef.imageLayout)
333333
{
334334
case VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL:

0 commit comments

Comments
 (0)