This commit is contained in:
Christoph Diehl 2018-02-22 06:59:27 +01:00
parent c85d69abe2
commit f280f25cd7
No known key found for this signature in database
GPG key ID: 799CE5B68FEF404A

View file

@ -34,6 +34,12 @@ make.webgl = {
'RGBA32F': {format: 'RGBA', type: ['FLOAT']}, 'RGBA32F': {format: 'RGBA', type: ['FLOAT']},
'RGBA8UI': {format: 'RGBA_INTEGER', type: ['UNSIGNED_BYTE']} 'RGBA8UI': {format: 'RGBA_INTEGER', type: ['UNSIGNED_BYTE']}
}, },
WebGLFormat: () => {
let internalformat = random.item(Object.keys(make.webgl.internalFormat))
let format = make.webgl.internalFormat[internalformat].format
let type = random.item(make.webgl.internalFormat[internalformat].type)
return [internalformat, format, type]
},
textureSources: () => { textureSources: () => {
let sources = [ let sources = [
'HTMLCanvasElement', 'HTMLCanvasElement',
@ -68,7 +74,7 @@ make.webgl = {
'ELEMENT_ARRAY_BUFFER' 'ELEMENT_ARRAY_BUFFER'
] ]
if (isWebGL2) { if (isWebGL2) {
target.extends([ target.extend([
'COPY_READ_BUFFER', 'COPY_READ_BUFFER',
'COPY_WRITE_BUFFER', 'COPY_WRITE_BUFFER',
'TRANSFORM_FEEDBACK_BUFFER', 'TRANSFORM_FEEDBACK_BUFFER',
@ -173,7 +179,7 @@ make.webgl = {
'FUNC_REVERSE_SUBTRACT' 'FUNC_REVERSE_SUBTRACT'
] ]
if (isWebGL2) { if (isWebGL2) {
mode.extends([ mode.extend([
'MIN', 'MIN',
'MAX' 'MAX'
]) ])
@ -233,7 +239,7 @@ make.webgl = {
} }
return random.item(target) return random.item(target)
}, },
randomDepthFunc: (isWebGL2) => { randomFunc: (isWebGL2) => {
let func = [ let func = [
'NEVER', 'NEVER',
'LESS', 'LESS',
@ -259,7 +265,7 @@ make.webgl = {
'STENCIL_TEST' 'STENCIL_TEST'
] ]
if (isWebGL2) { if (isWebGL2) {
cap.extends([ cap.extend([
'RASTERIZER_DISCARD' 'RASTERIZER_DISCARD'
]) ])
} }
@ -285,7 +291,7 @@ make.webgl = {
'DEPTH_STENCIL_ATTACHMENT' 'DEPTH_STENCIL_ATTACHMENT'
] ]
if (isWebGL2) { if (isWebGL2) {
attachment.extends([ attachment.extend([
'COLOR_ATTACHMENT' + random.range(0, 15) 'COLOR_ATTACHMENT' + random.range(0, 15)
]) ])
} }
@ -299,7 +305,7 @@ make.webgl = {
'FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE' 'FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE'
] ]
if (isWebGL2) { if (isWebGL2) {
pname.extends([ pname.extend([
'FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE', 'FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE',
'FRAMEBUFFER_ATTACHMENT_BLUE_SIZE', 'FRAMEBUFFER_ATTACHMENT_BLUE_SIZE',
'FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING', 'FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING',
@ -311,7 +317,7 @@ make.webgl = {
'FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER' 'FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER'
]) ])
} }
random.item(pname) return random.item(pname)
}, },
randomShaderPrecision: (isWebGL2) => { randomShaderPrecision: (isWebGL2) => {
let precisiontype = [ let precisiontype = [
@ -361,7 +367,7 @@ make.webgl = {
'VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE' 'VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE'
]) ])
} }
return random.item([pname]) return random.item(pname)
}, },
randomHint: (isWebGL2) => { randomHint: (isWebGL2) => {
let target = [ let target = [
@ -384,8 +390,8 @@ make.webgl = {
}, },
randomPixelStorage: (isWebGL2) => { randomPixelStorage: (isWebGL2) => {
let pname = { let pname = {
'PACK_ALIGNMENT': random.range([1, 2, 4, 8]), 'PACK_ALIGNMENT': random.item([1, 2, 4, 8]),
'UNPACK_ALIGNMENT': random.range([1, 2, 4, 8]), 'UNPACK_ALIGNMENT': random.item([1, 2, 4, 8]),
'UNPACK_FLIP_Y_WEBGL': random.bool(), 'UNPACK_FLIP_Y_WEBGL': random.bool(),
'UNPACK_PREMULTIPLY_ALPHA_WEBGL': random.bool(), 'UNPACK_PREMULTIPLY_ALPHA_WEBGL': random.bool(),
'UNPACK_COLORSPACE_CONVERSION_WEBGL': random.item([0, 0x9244]) 'UNPACK_COLORSPACE_CONVERSION_WEBGL': random.item([0, 0x9244])
@ -490,7 +496,7 @@ make.webgl = {
] ]
return random.item(target) return random.item(target)
}, },
randomeUniformParameter: (isWebGL2) => { randomUniformParameter: (isWebGL2) => {
let pname = [ let pname = [
'UNIFORM_TYPE', 'UNIFORM_TYPE',
'UNIFORM_SIZE', 'UNIFORM_SIZE',
@ -532,7 +538,7 @@ make.webgl = {
'STREAM_DRAW' 'STREAM_DRAW'
] ]
if (isWebGL2) { if (isWebGL2) {
usage.extends([ usage.extend([
'STATIC_READ', 'STATIC_READ',
'DYNAMIC_READ', 'DYNAMIC_READ',
'STREAM_READ', 'STREAM_READ',