About entryPoint for compute shader

I noticed that the entryPoint of the babylonjs compute shader is “main”, and it doesn’t seem to be able to be changed.

Look at this site compute.toys.

He marks two functions with “@compute”. Then executes these two functions in turn.
pass1 → mainImage

If I want to achieve this, can I do it in a single compute shader like he did. Or do I have to create multiple compute shaders.

Adding @Evgeni_Popov

You can use the entryPoint property of the options parameter of the ComputeEffect constructor to choose another name than “main”:

Let us know if that works for you, as when we implemented the compute shader support in Babylon, having multiple entry points did not work in Chrome.

It’s not perfect, but I think it’s enough.
Because I’m just learning at the moment, just trying to understand what’s possible. :grinning:

1 Like