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
Currently we need to use strings in HLSL when defining a root signature within the shader. This seems to originate from the time when HLSL was preparing to support DX12 features a long time ago. This feels like a workaround solution made for the old shader compiler and not a real language feature. The problem is that it is very easy to make a mistake in the string define, like leaving out a comma in a big multiline root signature definition. The error reporting is also hard to understand when making a mistake in the root signature string, especially if this string is long and multiline.
It would be great if there was a proper HLSL syntax to specify the root signature.
For example, a current string-style root signature:
And then this struct can easily be added to the rootsig declaration for a shader:
[RootSignature(MyRootSignature)]
The shader compiler also allows to specify a root signature define as a compile argument (-rootsig-define <value>), this is very useful too. Currently it needs a define that expands to a string, but it should accept the new root signature syntax as well.
The proposed syntax is just a really first attempt, I don't think it's very important that it would look like that.
Best regards,
Janos
The text was updated successfully, but these errors were encountered:
Agree with Janos.
I think almost everyone came up with custom solution to simplify shader manufacturing. Would be great to standardize RootSignature object and deprecate string definition.
Hello,
Currently we need to use strings in HLSL when defining a root signature within the shader. This seems to originate from the time when HLSL was preparing to support DX12 features a long time ago. This feels like a workaround solution made for the old shader compiler and not a real language feature. The problem is that it is very easy to make a mistake in the string define, like leaving out a comma in a big multiline root signature definition. The error reporting is also hard to understand when making a mistake in the root signature string, especially if this string is long and multiline.
It would be great if there was a proper HLSL syntax to specify the root signature.
For example, a current string-style root signature:
Could be rewritten with a new syntax that is not just a big string, but more structured:
And then this struct can easily be added to the rootsig declaration for a shader:
The shader compiler also allows to specify a root signature define as a compile argument (
-rootsig-define <value>
), this is very useful too. Currently it needs a define that expands to a string, but it should accept the new root signature syntax as well.The proposed syntax is just a really first attempt, I don't think it's very important that it would look like that.
Best regards,
Janos
The text was updated successfully, but these errors were encountered: