From 63a1772afa1bb8a76d637b2fe5f79135e145d736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schmelczer=20Andr=C3=A1s?= Date: Sat, 10 Oct 2020 11:57:36 +0200 Subject: [PATCH] Add warning for too many objects --- .../program/uniform-array-autoscaling-program.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/graphics/graphics-library/program/uniform-array-autoscaling-program.ts b/src/graphics/graphics-library/program/uniform-array-autoscaling-program.ts index b15ea0c..8b6ff95 100644 --- a/src/graphics/graphics-library/program/uniform-array-autoscaling-program.ts +++ b/src/graphics/graphics-library/program/uniform-array-autoscaling-program.ts @@ -80,7 +80,12 @@ export class UniformArrayAutoScalingProgram implements IProgram { const closest = this.programs.find((p) => p.values.every((v, i) => v >= values[i])); - this.current = (closest ? closest : last(this.programs))?.program; + if (closest) { + this.current = closest.program; + } else { + console.warn(`Not found compiled shader for this many objects ${values}`); + this.current = last(this.programs)?.program; + } if (closest) { this.descriptors!.map((d, i) => {