Add constants for WebGL
This commit is contained in:
parent
08a4fb1b60
commit
c85d69abe2
1 changed files with 25 additions and 24 deletions
|
@ -60,14 +60,14 @@ make.webgl = {
|
||||||
return names
|
return names
|
||||||
},
|
},
|
||||||
randomBitmask: () => {
|
randomBitmask: () => {
|
||||||
return parseInt((random.subset([1,0], 8).join('')))
|
return parseInt((random.subset([1, 0], 8).join('')))
|
||||||
},
|
},
|
||||||
randomBufferTarget: (isWebGL2) => {
|
randomBufferTarget: (isWebGL2) => {
|
||||||
let target = [
|
let target = [
|
||||||
'ARRAY_BUFFER',
|
'ARRAY_BUFFER',
|
||||||
'ELEMENT_ARRAY_BUFFER'
|
'ELEMENT_ARRAY_BUFFER'
|
||||||
]
|
]
|
||||||
if (domino.modules.webgl.isWebGL2) {
|
if (isWebGL2) {
|
||||||
target.extends([
|
target.extends([
|
||||||
'COPY_READ_BUFFER',
|
'COPY_READ_BUFFER',
|
||||||
'COPY_WRITE_BUFFER',
|
'COPY_WRITE_BUFFER',
|
||||||
|
@ -100,7 +100,7 @@ make.webgl = {
|
||||||
return random.item(pname)
|
return random.item(pname)
|
||||||
},
|
},
|
||||||
randomTexParameterValue: (isWebGL2) => {
|
randomTexParameterValue: (isWebGL2) => {
|
||||||
let pname_param = {
|
let pnameparam = {
|
||||||
'TEXTURE_MAG_FILTER': [
|
'TEXTURE_MAG_FILTER': [
|
||||||
'LINEAR',
|
'LINEAR',
|
||||||
'NEAREST'
|
'NEAREST'
|
||||||
|
@ -122,11 +122,11 @@ make.webgl = {
|
||||||
'REPEAT',
|
'REPEAT',
|
||||||
'CLAMP_TO_EDGE',
|
'CLAMP_TO_EDGE',
|
||||||
'MIRRORED_REPEAT'
|
'MIRRORED_REPEAT'
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
if (isWebGL2) {
|
if (isWebGL2) {
|
||||||
pname_param = Object.assign(
|
pnameparam = Object.assign(
|
||||||
pname_param,
|
pnameparam,
|
||||||
{
|
{
|
||||||
'TEXTURE_BASE_LEVEL': [
|
'TEXTURE_BASE_LEVEL': [
|
||||||
make.number.any()
|
make.number.any()
|
||||||
|
@ -162,15 +162,15 @@ make.webgl = {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
pname = random.item(Object.keys(pname_param))
|
let pname = random.item(Object.keys(pnameparam))
|
||||||
param = random.item(pname_param[pname])
|
let param = random.item(pnameparam[pname])
|
||||||
return [pname, param]
|
return [pname, param]
|
||||||
},
|
},
|
||||||
randomBlendMode: (isWebGL2) => {
|
randomBlendMode: (isWebGL2) => {
|
||||||
let mode = [
|
let mode = [
|
||||||
'FUNC_ADD',
|
'FUNC_ADD',
|
||||||
'FUNC_SUBTRACT',
|
'FUNC_SUBTRACT',
|
||||||
'FUNC_REVERSE_SUBTRACT',
|
'FUNC_REVERSE_SUBTRACT'
|
||||||
]
|
]
|
||||||
if (isWebGL2) {
|
if (isWebGL2) {
|
||||||
mode.extends([
|
mode.extends([
|
||||||
|
@ -198,7 +198,7 @@ make.webgl = {
|
||||||
'ONE_MINUS_CONSTANT_ALPHA',
|
'ONE_MINUS_CONSTANT_ALPHA',
|
||||||
'SRC_ALPHA_SATURATE'
|
'SRC_ALPHA_SATURATE'
|
||||||
]
|
]
|
||||||
return ranodm.item(factor)
|
return random.item(factor)
|
||||||
},
|
},
|
||||||
randomFace: (isWebGL2) => {
|
randomFace: (isWebGL2) => {
|
||||||
let mode = [
|
let mode = [
|
||||||
|
@ -282,7 +282,7 @@ make.webgl = {
|
||||||
'COLOR_ATTACHMENT0',
|
'COLOR_ATTACHMENT0',
|
||||||
'DEPTH_ATTACHMENT',
|
'DEPTH_ATTACHMENT',
|
||||||
'STENCIL_ATTACHMENT',
|
'STENCIL_ATTACHMENT',
|
||||||
'DEPTH_STENCIL_ATTACHMENT',
|
'DEPTH_STENCIL_ATTACHMENT'
|
||||||
]
|
]
|
||||||
if (isWebGL2) {
|
if (isWebGL2) {
|
||||||
attachment.extends([
|
attachment.extends([
|
||||||
|
@ -384,8 +384,8 @@ make.webgl = {
|
||||||
},
|
},
|
||||||
randomPixelStorage: (isWebGL2) => {
|
randomPixelStorage: (isWebGL2) => {
|
||||||
let pname = {
|
let pname = {
|
||||||
'PACK_ALIGNMENT': random.range([1,2,4,8]),
|
'PACK_ALIGNMENT': random.range([1, 2, 4, 8]),
|
||||||
'UNPACK_ALIGNMENT': random.range([1,2,4,8]),
|
'UNPACK_ALIGNMENT': random.range([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])
|
||||||
|
@ -395,17 +395,17 @@ make.webgl = {
|
||||||
pname,
|
pname,
|
||||||
{
|
{
|
||||||
'PACK_ROW_LENGTH': make.number.any(),
|
'PACK_ROW_LENGTH': make.number.any(),
|
||||||
'PACK_SKIP_PIXELS': make.number.any(),
|
'PACK_SKIP_PIXELS': make.number.any(),
|
||||||
'PACK_SKIP_ROWS': make.number.any(),
|
'PACK_SKIP_ROWS': make.number.any(),
|
||||||
'UNPACK_ROW_LENGTH': make.number.any(),
|
'UNPACK_ROW_LENGTH': make.number.any(),
|
||||||
'UNPACK_IMAGE_HEIGHT': make.number.any(),
|
'UNPACK_IMAGE_HEIGHT': make.number.any(),
|
||||||
'UNPACK_SKIP_PIXELS': make.number.any(),
|
'UNPACK_SKIP_PIXELS': make.number.any(),
|
||||||
'UNPACK_SKIP_ROWS': make.number.any(),
|
'UNPACK_SKIP_ROWS': make.number.any(),
|
||||||
'UNPACK_SKIP_IMAGES': make.number.any()
|
'UNPACK_SKIP_IMAGES': make.number.any()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
name = random.item(Object.keys(pname))
|
let name = random.item(Object.keys(pname))
|
||||||
return [name, pname[name]]
|
return [name, pname[name]]
|
||||||
},
|
},
|
||||||
randomStencilAction: (isWebGL2) => {
|
randomStencilAction: (isWebGL2) => {
|
||||||
|
@ -419,6 +419,7 @@ make.webgl = {
|
||||||
'DECR_WRAP',
|
'DECR_WRAP',
|
||||||
'INVERT'
|
'INVERT'
|
||||||
]
|
]
|
||||||
|
return random.item(action)
|
||||||
},
|
},
|
||||||
randomQueryTarget: (isWebGL2) => {
|
randomQueryTarget: (isWebGL2) => {
|
||||||
let target = [
|
let target = [
|
||||||
|
@ -497,7 +498,7 @@ make.webgl = {
|
||||||
'UNIFORM_OFFSET',
|
'UNIFORM_OFFSET',
|
||||||
'UNIFORM_ARRAY_STRIDE',
|
'UNIFORM_ARRAY_STRIDE',
|
||||||
'UNIFORM_MATRIX_STRIDE',
|
'UNIFORM_MATRIX_STRIDE',
|
||||||
'UNIFORM_IS_ROW_MAJOR',
|
'UNIFORM_IS_ROW_MAJOR'
|
||||||
]
|
]
|
||||||
return random.item(pname)
|
return random.item(pname)
|
||||||
},
|
},
|
||||||
|
@ -530,14 +531,14 @@ make.webgl = {
|
||||||
'DYNAMIC_DRAW',
|
'DYNAMIC_DRAW',
|
||||||
'STREAM_DRAW'
|
'STREAM_DRAW'
|
||||||
]
|
]
|
||||||
if (domino.modules.webgl.isWebGL2) {
|
if (isWebGL2) {
|
||||||
usage.extends([
|
usage.extends([
|
||||||
'STATIC_READ',
|
'STATIC_READ',
|
||||||
'DYNAMIC_READ',
|
'DYNAMIC_READ',
|
||||||
'STREAM_READ',
|
'STREAM_READ',
|
||||||
'STATIC_COPY',
|
'STATIC_COPY',
|
||||||
'DYNAMIC_COPY',
|
'DYNAMIC_COPY',
|
||||||
'STREAM_COPY',
|
'STREAM_COPY'
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
return random.item(usage)
|
return random.item(usage)
|
||||||
|
|
Loading…
Reference in a new issue