Skip to content
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

Add back check to make sure there are active render loops before queuing a new one #15086

Merged
merged 1 commit into from May 13, 2024

Conversation

bghgary
Copy link
Contributor

@bghgary bghgary commented May 10, 2024

This is a follow up to #14868. The main reason for adding this check is to make Babylon Native work again, but it also prevents an additional queuing of a new frame if stopRenderLoop is called during render.

@bjsplat
Copy link
Collaborator

bjsplat commented May 10, 2024

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented May 10, 2024

@bjsplat
Copy link
Collaborator

bjsplat commented May 10, 2024

@bjsplat
Copy link
Collaborator

bjsplat commented May 10, 2024

Visualization tests for WebGPU (Experimental)
Important - these might fail sporadically. This is an optional test.

https://babylonsnapshots.z22.web.core.windows.net/refs/pull/15086/merge/testResults/webgpuplaywright/index.html

@bghgary bghgary marked this pull request as draft May 10, 2024 17:57
@bghgary
Copy link
Contributor Author

bghgary commented May 10, 2024

Marking as draft for now until I can prove everything is working well in native.

@sebavan
Copy link
Member

sebavan commented May 13, 2024

Can you please add a comment on it to be sure we do not remove it again as it is hard to understand how this could be happening ?

@sebavan sebavan marked this pull request as ready for review May 13, 2024 17:25
@sebavan sebavan merged commit a121787 into BabylonJS:master May 13, 2024
11 checks passed
@sebavan
Copy link
Member

sebavan commented May 13, 2024

reviewed with @Popov72 and the check is needed no matter the rest of the conditions :-) if we stop during _renderLoop we would continue to queue indefinitely without it. Thanks for the fix !!!

@bghgary
Copy link
Contributor Author

bghgary commented May 13, 2024

I was going to add comments, but I can add it later.

@bghgary
Copy link
Contributor Author

bghgary commented May 13, 2024

Added comments in #15095

bghgary added a commit to BabylonJS/BabylonNative that referenced this pull request May 17, 2024
Updating to Babylon.js version 7.0.0 reveals a whole slew of issues when
running the validation tests because
[#14868](BabylonJS/Babylon.js#14868) broke the
render loop stopping behavior when running in native. Native does not
implement a way to cancel a requested animation frame. This missing
canceling functionality should be added to native someday, but, in the
meantime, [#15086](BabylonJS/Babylon.js#15086)
will make it behave like it did before.

These changes fix potential issues in the code regardless of what
happened on the JS side.

- Update to latest JsRuntimeHost with lots of fixes.
- Call SetRenderResetCallback with null to clear the callback that can
cause a crash on shutdown.
- Update a few validation tests to not use render count.
- Update scripts to use `const`/`let` instead of `var`.
- Update validation script to handle some errors better and clean up
dead code.
- Add unhandled exception handler to Playground app so that validation
test will report correct errors and exit correctly.
- Change core graphics device implemenation to update bgfx state right
before requesting screenshots. This will ensure the screenshot is the
right size if the resolution has changed.
- Fix TestUtils:WritePNG to return an error when the byte length is an
unexpected size instead of silently failing.
- Change TestUtils::SetTitle to update the HWND title on a background
thread to avoid dead lock with the main thread.
- Update dynamic texture clip test to newest version that will fail if
the feature is not working.
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.

None yet

5 participants