Merge pull request #270 from scyganINTEL/bitfield_buildins
Use proper precision qualifiers for bitfield build-in functions on ES
This commit is contained in:
@@ -1242,26 +1242,6 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan)
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 400)) {
|
||||
commonBuiltins.append(
|
||||
"highp uint uaddCarry( uint, uint, out uint carry);"
|
||||
"highp uvec2 uaddCarry(uvec2, uvec2, out uvec2 carry);"
|
||||
"highp uvec3 uaddCarry(uvec3, uvec3, out uvec3 carry);"
|
||||
"highp uvec4 uaddCarry(uvec4, uvec4, out uvec4 carry);"
|
||||
|
||||
"highp uint usubBorrow( uint, uint, out uint borrow);"
|
||||
"highp uvec2 usubBorrow(uvec2, uvec2, out uvec2 borrow);"
|
||||
"highp uvec3 usubBorrow(uvec3, uvec3, out uvec3 borrow);"
|
||||
"highp uvec4 usubBorrow(uvec4, uvec4, out uvec4 borrow);"
|
||||
|
||||
"void umulExtended( uint, uint, out uint, out uint lsb);"
|
||||
"void umulExtended(uvec2, uvec2, out uvec2, out uvec2 lsb);"
|
||||
"void umulExtended(uvec3, uvec3, out uvec3, out uvec3 lsb);"
|
||||
"void umulExtended(uvec4, uvec4, out uvec4, out uvec4 lsb);"
|
||||
|
||||
"void imulExtended( int, int, out int, out int lsb);"
|
||||
"void imulExtended(ivec2, ivec2, out ivec2, out ivec2 lsb);"
|
||||
"void imulExtended(ivec3, ivec3, out ivec3, out ivec3 lsb);"
|
||||
"void imulExtended(ivec4, ivec4, out ivec4, out ivec4 lsb);"
|
||||
|
||||
" int bitfieldExtract( int, int, int);"
|
||||
"ivec2 bitfieldExtract(ivec2, int, int);"
|
||||
"ivec3 bitfieldExtract(ivec3, int, int);"
|
||||
@@ -1282,6 +1262,41 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan)
|
||||
"uvec3 bitfieldInsert(uvec3 base, uvec3, int, int);"
|
||||
"uvec4 bitfieldInsert(uvec4 base, uvec4, int, int);"
|
||||
|
||||
"lowp int findLSB( int);"
|
||||
"lowp ivec2 findLSB(ivec2);"
|
||||
"lowp ivec3 findLSB(ivec3);"
|
||||
"lowp ivec4 findLSB(ivec4);"
|
||||
|
||||
"lowp int findLSB( uint);"
|
||||
"lowp ivec2 findLSB(uvec2);"
|
||||
"lowp ivec3 findLSB(uvec3);"
|
||||
"lowp ivec4 findLSB(uvec4);"
|
||||
|
||||
"\n");
|
||||
}
|
||||
|
||||
if (profile != EEsProfile && version >= 400) {
|
||||
commonBuiltins.append(
|
||||
" uint uaddCarry( uint, uint, out uint carry);"
|
||||
"uvec2 uaddCarry(uvec2, uvec2, out uvec2 carry);"
|
||||
"uvec3 uaddCarry(uvec3, uvec3, out uvec3 carry);"
|
||||
"uvec4 uaddCarry(uvec4, uvec4, out uvec4 carry);"
|
||||
|
||||
" uint usubBorrow( uint, uint, out uint borrow);"
|
||||
"uvec2 usubBorrow(uvec2, uvec2, out uvec2 borrow);"
|
||||
"uvec3 usubBorrow(uvec3, uvec3, out uvec3 borrow);"
|
||||
"uvec4 usubBorrow(uvec4, uvec4, out uvec4 borrow);"
|
||||
|
||||
"void umulExtended( uint, uint, out uint, out uint lsb);"
|
||||
"void umulExtended(uvec2, uvec2, out uvec2, out uvec2 lsb);"
|
||||
"void umulExtended(uvec3, uvec3, out uvec3, out uvec3 lsb);"
|
||||
"void umulExtended(uvec4, uvec4, out uvec4, out uvec4 lsb);"
|
||||
|
||||
"void imulExtended( int, int, out int, out int lsb);"
|
||||
"void imulExtended(ivec2, ivec2, out ivec2, out ivec2 lsb);"
|
||||
"void imulExtended(ivec3, ivec3, out ivec3, out ivec3 lsb);"
|
||||
"void imulExtended(ivec4, ivec4, out ivec4, out ivec4 lsb);"
|
||||
|
||||
" int bitfieldReverse( int);"
|
||||
"ivec2 bitfieldReverse(ivec2);"
|
||||
"ivec3 bitfieldReverse(ivec3);"
|
||||
@@ -1302,16 +1317,6 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan)
|
||||
"ivec3 bitCount(uvec3);"
|
||||
"ivec4 bitCount(uvec4);"
|
||||
|
||||
"lowp int findLSB( int);"
|
||||
"lowp ivec2 findLSB(ivec2);"
|
||||
"lowp ivec3 findLSB(ivec3);"
|
||||
"lowp ivec4 findLSB(ivec4);"
|
||||
|
||||
"lowp int findLSB( uint);"
|
||||
"lowp ivec2 findLSB(uvec2);"
|
||||
"lowp ivec3 findLSB(uvec3);"
|
||||
"lowp ivec4 findLSB(uvec4);"
|
||||
|
||||
" int findMSB( int);"
|
||||
"ivec2 findMSB(ivec2);"
|
||||
"ivec3 findMSB(ivec3);"
|
||||
@@ -1321,6 +1326,61 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan)
|
||||
"ivec2 findMSB(uvec2);"
|
||||
"ivec3 findMSB(uvec3);"
|
||||
"ivec4 findMSB(uvec4);"
|
||||
|
||||
"\n");
|
||||
}
|
||||
|
||||
if (profile == EEsProfile && version >= 310) {
|
||||
commonBuiltins.append(
|
||||
"highp uint uaddCarry(highp uint, highp uint, out lowp uint carry);"
|
||||
"highp uvec2 uaddCarry(highp uvec2, highp uvec2, out lowp uvec2 carry);"
|
||||
"highp uvec3 uaddCarry(highp uvec3, highp uvec3, out lowp uvec3 carry);"
|
||||
"highp uvec4 uaddCarry(highp uvec4, highp uvec4, out lowp uvec4 carry);"
|
||||
|
||||
"highp uint usubBorrow(highp uint, highp uint, out lowp uint borrow);"
|
||||
"highp uvec2 usubBorrow(highp uvec2, highp uvec2, out lowp uvec2 borrow);"
|
||||
"highp uvec3 usubBorrow(highp uvec3, highp uvec3, out lowp uvec3 borrow);"
|
||||
"highp uvec4 usubBorrow(highp uvec4, highp uvec4, out lowp uvec4 borrow);"
|
||||
|
||||
"void umulExtended(highp uint, highp uint, highp out uint, out highp uint lsb);"
|
||||
"void umulExtended(highp uvec2, highp uvec2, highp out uvec2, out highp uvec2 lsb);"
|
||||
"void umulExtended(highp uvec3, highp uvec3, highp out uvec3, out highp uvec3 lsb);"
|
||||
"void umulExtended(highp uvec4, highp uvec4, highp out uvec4, out highp uvec4 lsb);"
|
||||
|
||||
"void imulExtended(highp int, highp int, highp out int, out highp int lsb);"
|
||||
"void imulExtended(highp ivec2, highp ivec2, highp out ivec2, out highp ivec2 lsb);"
|
||||
"void imulExtended(highp ivec3, highp ivec3, highp out ivec3, out highp ivec3 lsb);"
|
||||
"void imulExtended(highp ivec4, highp ivec4, highp out ivec4, out highp ivec4 lsb);"
|
||||
|
||||
"highp int bitfieldReverse(highp int);"
|
||||
"highp ivec2 bitfieldReverse(highp ivec2);"
|
||||
"highp ivec3 bitfieldReverse(highp ivec3);"
|
||||
"highp ivec4 bitfieldReverse(highp ivec4);"
|
||||
|
||||
"highp uint bitfieldReverse(highp uint);"
|
||||
"highp uvec2 bitfieldReverse(highp uvec2);"
|
||||
"highp uvec3 bitfieldReverse(highp uvec3);"
|
||||
"highp uvec4 bitfieldReverse(highp uvec4);"
|
||||
|
||||
"lowp int bitCount( int);"
|
||||
"lowp ivec2 bitCount(ivec2);"
|
||||
"lowp ivec3 bitCount(ivec3);"
|
||||
"lowp ivec4 bitCount(ivec4);"
|
||||
|
||||
"lowp int bitCount( uint);"
|
||||
"lowp ivec2 bitCount(uvec2);"
|
||||
"lowp ivec3 bitCount(uvec3);"
|
||||
"lowp ivec4 bitCount(uvec4);"
|
||||
|
||||
"lowp int findMSB(highp int);"
|
||||
"lowp ivec2 findMSB(highp ivec2);"
|
||||
"lowp ivec3 findMSB(highp ivec3);"
|
||||
"lowp ivec4 findMSB(highp ivec4);"
|
||||
|
||||
"lowp int findMSB(highp uint);"
|
||||
"lowp ivec2 findMSB(highp uvec2);"
|
||||
"lowp ivec3 findMSB(highp uvec3);"
|
||||
"lowp ivec4 findMSB(highp uvec4);"
|
||||
|
||||
"\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user