Skip to content

Move renderer initialization from build time to RenderStartup #20021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

janhohenheim
Copy link
Member

Objective

I'd like to move the primary window creation into Startup for reasons detailed in the linked PRs, but I cannot do so, since RenderApp needs it in its own build

Solution

  • Move the relevant code into RenderStartup

Testing

  • TODO

@alice-i-cecile alice-i-cecile added this to the 0.17 milestone Jul 7, 2025
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in C-Code-Quality A section of code that is hard to understand or change S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jul 7, 2025
@alice-i-cecile
Copy link
Member

Swap the label over once CI is green please :)

@janhohenheim janhohenheim added the S-Needs-Help The author needs help finishing this PR. label Jul 7, 2025
@janhohenheim
Copy link
Member Author

I need some scheduling help.
My goal is to move the Window creation from the WindowPlugin::build method into PreStartup.
To do that, I also need to migrate some parts of the RenderPlugin, as they depend on Window being present on build.
The issue is that the part in question is the code that initializes the RenderResources in an async fashion. Right now, the returns false in RenderPlugin::ready until that async code is done, then inserts the relevant resources from RenderResources into the World in RenderPlugin::finish
But if I move the related RenderResources initialization code into PreStartup, I cannot insert those resources until that async task is done, which might be at any time after Startup or RenderStartup 🤔
For context, the information inside the PrimaryWindow is used for RequestAdapterOptions::compatible_surface. Specifically, the RawHandleWrapperHolder is used to create the surface

@janhohenheim janhohenheim added the D-Straightforward Simple bug fixes and API improvements, docs, test and examples label Jul 7, 2025
@JMS55
Copy link
Contributor

JMS55 commented Jul 8, 2025

Can we wait to get DLSS in first? I don't want to have to rebase the whole rendering initialization code again, it's very difficult :(

@janhohenheim
Copy link
Member Author

@JMS55 sure! I don't know how to proceed anyways for now :D

@janhohenheim janhohenheim added the S-Blocked This cannot move forward until something else changes label Jul 8, 2025
@janhohenheim
Copy link
Member Author

Blocked on #19864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Blocked This cannot move forward until something else changes S-Needs-Help The author needs help finishing this PR. S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants