Skip to content

vk::binding attribute ignored on entry point parameter #9216

@zopsicle

Description

@zopsicle

Issue Description

The vk::binding attribute is ignored if it is specified on an entry point parameter.

Reproducer Code

[numthreads(32, 1, 1)]
[shader("compute")]
void main(
    [[vk::binding(/* binding */ 0, /* set */ 1)]]
    StructuredBuffer<float> a,
    [[vk::binding(/* binding */ 3, /* set */ 2)]]
    RWStructuredBuffer<float> b,
)
{
    b[0] = a[0];
}
slang -entry main -o main.spv main.slang
spirv-dis main.spv

Expected Behavior

The SPIR-V object defines two descriptors, one with binding 0 set 1, and one with binding 3 set 2.

Actual Behavior

The SPIR-V object defines two descriptors, one with binding 0 set 0, and one with binding 1 set 0.

Environment

  • Slang Version: v2025.23.2
  • OS: NixOS 25.05

Metadata

Metadata

Labels

DiagnosticsMissing DiagnosticWe should be emitting a diagnostics but we don't or crash or emit bad code

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions