yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Tim FoleyRework command-line options handling for entry points and targets (#697)725985528

master
838 B32 linesraw
1// Disbaled because Slang does semantic checks now, not the downstream compiler.
2
3//TEST_IGNORE_FILE
4//TEST(smoke):COMPARE_HLSL: -profile ps_4_0 -entry main
5
6// We need to confirm that when there is an error in
7// the input code, we allow the downstream compiler
8// to detect and report the error, not us...
9
10// A key goal here is that errors get reported at
11// the right source location, ideally including
12// all of file, line, and column info.
13
14// This file used to have a parse error (missing semicolon),
15// but at this point we need to parse function bodies, even
16// if we don't check them, so we can't avoid reporting that one.
17//
18// I'm switching it to a type error instead:
19
20struct S { int x; };
21
22float4 main() : SV_Target
23{
24    float a = 1.0;
25
26    // Invalid assignment:
27    S s = a;
28
29    float c = a + b;
30
31    return float4(c);
32}