diff options
| author | Copilot <198982749+Copilot@users.noreply.github.com> | 2025-07-24 22:05:51 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-25 05:05:51 +0000 |
| commit | 528ca0d0e55df88a9a97ba071ae803a62a34ae5a (patch) | |
| tree | 597d24c88a2afcd28ea233f19a4c2e09085b5ea0 /tests/bugs/enum-fragment-input.slang | |
| parent | fa946c659bd5ad577f30cf4565e13f9dcfc6937a (diff) | |
Fix compiler crash when enum is used as vertex output data (#7915)
* Initial plan
* Initial investigation and plan for enum vertex output fix
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix compiler crash when enum is used as vertex output data
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix compiler crash when enum is used as vertex output data
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Address reviewer feedback: use SLANG_ASSERT and improve CHECK directives
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
Diffstat (limited to 'tests/bugs/enum-fragment-input.slang')
| -rw-r--r-- | tests/bugs/enum-fragment-input.slang | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/bugs/enum-fragment-input.slang b/tests/bugs/enum-fragment-input.slang new file mode 100644 index 000000000..e03514467 --- /dev/null +++ b/tests/bugs/enum-fragment-input.slang @@ -0,0 +1,25 @@ +//TEST:SIMPLE(filecheck=CHECK):-target hlsl -stage fragment -entry main + +public enum VertexLayout : uint { + position = 0, + color = 1, + uv = 2 +} + +struct FragmentInput { + float4 position : SV_Position; + VertexLayout layout : TEXCOORD0; +}; + +struct FragmentOutput { + float4 color : SV_Target; +}; + +[shader("fragment")] +FragmentOutput main(in FragmentInput input) { + FragmentOutput output; + output.color = float4(float(input.layout), 0, 0, 1); + return output; +} + +//CHECK: main
\ No newline at end of file |
