Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WGSL: No matching overload for operator... #5606

Open
aleino-nv opened this issue Nov 20, 2024 · 1 comment · May be fixed by #5692
Open

WGSL: No matching overload for operator... #5606

aleino-nv opened this issue Nov 20, 2024 · 1 comment · May be fixed by #5692
Assignees
Labels
goal:forward looking Feature needed at a later date, not connected to a specific use case.

Comments

@aleino-nv
Copy link
Collaborator

Affected tests:

  • tests/language-feature/enums/strongly-typed-id.slang (operator ==, signed/unsigned mismatch)

Example output:

WGPU error: Error while parsing WGSL: :25:8 error: no matching overload for 'operator == (u32, i32)'

2 candidate operators:
 • 'operator == (T  ✓ , T  ✗ ) -> bool' where:
      ✓  'T' is 'abstract-int', 'abstract-float', 'f32', 'f16', 'i32', 'u32' or 'bool'
 • 'operator == (vecN<T>  ✗ , vecN<T>  ✗ ) -> vecN<bool>' where:
      ✗  'T' is 'abstract-int', 'abstract-float', 'f32', 'f16', 'i32', 'u32' or 'bool'

    if(id_1 == i32(4))
       ^^^^^^^^^^^^^^


 - While validating [ShaderModuleDescriptor]
 - While calling [Device].CreateShaderModule([ShaderModuleDescriptor]).
@bmillsNV bmillsNV added this to the Q4 2024 (Fall) milestone Nov 21, 2024
@bmillsNV bmillsNV added the goal:forward looking Feature needed at a later date, not connected to a specific use case. label Nov 21, 2024
@aleino-nv
Copy link
Collaborator Author

I have a fix that adds some WGSL legalization for the issue described here.

However, that just revealed a similar issue for mismatching return value types.
I'll create a fix for that as well, as part of this issue.

aleino-nv added a commit to aleino-nv/slang that referenced this issue Nov 27, 2024
aleino-nv added a commit to aleino-nv/slang that referenced this issue Nov 27, 2024
@aleino-nv aleino-nv linked a pull request Nov 27, 2024 that will close this issue
aleino-nv added a commit to aleino-nv/slang that referenced this issue Nov 27, 2024
This fixes signedness mismatch issues for:
- Binary operators
- Return values

This closes shader-slang#5606.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal:forward looking Feature needed at a later date, not connected to a specific use case.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants