-
Notifications
You must be signed in to change notification settings - Fork 252
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
Slang compiles all the HLSL vertex/pixel/computer shaders, but none of the HLSL geometry shaders #6185
Comments
Can you share the full source of your geometry shader? |
Hello @csyonghe Thank you for considering my issue. struct GS_INPUT
{
float4 PosSS : TEXTURE0; // [Screen Space] Position
};
struct PS_INPUT
{
float4 PosSS : SV_POSITION; // [Screen Space] Position
};
[maxvertexcount(3)]
void main(triangle GS_INPUT input[3], inout TriangleStream<PS_INPUT> outStream)
{
PS_INPUT output;
output.PosSS = input[0].PosSS;
outStream.Append(output);
output.PosSS = input[1].PosSS;
outStream.Append(output);
output.PosSS = input[2].PosSS;
outStream.Append(output);
outStream.RestartStrip();
} Here is the error for this example : I confirm this shader compiles correctly with :
I am honestly disappointed because I intensively use geometry shaders, and that is the only blocking point to adopt Slang in my engine. Thanks again. |
I find this to be related to the specific version of dxc you are using. I tried to use latest Slang release to compile your shader with this command:
Where In addition, compiling to HLSL with Slang, then compile the HLSL to dxil with DXC also works on my machine:
Can you verify if you can compile with I also tested compiling with the compilation API, and it is also working. What is the version number DXC on your system? Here's mine and it is working:
|
Hello @csyonghe Thank you for testing on your side. Then, in my C++ code, I updated DXC and Slang to the same versions mentioned before. But Slang is outputting the same error regarding the semantics of the Geometry shader. This error only happens on any Geometry shaders I try to compile.. I am using the C++ code described in my first post. Do you see any obvious mistake, or any missing flag, which could explain the error ? Thanks again [EDIT] As shown in my C++ code, I load the shader into memory, remove the UTF8 BOM (if present), then provide this code to Slang. |
Hmm, I am trying this with the compilation API and I have reproduced the error, let me look into this now. |
Thanks for pointing out the possible issue of wrong DXC dll version. [EDIT] Thank you for confirming the issue with the compilation API. I will wait your feedback. Thanks again |
@itamago This is now fixed in PR#6197. Thank you for reporting this issue! |
Hello @csyonghe |
It’s merged. Please let us know if you are still having issues. |
Hello @csyonghe |
Hello,
I am new to slang. I try to make it compile all the HLSL shaders I have, before migrating to new slang language features.
Basically, when compiling the HLSL geometry shaders, slang seems not accepting any semantics to communicate between the vertex and the geometry shader with the following errors :
dxc 1.8: mymodule.slang(34): error : Semantic POSITION is invalid for shader model: gs
dxc 1.8: mymodule.slang(58): error : Semantic CUSTOM is invalid for shader model: gs
dxc 1.8: mymodule.slang(58): error : Semantic TEXTURE is invalid for shader model: gs
I tried changing to various semantics , but the errors remain. Here is an example semantics which fail :
In my code, I ask slang compiling to DXIL with sm_6_0.
I thought it would be related to the version of sm, but all the tested versions gave the same result.
Maybe I'm missing something, because all the other kind of shaders are compiling correctly.
Please see the code which compile the shaders :
Do you have any idea or remark, please ?
Thanks for your help
The text was updated successfully, but these errors were encountered: