Add targets for WebGL

This commit is contained in:
Christoph Diehl 2018-02-20 02:16:37 +01:00
parent 1057bf42da
commit 29fd8b2d53
No known key found for this signature in database
GPG Key ID: 799CE5B68FEF404A
1 changed files with 52 additions and 32 deletions

View File

@ -33,5 +33,25 @@
'RGBA16F': {format: 'RGBA', type: ['HALF_FLOAT', 'FLOAT']},
'RGBA32F': {format: 'RGBA', type: ['FLOAT']},
'RGBA8UI': {format: 'RGBA_INTEGER', type: ['UNSIGNED_BYTE']}
},
buffetTarget: () => {
return random.item(['ARRAY_BUFFER', 'ELEMENT_ARRAY_BUFFER'])
},
textureTarget: (isWebGL2) => {
let target = ['TEXTURE_2D', 'TEXTURE_CUBE_MAP']
if (isWebGL2) {
target.extend(['TEXTURE_3D', 'TEXTURE_2D_ARRAY'])
}
return random.item(target)
},
framebufferTarget: (isWebGL2) => {
let target = ['FRAMEBUFFER']
if (isWebGL2) {
target.extends(['DRAW_FRAMEBUFFER', 'READ_FRAMEBUFFER'])
}
return random.item(target)
},
renderbufferTarget: () => {
return 'RENDERBUFFER'
}
}