소스 검색

shaderc: Fixed pack/unpackHalf2x16.

Branimir Karadžić 8 년 전
부모
커밋
2e31ff9fd4
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/bgfx_shader.sh

+ 2 - 2
src/bgfx_shader.sh

@@ -91,12 +91,12 @@ uint4 bitfieldReverse(uint4 _x) { return reversebits(_x); }
 #		if !BGFX_SHADER_LANGUAGE_SPIRV
 #		if !BGFX_SHADER_LANGUAGE_SPIRV
 uint packHalf2x16(vec2 _x)
 uint packHalf2x16(vec2 _x)
 {
 {
-	return (f32tof16(_x.x)<<16) | f32tof16(_x.y);
+	return (f32tof16(_x.y)<<16) | f32tof16(_x.x);
 }
 }
 
 
 vec2 unpackHalf2x16(uint _x)
 vec2 unpackHalf2x16(uint _x)
 {
 {
-	return vec2(f16tof32(_x >> 16), f16tof32(_x) );
+	return vec2(f16tof32(_x & 0xffff), f16tof32(_x >> 16) );
 }
 }
 #		endif // !BGFX_SHADER_LANGUAGE_SPIRV
 #		endif // !BGFX_SHADER_LANGUAGE_SPIRV