Add WebGL extensions names

This commit is contained in:
Christoph Diehl 2018-04-25 14:19:03 -07:00
parent e11c0eca0a
commit e245d40e38
No known key found for this signature in database
GPG key ID: 799CE5B68FEF404A

View file

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