Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 22, 2025

The diagnostic warning 38010 for unsupported vk::binding attributes on entry point parameters was already implemented but lacked test coverage for the spirv target—the primary use case for Vulkan bindings.

Changes

  • Extended tests/diagnostics/entry-point-mod-errors.slang to include spirv target testing
  • Added tests/diagnostics/vk-binding-entry-point-param-spirv.slang with a focused test case matching the reported scenario

Example

Users compiling this code with -target spirv now see the diagnostic:

[shader("compute")]
[numthreads(32, 1, 1)]
void main(
    [[vk::binding(0, 1)]] StructuredBuffer<float> a,  // warning 38010
    [[vk::binding(3, 2)]] RWStructuredBuffer<float> b  // warning 38010
) { }

The diagnostic correctly informs users that these attributes are unsupported on entry point parameters and will be ignored.

Original prompt

This section details on the original issue you should resolve

<issue_title>vk::binding attribute ignored on entry point parameter</issue_title>
<issue_description># 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
    </issue_description>

Comments on the Issue (you are @copilot in this section)

@bmillsNV This isn't supported, but there should be a diagnostic. @jhelferty-nv There should be a diagnostic, @zopsicle can you confirm that you're seeing it? ``` test.slang(5): warning 38010: attribute '[[vk::binding(...)]]' on parameter 'a' is unsupported on entry point parameters and will be ignored StructuredBuffer a, ^ test.slang(7): warning 38010: attribute '[[vk::binding(...)]]' on parameter 'b' is unsupported on entry point parameters and will be ignored RWStructuredBuffer b, ^ ```

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix vk::binding attribute handling in entry point parameters Add spirv target test coverage for vk::binding diagnostic on entry point parameters Dec 22, 2025
Copilot AI requested a review from jkiviluoto-nv December 22, 2025 17:21
@jkiviluoto-nv jkiviluoto-nv assigned Copilot and unassigned Copilot Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vk::binding attribute ignored on entry point parameter

2 participants