export function evaluateResourceBudget(budget, usage) {
    const texturePercent = ratio(usage.textureBytes, budget.textureBudgetBytes);
    const geometryPercent = ratio(usage.geometryBytes, budget.geometryBudgetBytes);
    const drawCallPercent = ratio(usage.drawCalls, budget.drawCallBudget);
    const warnings = [
        ...(texturePercent > 1 ? ["texture-budget-exceeded"] : texturePercent > 0.8 ? ["texture-budget-near-limit"] : []),
        ...(geometryPercent > 1 ? ["geometry-budget-exceeded"] : geometryPercent > 0.8 ? ["geometry-budget-near-limit"] : []),
        ...(drawCallPercent > 1 ? ["draw-call-budget-exceeded"] : drawCallPercent > 0.8 ? ["draw-call-budget-near-limit"] : [])
    ];
    return {
        withinBudget: warnings.every((warning) => !warning.endsWith("exceeded")),
        texturePercent,
        geometryPercent,
        drawCallPercent,
        warnings
    };
}
function ratio(value, budget) {
    return budget <= 0 ? Number.POSITIVE_INFINITY : Math.max(0, value) / budget;
}
//# sourceMappingURL=ResourceBudget.js.map