From e245d40e384f929e4c6d5f0145fecbdebaab5dc5 Mon Sep 17 00:00:00 2001 From: Christoph Diehl <1614333+posidron@users.noreply.github.com> Date: Wed, 25 Apr 2018 14:19:03 -0700 Subject: [PATCH] Add WebGL extensions names --- lib/make/webgl.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/make/webgl.js b/lib/make/webgl.js index c1a557d..b3dc18f 100644 --- a/lib/make/webgl.js +++ b/lib/make/webgl.js @@ -786,8 +786,8 @@ class webgl extends make { return random.item(pname) } - static randomExtension () { - let extension = [ + static randomExtension (pattern) { + let extensions = [ 'ANGLE_instanced_arrays', 'EXT_blend_minmax', 'EXT_color_buffer_half_float', @@ -813,7 +813,13 @@ class webgl extends make { 'WEBGL_lose_context' ] - return random.item(extension) + if (pattern) { + let candidates = [] + extensions.forEach((ext) => ext.includes(pattern) ? candidates.push(ext) : '') + return random.item(candidates) + } + + return random.item(extensions) } }