| 3881 | |
| 3882 | template <typename el> |
| 3883 | static QString RowValuesToString(int cols, ShaderVariableFlags flags, el x, el y, el z, el w) |
| 3884 | { |
| 3885 | if(flags & ShaderVariableFlags::Truncated) |
| 3886 | { |
| 3887 | QString ret = lit("---"); |
| 3888 | for(int i = 1; i < cols; i++) |
| 3889 | ret += lit(", ---"); |
| 3890 | return ret; |
| 3891 | } |
| 3892 | |
| 3893 | const bool hex = bool(flags & ShaderVariableFlags::HexDisplay); |
| 3894 | |
| 3895 | if(bool(flags & ShaderVariableFlags::BinaryDisplay)) |
| 3896 | { |
| 3897 | if(cols == 1) |
| 3898 | return Formatter::BinFormat(x); |
| 3899 | else if(cols == 2) |
| 3900 | return QFormatStr("%1, %2").arg(Formatter::BinFormat(x)).arg(Formatter::BinFormat(y)); |
| 3901 | else if(cols == 3) |
| 3902 | return QFormatStr("%1, %2, %3") |
| 3903 | .arg(Formatter::BinFormat(x)) |
| 3904 | .arg(Formatter::BinFormat(y)) |
| 3905 | .arg(Formatter::BinFormat(z)); |
| 3906 | else |
| 3907 | return QFormatStr("%1, %2, %3, %4") |
| 3908 | .arg(Formatter::BinFormat(x)) |
| 3909 | .arg(Formatter::BinFormat(y)) |
| 3910 | .arg(Formatter::BinFormat(z)) |
| 3911 | .arg(Formatter::BinFormat(w)); |
| 3912 | } |
| 3913 | |
| 3914 | if(cols == 1) |
| 3915 | return Formatter::Format(x, hex); |
| 3916 | else if(cols == 2) |
| 3917 | return QFormatStr("%1, %2").arg(Formatter::Format(x, hex)).arg(Formatter::Format(y, hex)); |
| 3918 | else if(cols == 3) |
| 3919 | return QFormatStr("%1, %2, %3") |
| 3920 | .arg(Formatter::Format(x, hex)) |
| 3921 | .arg(Formatter::Format(y, hex)) |
| 3922 | .arg(Formatter::Format(z, hex)); |
| 3923 | else |
| 3924 | return QFormatStr("%1, %2, %3, %4") |
| 3925 | .arg(Formatter::Format(x, hex)) |
| 3926 | .arg(Formatter::Format(y, hex)) |
| 3927 | .arg(Formatter::Format(z, hex)) |
| 3928 | .arg(Formatter::Format(w, hex)); |
| 3929 | } |
| 3930 | |
| 3931 | QString RowString(const ShaderVariable &v, uint32_t row, VarType type) |
| 3932 | { |