Add constants for WebGL

This commit is contained in:
Christoph Diehl 2018-02-21 10:21:03 +01:00
parent 08a4fb1b60
commit c85d69abe2
No known key found for this signature in database
GPG key ID: 799CE5B68FEF404A

View file

@ -67,7 +67,7 @@ make.webgl = {
'ARRAY_BUFFER',
'ELEMENT_ARRAY_BUFFER'
]
if (domino.modules.webgl.isWebGL2) {
if (isWebGL2) {
target.extends([
'COPY_READ_BUFFER',
'COPY_WRITE_BUFFER',
@ -100,7 +100,7 @@ make.webgl = {
return random.item(pname)
},
randomTexParameterValue: (isWebGL2) => {
let pname_param = {
let pnameparam = {
'TEXTURE_MAG_FILTER': [
'LINEAR',
'NEAREST'
@ -122,11 +122,11 @@ make.webgl = {
'REPEAT',
'CLAMP_TO_EDGE',
'MIRRORED_REPEAT'
],
]
}
if (isWebGL2) {
pname_param = Object.assign(
pname_param,
pnameparam = Object.assign(
pnameparam,
{
'TEXTURE_BASE_LEVEL': [
make.number.any()
@ -162,15 +162,15 @@ make.webgl = {
}
)
}
pname = random.item(Object.keys(pname_param))
param = random.item(pname_param[pname])
let pname = random.item(Object.keys(pnameparam))
let param = random.item(pnameparam[pname])
return [pname, param]
},
randomBlendMode: (isWebGL2) => {
let mode = [
'FUNC_ADD',
'FUNC_SUBTRACT',
'FUNC_REVERSE_SUBTRACT',
'FUNC_REVERSE_SUBTRACT'
]
if (isWebGL2) {
mode.extends([
@ -198,7 +198,7 @@ make.webgl = {
'ONE_MINUS_CONSTANT_ALPHA',
'SRC_ALPHA_SATURATE'
]
return ranodm.item(factor)
return random.item(factor)
},
randomFace: (isWebGL2) => {
let mode = [
@ -282,7 +282,7 @@ make.webgl = {
'COLOR_ATTACHMENT0',
'DEPTH_ATTACHMENT',
'STENCIL_ATTACHMENT',
'DEPTH_STENCIL_ATTACHMENT',
'DEPTH_STENCIL_ATTACHMENT'
]
if (isWebGL2) {
attachment.extends([
@ -405,7 +405,7 @@ make.webgl = {
}
)
}
name = random.item(Object.keys(pname))
let name = random.item(Object.keys(pname))
return [name, pname[name]]
},
randomStencilAction: (isWebGL2) => {
@ -419,6 +419,7 @@ make.webgl = {
'DECR_WRAP',
'INVERT'
]
return random.item(action)
},
randomQueryTarget: (isWebGL2) => {
let target = [
@ -497,7 +498,7 @@ make.webgl = {
'UNIFORM_OFFSET',
'UNIFORM_ARRAY_STRIDE',
'UNIFORM_MATRIX_STRIDE',
'UNIFORM_IS_ROW_MAJOR',
'UNIFORM_IS_ROW_MAJOR'
]
return random.item(pname)
},
@ -530,14 +531,14 @@ make.webgl = {
'DYNAMIC_DRAW',
'STREAM_DRAW'
]
if (domino.modules.webgl.isWebGL2) {
if (isWebGL2) {
usage.extends([
'STATIC_READ',
'DYNAMIC_READ',
'STREAM_READ',
'STATIC_COPY',
'DYNAMIC_COPY',
'STREAM_COPY',
'STREAM_COPY'
])
}
return random.item(usage)