Open Ollhax opened 2 weeks ago
The commandline tool doesn't respect the predefined entrypoint attributes, but the compilation API can correctly identify them.
If you are using the slangc tool, you need to explicitly specify which entrypoint to compile:
slangc shader.slang -target glsl -entry vertexMain -stage vertex
Alright, thanks for the clarification. I can work around it, but it would be nice to have support for entrypoint attributes in the commandline tool. It's easy to trip on, if nothing else.
I have a slang file containing two entry points for the vertex and fragment shaders:
When I run
slangc shader.slang -target glsl -stage vertex
(or via-o out.vert
) I expect it to be able to find the[shader("vertex")]
and figure out thatvertexMain
is the entry point it needs, but instead I get an error:shader.slang(3): error 38000: no function found matching entry point name 'main'
I can rename vertexMain to "main" and it'll work, but it doesn't work if I rename both vertexMain and fragmentMain to "main".