<commit_before>/*
geometry/index-buffer - geometry index data
Part of Stardazed
(c) 2015-Present by <NAME> - @zenmumbler
https://github.com/stardazed/stardazed
*/

import { UInt16, UInt32, NumericTypeRef, numericTraits } from "stardazed/core";

/** Numerical constants for the allowed size of index elements */
export const enum IndexElementSize {
	UInt16 = 2,
	UInt32 = 4
}

/**
 * @expects isPositiveInteger(vertexCount)
 */
export function minimumIndexElementSizeForVertexCount(vertexCount: number) {
	if (vertexCount <= UInt16.max) {
		return IndexElementSize.UInt16;<commit_msg>style(geom): add note on vertex restart<commit_after>/*
geometry/index-buffer - geometry index data
Part of Stardazed
(c) 2015-Present by <NAME> - @zenmumbler
https://github.com/stardazed/stardazed
*/

import { UInt16, UInt32, NumericTypeRef, numericTraits } from "stardazed/core";

/** Numerical constants for the allowed size of index elements */
export const enum IndexElementSize {
	UInt16 = 2,
	UInt32 = 4
}

/**
 * @expects isPositiveInteger(vertexCount)
 */
export function minimumIndexElementSizeForVertexCount(vertexCount: number) {
	// note the equal comparison here, as in WebGL2 the maximum vertex
	// index is _always_ considered to be a vertex restart index and
	// cannot be used as a valid vertex index
	if (vertexCount <= UInt16.max) {
		return IndexElementSize.UInt16;
{'fraction_non_alphanumeric': 0.09934258582907232, 'fraction_numerical': 0.02702702702702703, 'mean_word_length': 4.805084745762712, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '492113', 'n_tokens_mistral': 450, 'n_tokens_neox': 416, 'n_words': 133}