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

Tech to allow async shader compilation, disabled #6084

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Feb 23, 2024

Tech needed for using KHR_parallel_shader_compile for async shader compilation.

A shader can be assigned on a device with true parameter (defaults to false) to skip the rendering with this shader until it is compiled and linked. The test is done using non-blocking API.

device.setShader(shader, true);

This is currently not used (false is always passed), as the situation described here is still very relevant: https://github.com/mvaligursky/webgl-parallel_shader_compile

Tests using ShaderCompile engine example with more spheres (unique shaders)

mac

Findings on MacOS 14.3.1 and Chrome 121:

  • the extensions returns true in vast majority of cases, even when the shader is not ready, which block the rendering when the shader us used. The bahaviour is pretty much equivalent to not using the extension at all:

Screenshot 2024-02-23 at 14 33 08

Findings on Windows 10, Chrome 121:

  • the situation is somehow better. The extension correctly reports shader not being done compiling, so we can correctly skip rendering with it. But the browser is somehow blocked on its internal threads during the compilation, and so the application is still very much unresponsive during those times.

image

@mvaligursky mvaligursky merged commit e340148 into main Feb 23, 2024
7 checks passed
@mvaligursky mvaligursky deleted the mv-async-shader-linking branch February 23, 2024 14:53
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.

2 participants