(vertexArray, attribute, accessor, header)
| 28018 | |
| 28019 | |
| 28020 | function getDebugTableRow(vertexArray, attribute, accessor, header) { |
| 28021 | var _ref3; // const round = xnum => Math.round(num * 10) / 10; |
| 28022 | |
| 28023 | |
| 28024 | var gl = vertexArray.gl; |
| 28025 | var type = 'NOT PROVIDED'; |
| 28026 | var size = 'N/A'; |
| 28027 | var verts = 'N/A'; |
| 28028 | var bytes = 'N/A'; |
| 28029 | var isInteger; |
| 28030 | var marker; |
| 28031 | var value; |
| 28032 | |
| 28033 | if (accessor) { |
| 28034 | type = accessor.type; |
| 28035 | size = accessor.size; // Generate a type name by dropping Array from Float32Array etc. |
| 28036 | |
| 28037 | type = String(type).replace('Array', ''); // Look for 'nt' to detect integer types, e.g. Int32Array, Uint32Array |
| 28038 | |
| 28039 | isInteger = type.indexOf('nt') !== -1; |
| 28040 | } |
| 28041 | |
| 28042 | if (attribute instanceof _buffer.default) { |
| 28043 | var _ref2; |
| 28044 | |
| 28045 | var buffer = attribute; |
| 28046 | |
| 28047 | var _buffer$getDebugData = buffer.getDebugData(), |
| 28048 | data = _buffer$getDebugData.data, |
| 28049 | modified = _buffer$getDebugData.modified; |
| 28050 | |
| 28051 | marker = modified ? '*' : ''; |
| 28052 | value = data; |
| 28053 | bytes = buffer.byteLength; |
| 28054 | verts = bytes / data.BYTES_PER_ELEMENT / size; |
| 28055 | var format; |
| 28056 | |
| 28057 | if (accessor) { |
| 28058 | var instanced = accessor.divisor > 0; |
| 28059 | format = "".concat(instanced ? 'I ' : 'P ', " ").concat(verts, " (x").concat(size, "=").concat(bytes, " bytes ").concat((0, _constantsToKeys.glKey)(gl, type), ")"); |
| 28060 | } else { |
| 28061 | // element buffer |
| 28062 | isInteger = true; |
| 28063 | format = "".concat(bytes, " bytes"); |
| 28064 | } |
| 28065 | |
| 28066 | return _ref2 = {}, (0, _defineProperty2.default)(_ref2, header, "".concat(marker).concat((0, _utils.formatValue)(value, { |
| 28067 | size: size, |
| 28068 | isInteger: isInteger |
| 28069 | }))), (0, _defineProperty2.default)(_ref2, 'Format ', format), _ref2; |
| 28070 | } // CONSTANT VALUE |
| 28071 | |
| 28072 | |
| 28073 | value = attribute; |
| 28074 | size = attribute.length; // Generate a type name by dropping Array from Float32Array etc. |
| 28075 | |
| 28076 | type = String(attribute.constructor.name).replace('Array', ''); // Look for 'nt' to detect integer types, e.g. Int32Array, Uint32Array |
| 28077 |
no test coverage detected