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

WebGL2 异步读取纹理数据速度很慢 #195

Open
xiaoiver opened this issue May 29, 2024 · 1 comment
Open

WebGL2 异步读取纹理数据速度很慢 #195

xiaoiver opened this issue May 29, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@xiaoiver
Copy link
Contributor

xiaoiver commented May 29, 2024

目前异步 readTexture 方法使用了 gl.fenceSync,按说是比较推荐的非阻塞做法(Babylon.js 也使用了该做法),但在 L7 中实测相比同步方法要慢很多。

https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#use_non-blocking_async_data_readback

https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Engines/engine.ts#L1016C12-L1016C28
https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Engines/Extensions/engine.readTexture.ts#L179

@xiaoiver xiaoiver self-assigned this May 29, 2024
@xiaoiver xiaoiver added the bug Something isn't working label May 29, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: WebGL2 asynchronous reading of texture data is slow

Currently, the asynchronous readTexture method uses gl.fenceSync, which is said to be a more recommended non-blocking method (Babylon.js also uses this method), but in L7 it is much slower than the synchronous method.

https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#use_non-blocking_async_data_readback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants