Skip to content

Add dynamicrenderinglocalread to iOS subproject#1268

Open
SRSaunders wants to merge 5 commits into
SaschaWillems:masterfrom
SRSaunders:dynlocalread-resize
Open

Add dynamicrenderinglocalread to iOS subproject#1268
SRSaunders wants to merge 5 commits into
SaschaWillems:masterfrom
SRSaunders:dynlocalread-resize

Conversation

@SRSaunders
Copy link
Copy Markdown
Contributor

@SRSaunders SRSaunders commented Apr 7, 2026

Fixes #1267 #1271.

This change fixes startup resize for dynamicrenderinglocalread to support non-default device screen sizes.

This also updates the iOS subproject to include this new sample and make it work on iOS devices and the Simulator.

UPDATED: Now fixes some validation layer errors in the example (all platforms):

  1. Wrong image layout validation error.
  2. Non matching color attachment count when drawing the UI (1 actual vs. 4 expected)
    3. Failure to destroy buffer and memory on exit.
  3. Missing some overrides (static analysis warnings in IDE)

@SRSaunders
Copy link
Copy Markdown
Contributor Author

SRSaunders commented Apr 7, 2026

FYI, another way to handle this could be to move the attachment resize logic out of setupFrameBuffer() and into a new windowResized() entry point override for the example. Some examples do this, while others use the resized flag in either setupFrameBuffer() or buildCommandBuffer() (e.g. the ray tracing examples).

Given that it looks like a stylistic thing vs. functional, I decided to leave things alone and just use the resized flag.

@SRSaunders SRSaunders changed the title Fix initial resize handling for dynamicrenderinglocalread Add dynamicrenderinglocalread to iOS subproject Apr 11, 2026
@SRSaunders
Copy link
Copy Markdown
Contributor Author

Limited PR to adding dynamicrenderinglocalread example to iOS subproject and iOS Simulator.

Resize logic now handled by changes within master branch.

@SRSaunders
Copy link
Copy Markdown
Contributor Author

Updated PR to include validation error fixes for dynamicrenderinglocalread.

.sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO,
.imageView = imageViewList[i],
.imageLayout = VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ_KHR,
.imageLayout = (i == 0) ? VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL : VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ_KHR,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this needs fixing. IMO this is a false positive and I've raised an issue in the VVL repo about this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Referring to your issue KhronosGroup/Vulkan-ValidationLayers#12039 where you discuss VK_ATTACHMENT_UNUSED, do you think this requires the VK_EXT_dynamic_rendering_unused_attachments extension to make this work for dynamic rendering?

MoltenVK does not support this extension so I can't test there. However, I will try on my Windows 11 and linux machines to see if my AMD card supports it, and report back later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scratch that idea re the VK_EXT_dynamic_rendering_unused_attachments extension. Looks like that is for adapting to multiple pipelines where you can have an unused attachment in one, but not the other.

I will leave my original change in place for now and resolve once your VVL issue is looked at.

Comment thread examples/dynamicrenderinglocalread/dynamicrenderinglocalread.cpp Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants