summaryrefslogtreecommitdiff
path: root/tests/language-feature/enums
diff options
context:
space:
mode:
authorCopilot <198982749+Copilot@users.noreply.github.com>2025-10-01 14:14:05 -0700
committerGitHub <noreply@github.com>2025-10-01 14:14:05 -0700
commitcd7da79f50f2b8fb9bca797131585ff1b85698f6 (patch)
treea3d5baecee6aa207b7b950aedc464eaa8585b60e /tests/language-feature/enums
parenta43ac0053eb49fde3329cc7fdc7f60f45e502704 (diff)
Fix incorrect binding index assignment for StructuredBuffer and ByteAddressBuffer with DescriptorHandle (#8252)
- [x] Fix segmentation fault in wrapConstantBufferElement for DescriptorHandle types - [x] Split DescriptorKind.Buffer into ConstantBuffer and StorageBuffer - [x] Update binding enums with descriptive names (ConstantBuffer_Read, StorageBuffer_Read, etc.) - [x] Update resource type mappings for correct binding assignments - [x] Update template logic to handle ConstantBuffer and StorageBuffer kinds separately - [x] Update tests to reflect correct binding assignments - [x] Split DescriptorKind.TexelBuffer into UniformTexelBuffer and StorageTexelBuffer - [x] Update TextureBuffer<T> to use UniformTexelBuffer kind - [x] Update _Texture extension to determine texel buffer kind based on access mode - [x] Update test desc-handle-1.slang to handle new DescriptorKind enum cases <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/shader-slang/slang/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/language-feature/enums')
-rw-r--r--tests/language-feature/enums/enum-use-prev-value.slang18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/language-feature/enums/enum-use-prev-value.slang b/tests/language-feature/enums/enum-use-prev-value.slang
new file mode 100644
index 000000000..b3a9ed2eb
--- /dev/null
+++ b/tests/language-feature/enums/enum-use-prev-value.slang
@@ -0,0 +1,18 @@
+//TEST:INTERPRET(filecheck=CHECK):
+
+enum MyEnum
+{
+ A,
+ B = A,
+ C
+}
+
+void main()
+{
+ // CHECK: A = 0
+ printf("A = %d\n", MyEnum.A);
+ // CHECK: B = 0
+ printf("B = %d\n", MyEnum.B);
+ // CHECK: C = 1
+ printf("C = %d\n", MyEnum.C);
+} \ No newline at end of file