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) } }