Open wijiler opened 2 weeks ago
The problem is that SV_Position is declared twice in the fragment shader parameter list, once in VertOutput::pos
and once in fragMain::fragPos
, and Slang doesn't current deduplicate these things. A workaround is to remove one declaration.
The problem is that SV_Position is declared twice in the fragment shader parameter list, once in
VertOutput::pos
and once infragMain::fragPos
, and Slang doesn't current deduplicate these things. A workaround is to remove one declaration.
Ah, it might be nice to have some warning for this, thank you for the information
@csyonghe It might be nice to have some syntax like
struct VertOutput
{
float4 pos : SV_Position, REAL_POS;
}
so that if I need to pass the vertex position into the fragment shader I dont have to do this
struct VertOutput
{
float4 pos : SV_Position;
float3 realPos : REAL_POS;
}
although im not sure its really that big of an issue
I hit this validation error with SV_ViewID
because I linked together two different modules that bound to it (one a using private file-scope variable, the other in shader params). I worked around it, but modules being incompatible (even though the shader compile succeeds) because of something that's not even in the modules' public interface is not great.
using this fragment shader
We are met with these fun validation errors
But if we just return color or just return diffuse, there is no validation errors, hence why this confuses me, on latest release btw