shader_decode: Use BitfieldExtract instead of shift + and

This commit is contained in:
ReinUsesLisp 2018-12-26 02:58:47 -03:00
parent 52223313b1
commit 2faad9bf23
8 changed files with 37 additions and 48 deletions

View file

@ -985,6 +985,11 @@ private:
Type::Int);
}
template <Type type>
std::string BitfieldExtract(Operation operation) {
return GenerateTernary(operation, "bitfieldExtract", type, type, Type::Int, Type::Int);
}
template <Type type>
std::string BitCount(Operation operation) {
return GenerateUnary(operation, "bitCount", type, type, false);
@ -1369,6 +1374,7 @@ private:
&GLSLDecompiler::BitwiseXor<Type::Int>,
&GLSLDecompiler::BitwiseNot<Type::Int>,
&GLSLDecompiler::BitfieldInsert<Type::Int>,
&GLSLDecompiler::BitfieldExtract<Type::Int>,
&GLSLDecompiler::BitCount<Type::Int>,
&GLSLDecompiler::Add<Type::Uint>,
@ -1386,6 +1392,7 @@ private:
&GLSLDecompiler::BitwiseXor<Type::Uint>,
&GLSLDecompiler::BitwiseNot<Type::Uint>,
&GLSLDecompiler::BitfieldInsert<Type::Uint>,
&GLSLDecompiler::BitfieldExtract<Type::Uint>,
&GLSLDecompiler::BitCount<Type::Uint>,
&GLSLDecompiler::Add<Type::HalfFloat>,