Skip to content

Use RenderStartup for CopyDeferredLightingIdPipeline. #20195

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

Merged
merged 3 commits into from
Jul 21, 2025

Conversation

andriyDev
Copy link
Contributor

Objective

  • Progress towards Use RenderStartup instead of a FromWorld impl whenever possible #19887.
  • This migration actually caught a segfault on Linux + Vulkan + llvmpipe software rendering driver + (maybe) xvfb-run
    • It seems the reason for this is that we are concurrently terminating the program (which trigger's LLVMs atexit handlers) while we are also compiling pipelines in parallel. It seems LLVM code is not quite multithread safe in this situation.
    • Thanks to @kristoff3r for figuring out this segfault!
    • I still have no idea why this PR triggers it and not others.

Solution

Most of this is the same as all the other RenderStartup migrations.

  • Convert FromWorld impls to RenderStartup systems.

In addition, I had to 1) enable synchronous pipeline compilation, 2) disable pipelined rendering in the ambiguity_detection test. This ensures that 1) the render thread just blocks on pipeline compilation rather than letting it run in another thread, 2) we don't leave App::update until the render thread finishes. So therefore, there won't be any pipeline compilation happening by the time the test ends.

Testing

  • I ran the run-examples-linux-vulkan Github action many, many times and segfaults were consistent until this PR! Now they don't seem to happen anymore.

@andriyDev andriyDev requested review from atlv24 and IceSentry July 19, 2025 07:04
@andriyDev andriyDev added A-Rendering Drawing game state to the screen 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-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 19, 2025
@nicopap nicopap self-requested a review July 19, 2025 07:24
Copy link
Contributor

@kristoff3r kristoff3r left a comment

Choose a reason for hiding this comment

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

Looks like an ok workaround to me

Copy link
Contributor

@atlv24 atlv24 left a comment

Choose a reason for hiding this comment

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

weird segfault is weird

@atlv24 atlv24 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 20, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jul 21, 2025
Merged via the queue into bevyengine:main with commit 9d4bfdb Jul 21, 2025
34 checks passed
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 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-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants