import { c as BindGroup, z as Texture } from "./Geometry-CzAM33a8.js";
//#region node_modules/pixi.js/lib/rendering/batcher/gpu/getTextureBatchBindGroup.mjs
const cachedGroups = {};
function getTextureBatchBindGroup(textures, size, maxTextures) {
	let uid = 2166136261;
	for (let i = 0; i < size; i++) {
		uid ^= textures[i].uid;
		uid = Math.imul(uid, 16777619);
		uid >>>= 0;
	}
	return cachedGroups[uid] || generateTextureBatchBindGroup(textures, size, uid, maxTextures);
}
function generateTextureBatchBindGroup(textures, size, key, maxTextures) {
	const bindGroupResources = {};
	let bindIndex = 0;
	for (let i = 0; i < maxTextures; i++) {
		const texture = i < size ? textures[i] : Texture.EMPTY.source;
		bindGroupResources[bindIndex++] = texture.source;
		bindGroupResources[bindIndex++] = texture.style;
	}
	const bindGroup = new BindGroup(bindGroupResources);
	cachedGroups[key] = bindGroup;
	return bindGroup;
}
//#endregion
export { getTextureBatchBindGroup as t };

//# sourceMappingURL=getTextureBatchBindGroup-DjKmlF1z.js.map