Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/diagnostics/entry-point-mod-errors.slang
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry computeMain -target cuda
//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry computeMain -target metal
//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry computeMain -target cpp
//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry computeMain -target spirv
[shader("compute")]
[numthreads(1,1,1)]
void computeMain(
Expand Down
18 changes: 18 additions & 0 deletions tests/diagnostics/vk-binding-entry-point-param-spirv.slang
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Test that vk::binding attributes on entry point parameters trigger a warning on spirv target
// This addresses the issue where vk::binding is ignored on entry point parameters

//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry main -target spirv

[numthreads(32, 1, 1)]
[shader("compute")]
void main(
// CHECK: ([[#@LINE+1]]): warning 38010: {{.*}}vk::binding{{.*}}a
[[vk::binding(/* binding */ 0, /* set */ 1)]]
StructuredBuffer<float> a,
// CHECK: ([[#@LINE+1]]): warning 38010: {{.*}}vk::binding{{.*}}b
[[vk::binding(/* binding */ 3, /* set */ 2)]]
RWStructuredBuffer<float> b,
)
{
b[0] = a[0];
}