Open Lex-DRL opened 7 years ago
Is there a way to use HLSL tools with .shader files?
Is there a way to use HLSL tools with .shader files?
The short answer is "no". The slightly longer answer is that I started adding support for .shader files, but didn't manage to finish it, and I'm not sure if I'll ever find time to finish it.
But this issue is slightly different - signature help filtering is not unique to Unity shaders, and I'd still like to implement that.
Есть ли способ использовать инструменты HLSL с файлами .shader?
I have assigned the .shared file to the editor in the project settings. It worked but there are a lot of error messages. But on the other hand, various hints appear, for example, functions. It's more convenient than nothing.
If a few function overloads are defined in an external file (.cginc, for Unity), possible signatures are not filtered as you type. E.g., I have the following overloads in the included file: As you can see, they're designed to automatically handle any combination of float3/4 as input/output arguments. In C# IntelliSense, the list of possible overloads is shortened as you pass each argument. So, in this example, after I pass a float4 variable as the 1st arg, only 2 overloads should have left. But it doesn't happen, and HLSLTolls still show all 4 of them:
If a function takes more then 2 arguments, and you want to create all the possible overloads for simpler use in future, there could easily be dozens of them. I personally do have plenty of such cginc's that I make once and never think about how to use them in the future.
So filtering overloads as you type (C#-style) would be a nice feature.