-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Engine: add support for non float vertex buffers in native #15107
Conversation
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://babylonsnapshots.z22.web.core.windows.net/refs/pull/15107/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/15107/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/15107/merge#BCU1XR#0 |
WebGL2 visualization test reporter: |
Visualization tests for WebGPU (Experimental) |
Visualization tests for WebGPU (Experimental) |
Visualization tests for WebGPU (Experimental) |
I will test this in native, but it will be a bit before I do. Can we mark as draft until then? |
I got everything working on Windows. Need to check macOS and iOS next. |
… buffers (#1382) This is a replacement for #1376. The original thinking was that we will promote the non-float attributes to float which was a complex and poor performance solution. The better solution is to change the shader to take non-float attributes. Fortunately, this shader processing is already happening for WebGPU on the JS side. @Popov72 [factored out the shader processor](BabylonJS/Babylon.js#15107) on the JS side for WebGPU to also work with Babylon Native, which also includes code that aligns the buffers to 4-byte boundaries. This native PR ties everything together and removes all the promote to float logic we had earlier to try to handle non-float attributes. This change includes updating Babylon.js to 7.7.2. Using an older version will result in a `console.error ` if non-normalized, non-float vertex buffers are used.
Let's hope it works in Native!
Note that the support has been added to WebGL2 (as it's what Native uses under the hood), but it is disabled for WebGL2 in Babylon.js because ANGLE is already doing the jobTo reduce the footprint of thinEngine, the changes are only specific to Native and WebGPU. I had to create/update a number of things in the native engine without being able to test them... So don't be surprised if the tests fail!