(textureSize = this.texSize, tactic = this.tactic, isInt = false)
| 965 | } |
| 966 | } |
| 967 | getVariablePrecisionString(textureSize = this.texSize, tactic = this.tactic, isInt = false) { |
| 968 | if (!tactic) { |
| 969 | if (!this.constructor.features.isSpeedTacticSupported) return 'highp'; |
| 970 | const low = this.constructor.features[isInt ? 'lowIntPrecision' : 'lowFloatPrecision']; |
| 971 | const medium = this.constructor.features[isInt ? 'mediumIntPrecision' : 'mediumFloatPrecision']; |
| 972 | const high = this.constructor.features[isInt ? 'highIntPrecision' : 'highFloatPrecision']; |
| 973 | const requiredSize = Math.log2(textureSize[0] * textureSize[1]); |
| 974 | if (requiredSize <= low.rangeMax) { |
| 975 | return 'lowp'; |
| 976 | } else if (requiredSize <= medium.rangeMax) { |
| 977 | return 'mediump'; |
| 978 | } else if (requiredSize <= high.rangeMax) { |
| 979 | return 'highp'; |
| 980 | } else { |
| 981 | throw new Error(`The required size exceeds that of the ability of your system`); |
| 982 | } |
| 983 | } |
| 984 | switch (tactic) { |
| 985 | case 'speed': |
| 986 | return 'lowp'; |
| 987 | case 'balanced': |
| 988 | return 'mediump'; |
| 989 | case 'precision': |
| 990 | return 'highp'; |
| 991 | default: |
| 992 | throw new Error(`Unknown tactic "${tactic}" use "speed", "balanced", "precision", or empty for auto`); |
| 993 | } |
| 994 | } |
| 995 | |
| 996 | /** |
| 997 | * |
no outgoing calls
no test coverage detected