diff options
| author | Yong He <yonghe@outlook.com> | 2025-06-04 13:05:58 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-04 13:05:58 -0700 |
| commit | 812e478989e27983b8dea7ab11964de751654ba2 (patch) | |
| tree | e6db6def9c7896ee48c5fe42926856644e81c0e6 /tests/initializer-list | |
| parent | b9dc21d362f65f22bc707bede733a9537b80460a (diff) | |
Make interface types non c-style in Slang2026. (#7260)
* Make interface types non c-style.
* Make Optional<T> work with autodiff and existential types.
* Fix.
* patch behind slang 2026.
* Fix warnings.
* cleanup.
* Fix tests.
* Fix.
* Fix com interface lowering.
* Add comment to test.
* regenerate command line reference
* Add test for passing `none` to autodiff function.
* Fix recording of `getDynamicObjectRTTIBytes`.
* Fix nested Optional types.
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'tests/initializer-list')
| -rw-r--r-- | tests/initializer-list/existential-is-not-c-like.slang | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/initializer-list/existential-is-not-c-like.slang b/tests/initializer-list/existential-is-not-c-like.slang new file mode 100644 index 000000000..1058033c9 --- /dev/null +++ b/tests/initializer-list/existential-is-not-c-like.slang @@ -0,0 +1,21 @@ +// Test that in Slang 2026, it is no longer valid to default initialize an existential value. +#lang 2026 + +//TEST:SIMPLE(filecheck=CHECK): -target spirv +interface IBSDF +{ + float3 eval(float3 wi, float3 wo); +} + +struct ShaderGraph +{ + IBSDF bsdf_stack[8]; // Intentionally uninitialized. + int next_bsdf = 0; // must be zero. +} + +[numthreads(1,1,1)] +void main() +{ + // CHECK: ([[# @LINE+1]]): error + ShaderGraph sg = {}; +}
\ No newline at end of file |
