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

[SPIR-V] Avoid emitting Int64 when loading Float64 #7073

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

Keenuts
Copy link
Collaborator

@Keenuts Keenuts commented Jan 16, 2025

When loading a Float64 from a raw buffer, we used an Int64, which required an additional capability, even if the code wasn't using any Int64.
In practice, it seems most devices supporting Float64 do also support Int64, but this it doesn't have to.
By changing the codegen a bit, we can avoid the Int64 value.

Tested the word-order using a vulkan compute shader, and checking the returned value on the API side.

double tmp = buffer.Load<double>(0);
if (tmp == 12.0)
  buffer.Store<double>(0, 13.0);

Fixes #7038

When loading a Float64 from a raw buffer, we used an Int64, which
required an additional capability, even if the code wasn't using any
Int64.
In practice, it seems most devices supporting Float64 do also support
Int64, but this it doesn't have to.
By changing the codegen a bit, we can avoid the Int64 value.

Tested the word-order using a vulkan compute shader, and checking the
returned value on the API side.
```hlsl
double tmp = buffer.Load<double>(0);
if (tmp == 12.0)
  buffer.Store<double>(0, 13.0);
```

Fixes microsoft#7038

Signed-off-by: Nathan Gauër <[email protected]>
@Keenuts Keenuts requested a review from a team as a code owner January 16, 2025 16:02
@Keenuts
Copy link
Collaborator Author

Keenuts commented Jan 17, 2025

CI failure is caused by the workflow taking more than 90 minutes. Restarting it to see if that was just transient

@Keenuts Keenuts enabled auto-merge (squash) January 17, 2025 09:45
@Keenuts Keenuts merged commit e4636f0 into microsoft:main Jan 17, 2025
12 checks passed
@Keenuts Keenuts deleted the fix-7038 branch January 17, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
3 participants