Update checks of *Source and *Element to be typeof checks in effect components#18405
Update checks of *Source and *Element to be typeof checks in effect components#18405RaananW merged 2 commits intoBabylonJS:masterfrom
typeof checks in effect components#18405Conversation
|
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://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18405/merge/index.html#WGZLGJ#4600 Links to test your changes to core in the published versions of the Babylon tools (does not contain changes you made to the tools themselves): https://playground.babylonjs.com/?snapshot=refs/pull/18405/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/18405/merge#BCU1XR#0 If you made changes to the sandbox or playground in this PR, additional comments will be generated soon containing links to the dev versions of those tools. |
|
Visualization tests for WebGPU |
|
WebGL2 visualization test reporter: |
⚡ Performance Test Results🟢 All performance tests passed — no regressions detected. |
🟢 Memory Leak Test Results13 passed, 0 leaked out of 13 scenarios 🟢 All memory leak tests passed — no leaks detected. Passed Scenarios (13)
|
Head branch was pushed to by a user without write access
|
WebGL2 visualization test reporter: |
|
Visualization tests for WebGPU |
⚡ Performance Test Results🟢 All performance tests passed — no regressions detected. |
🟢 Memory Leak Test Results13 passed, 0 leaked out of 13 scenarios 🟢 All memory leak tests passed — no leaks detected. Passed Scenarios (13)
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Visualization tests for WebGPU |
|
WebGL2 visualization test reporter: |
⚡ Performance Test Results🟢 All performance tests passed — no regressions detected. |
🟢 Memory Leak Test Results13 passed, 0 leaked out of 13 scenarios 🟢 All memory leak tests passed — no leaks detected. Passed Scenarios (13)
|
Some of the checks in
_ProcessShaderCodeseem to be incorrect, as it can cause an error when effects are created byShadowDepthWrapper._makeEffect.The issue comes from
computeSourcebeing able to be empty string''which evaluates to false in these conditions, which then results in e.g.vertexSourcebeing assigned to the value ofbaseName. ThisbaseNameis then passed intoLoadShaderwhere it is treated as astring, followed bysubstringbeing invoked and an error being raised.I noticed this issue in BabylonJS version 7.54.3, which is pretty old, but looking at the existing codebase, the same conditions for this error seem to exist. Here is a stack trace (somewhat mangled due to build system):
Here is a simple reproduction: https://playground.babylonjs.com/#28WKKT