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

Add Slang-specific intrinsics for integer pack/unpack #6459

Merged
merged 12 commits into from
Feb 28, 2025

Conversation

fairywreath
Copy link
Contributor

Related to #6175.

Adds Slang-specific integer pack/unpack intrinsics based on the proposal.

This change is mostly moving the code from the already implemented HLSL pack/unpack intrinsics with code improvements. Floating point intrinsics will be added in a follow-up PR - I am making a separate PR for the integer intrinsics to reduce the size of this follow-up PR.

@fairywreath fairywreath requested a review from a team as a code owner February 26, 2025 07:06
@fairywreath fairywreath changed the title Add Slang syntax for integer pack/unpack Add Slang-specific intrinsics for integer pack/unpack Feb 26, 2025
@csyonghe
Copy link
Collaborator

According to the proposal, we should just delete int8_t4_packed as a special builtin basic type, and just define it as a typealias to uint.

I now think it wasn’t not a great idea to introduce the type as another basic type, because it will introduce too many additional overloaded functions/operators for no benefit. Let’s remove it from our existing code.

@fairywreath fairywreath marked this pull request as draft February 26, 2025 17:56
@fairywreath fairywreath marked this pull request as ready for review February 26, 2025 18:12
@fairywreath
Copy link
Contributor Author

I've removed the builtin types - the change now looks big but the builtin type removal can be found in this commit
remove builtin packed types, use typealias instead f933014. The rest of the changes in this PR are just hlsl.meta.slang changes and test update.

csyonghe
csyonghe previously approved these changes Feb 27, 2025
return packInt4x8Clamp(unpackedValue);
}

// Work-graphs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is work-graph showing up here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added code below work-graphs(which is the last section of the hlsl.meta.slang file) but since the added code is similar to some existing code git treated it as if I moved the work-graphs section up.

Also there seems to be a formatting error, I will push a quick fix.

@fairywreath fairywreath requested a review from csyonghe February 27, 2025 14:48
@csyonghe csyonghe added the pr: non-breaking PRs without breaking changes label Feb 28, 2025
@csyonghe csyonghe merged commit efbfa78 into shader-slang:master Feb 28, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants