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

[docs] Admonish slangc entry points / shader attributes #6033

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/user-guide/08-compiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ we can compile the `computeMain()` entry point to SPIR-V using the following com
slangc hello-world.slang -target spirv -o hello-world.spv
```

> #### Note ####
> The `slangc` CLI [does not currently support](https://github.com/shader-slang/slang/issues/5541) `[shader(...)]` attributes for targets other than SPIRV. For other targets, the `-entry` argument is mandatory. Example:
>
> ```bat
> slangc hello-world.slang -target hlsl -entry computeMain -o hello-world.hlsl
> ```

### Source Files and Translation Units

The `hello-world.slang` argument here is specifying an input file.
Expand All @@ -200,6 +207,9 @@ The `-entry computeMain` option selects an entry point to be compiled to output

Because the `computeMain()` entry point in this example has a `[shader(...)]` attribute, the compiler is able to deduce that it should be compiled for the `compute` stage.

> #### Note ####
> This feature of `slangc` [is planned but not implemented](https://github.com/shader-slang/slang/issues/5541) for all targets. Only SPIRV output currently supports inline entry points via `[shader(...)]` attributes.

```bat
slangc hello-world.slang -target spirv -o hello-world.spv
```
Expand Down