You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[VFX] Add support for more HLSL function prototype declaration
JIRA: UUM-59938
1️⃣ The current implementation for Custom HLSL operators do not support all kind of function declaration.
The goal of this PR is to lift this limitation and support all kind of function that makes sense in that context.
Here are the limitation that are lifted:
✔ In operators, a function can return void
✔ In operators, a function can have no parameter at all (but then must return a value)
✔ In operators, a function can have only out parameters (can return void or not)
✔ In operators, a function can have only in parameters (but then must return a value)
✔ In operators, the return slot name can be defined with a comment above the function: /// return: <name-of-the-slot>
❌ In operators, a function cannot return void if there's not at least one out parameter
✔ In blocks, a function still must have a `VFXAttributes` parameter but don't need to access it all
✔ In blocks and operators, `TextureCube` and `Texture2DArray` are now supported
2️⃣ Also, for function which returns a value, until now the output slot was automatically named `out`.
Now the user can use the same syntax as for the tooltip of input parameters to specify a name for the return output.
The syntax is like this:
```hlsl
/// return: My Value
float FloatFunction4(in float t)
{
return 3 * t;
}
```
In that case, the output slot will be named `My Value`
3️⃣ Last but not least, the HLSL code editor now supports:
- `CTRL`+`S`: saves only the current file (instead of the whole Unity project)
- `CTRL`+`Z` and `CTRL`+`Y`: adds support for undo/redo inside the code editor.
- `CTRL`+`MouseWheel`: Increase/decrease font size
0 commit comments