-
Notifications
You must be signed in to change notification settings - Fork 245
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 floating-point pack/unpack proposal #6191
base: master
Are you sure you want to change the base?
Add floating-point pack/unpack proposal #6191
Conversation
### Built-in packed Datatypes | ||
Unlike HLSL's implementation with introduces new packed datatypes, `uint8_t4_packed` and `int8_t4_packed`, unsigned 32-bit integers are used directly | ||
and no new pakced datatypes are introduced. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong preference here and would really appreciate any suggestions or input. If new datatypes are to be introduced we would add something like half2_unorm_packed
, half2_snorm_packed
, half2_packed
, then another full set for the 8-bit variants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Are these functions named the same way after the corresponding HLSL intrinsic? Or should we name them using Slang's naming convention?
half2 unpack_snorm_f16f16(uint packedVal); | ||
|
||
float2 unpack_half_f16f32(uint packedVal); | ||
half4 unpack_half_f16f16(uint packedVal); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be half2 here. this should be exactly the same as bitcast<half2>
, right?
The proposal currently names them based on HLSL's intrinsics - I believe using Slang's naming convention is better. I will change them and will also add new intrinsics for the integer pack/unpack functions that follows Slang's naming convention in addition to the hlsl intrinsics. |
Related to #6175. Adds a proposal to define floating-point pack/unpack intrinsics.