diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2025-05-14 13:15:48 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-14 20:15:48 +0000 |
| commit | d179f0eec263d6ba2d7c1594564d4161750b2369 (patch) | |
| tree | bfbfb8e92a9d1b956ba2452f9c75bc2b9df21465 /tests/bugs | |
| parent | 4a3872cd3bbc44036e8acec0ba57233e1eab51e8 (diff) | |
Infer type while constant folding causes failure (#7090)
Problem:
* Infering type with `let` while using constant-foldable object's means we run in a circular loop of `ensureDecl`.
Changes:
* If we constant-fold we effectively are ready to check definition. If we are not a constant to fold, we run `setCheckState` after anyways.
Diffstat (limited to 'tests/bugs')
| -rw-r--r-- | tests/bugs/infer-var-type-constant-folding.slang | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/bugs/infer-var-type-constant-folding.slang b/tests/bugs/infer-var-type-constant-folding.slang new file mode 100644 index 000000000..658abed17 --- /dev/null +++ b/tests/bugs/infer-var-type-constant-folding.slang @@ -0,0 +1,15 @@ +//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -allow-glsl +//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -allow-glsl -emit-spirv-directly + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer +//BUF: B + +RWStructuredBuffer<int> outputBuffer; + +static const let C = float(3); +static const let D = int(4+4+int(C)); + +void computeMain() +{ + outputBuffer[0] = D; +}
\ No newline at end of file |
