Fix data packing functions on MSL (#1637)

* Fix data packing functions on MSL

`snorm` and `unorm` got mixed up.

* Fix bits.msl
This commit is contained in:
Vinh Truong 2021-12-31 18:44:54 +02:00 committed by GitHub
parent 1d0f484b37
commit 6aca3e0b36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -1207,10 +1207,10 @@ impl<W: Write> Writer<W> {
Mf::FindLsb => "",
Mf::FindMsb => "",
// data packing
Mf::Pack4x8snorm => "pack_float_to_unorm4x8",
Mf::Pack4x8unorm => "pack_float_to_snorm4x8",
Mf::Pack2x16snorm => "pack_float_to_unorm2x16",
Mf::Pack2x16unorm => "pack_float_to_snorm2x16",
Mf::Pack4x8snorm => "pack_float_to_snorm4x8",
Mf::Pack4x8unorm => "pack_float_to_unorm4x8",
Mf::Pack2x16snorm => "pack_float_to_snorm2x16",
Mf::Pack2x16unorm => "pack_float_to_unorm2x16",
Mf::Pack2x16float => "",
// data unpacking
Mf::Unpack4x8snorm => "unpack_snorm4x8_to_float",

View File

@ -24,13 +24,13 @@ kernel void main_(
f2_ = metal::float2(0.0);
f4_ = metal::float4(0.0);
metal::float4 _e28 = f4_;
u = metal::pack_float_to_unorm4x8(_e28);
u = metal::pack_float_to_snorm4x8(_e28);
metal::float4 _e30 = f4_;
u = metal::pack_float_to_snorm4x8(_e30);
u = metal::pack_float_to_unorm4x8(_e30);
metal::float2 _e32 = f2_;
u = metal::pack_float_to_unorm2x16(_e32);
u = metal::pack_float_to_snorm2x16(_e32);
metal::float2 _e34 = f2_;
u = metal::pack_float_to_snorm2x16(_e34);
u = metal::pack_float_to_unorm2x16(_e34);
metal::float2 _e36 = f2_;
u = as_type<uint>(half2(_e36));
metal::uint _e38 = u;