Added HLSL pack/unpackHalf2x16.

This commit is contained in:
Branimir Karadžić 2015-02-18 17:37:07 -08:00
parent 1295de90ea
commit 078dd5127f
1 changed files with 10 additions and 0 deletions

View File

@ -25,6 +25,16 @@ ivec2 floatBitsToInt(vec2 _x) { return asint(_x); }
ivec3 floatBitsToInt(vec3 _x) { return asint(_x); }
ivec4 floatBitsToInt(vec4 _x) { return asint(_x); }
uint packHalf2x16(vec2 _x)
{
return (f32tof16(_x.x)<<16) | f32tof16(_x.y);
}
vec2 unpackHalf2x16(uint _x)
{
return vec2(f16tof32(_x >> 16), f16tof32(_x) );
}
#define SHARED groupshared
#define IMAGE2D_RO(_name, _reg) Texture2D _name : register(t[_reg])