Gawain: add short vector conversion to 10_10_10

This commit is contained in:
Clément Foucault
2017-05-13 16:38:32 +02:00
parent b43f66bcb6
commit b3e62a8aa2
2 changed files with 11 additions and 0 deletions

View File

@@ -87,5 +87,6 @@ typedef struct {
} PackedNormal;
PackedNormal convert_i10_v3(const float data[3]);
PackedNormal convert_i10_s3(const short data[3]);
#endif // USE_10_10_10

View File

@@ -271,4 +271,14 @@ PackedNormal convert_i10_v3(const float data[3])
return n;
}
PackedNormal convert_i10_s3(const short data[3])
{
PackedNormal n = {
.x = quantize((float)data[0] / 32767.0f),
.y = quantize((float)data[1] / 32767.0f),
.z = quantize((float)data[2] / 32767.0f)
};
return n;
}
#endif // USE_10_10_10