How to use custom struct input for sdsl shader.
I have a:
- Shader
- C# File
shader MyCustomShaderBase
{
// sdsl struct counterpart
struct MyCustomShaderStruct
{
// stuff
}
// creates a pin
stage MyCustomShaderStruct MyStructInput;
}
// csharp struct counterpart
[StructLayout(LayoutKind.Sequential)]
public struct MyCustomShaderStruct
{
// stuff
}
public static class MyCustomShaderStructInitializer
{
// In theory this discovered automatically when vl sees dll
public static readonly ValueParameterKey<MyCustomShaderStruct> MyStructInput =
ParameterKeys.NewValue<MyCustomShaderStruct >(
new MyCustomShaderStruct(), // default value,
"MyCustomShaderBase.MyStructInput" // full exact path to struct
);
}
The problem is, that I can see shader pin only after I recompile shader, not on stratup.
E.g.:
After restart:
Testbed GitHub - antokhio/VLShaderStructInitializer · GitHub

