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

InterlockedAdd and co. suddenly broken #7031

Closed
coffeenotfound opened this issue Dec 10, 2024 · 2 comments
Closed

InterlockedAdd and co. suddenly broken #7031

coffeenotfound opened this issue Dec 10, 2024 · 2 comments
Labels
bug Bug, regression, crash needs-triage Awaiting triage

Comments

@coffeenotfound
Copy link

Description
The atomic functions like InterlockedAdd are suddenly not functioning anymore,
complaining that the destination cannot be converted to an int& or long& reference.

This affects both groupshared and RWTexture2D destinations (and probably all others too)

I'm at a loss why this is now suddenly happening when it worked perfectly all the time

test.hlsl:6:2: error: no matching function for call to 'InterlockedAdd'
        InterlockedAdd(foo, 1.0);
        ^~~~~~~~~~~~~~
test.hlsl:6:2: note: candidate function not viable: no known conversion from '__attribute__((address_space(3))) float' to 'unsigned long long &' for 1st argument
        InterlockedAdd(foo, 1.0);
        ^              ~~~
test.hlsl:6:2: note: candidate function not viable: no known conversion from '__attribute__((address_space(3))) float' to 'int &' for 1st argument
        InterlockedAdd(foo, 1.0);
        ^              ~~~

Steps to Reproduce
Test code:

groupshared float foo;

[numthreads(64, 1, 1)]
void main() {
	InterlockedAdd(foo, 1.0);
}

dxc -E main -T cs_6_4 test.hlsl

Actual Behavior
The above code should compile successfully

Environment

  • DXC version: "libdxcompiler.so: 1.8(dev;4662-416fab6b); libdxil.so: 1.8" (the newest release version from July 2024)
  • Host Operating System Linux 6.12.3-arch1-1
@coffeenotfound coffeenotfound added bug Bug, regression, crash needs-triage Awaiting triage labels Dec 10, 2024
@damyanp
Copy link
Member

damyanp commented Dec 10, 2024

InterlockedAdd is documented as only working on int or uints.

@coffeenotfound
Copy link
Author

Ah, that would explain it. Though I swear, I have used it on floats before...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash needs-triage Awaiting triage
Projects
Archived in project
Development

No branches or pull requests

2 participants