Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/gpujs/gpu.js into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
robertleeplummerjr committed Jan 19, 2021
2 parents 3be597d + c2b7536 commit b2a4aa8
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 63 deletions.
40 changes: 20 additions & 20 deletions dist/gpu-browser-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -11168,7 +11168,7 @@ float integerCorrectionModulo(float number, float divisor) {
result.push(
' threadId = indexTo3D(index, uOutputDim)',
' kernel()',
` gl_FragData[0].${channel} = kernelResult`,
` gl_FragData[0].${channel} = kernelResult`
);
}

Expand All @@ -11178,11 +11178,11 @@ float integerCorrectionModulo(float number, float divisor) {
const subKernel = this.subKernels[i];
if (subKernel.returnType === 'Integer') {
result.push(
` gl_FragData[${i + 1}].${channel} = float(subKernelResult_${this.subKernels[i].name})`,
` gl_FragData[${i + 1}].${channel} = float(subKernelResult_${this.subKernels[i].name})`
);
} else {
result.push(
` gl_FragData[${i + 1}].${channel} = subKernelResult_${this.subKernels[i].name}`,
` gl_FragData[${i + 1}].${channel} = subKernelResult_${this.subKernels[i].name}`
);
}
}
Expand All @@ -11203,11 +11203,11 @@ float integerCorrectionModulo(float number, float divisor) {
const subKernel = this.subKernels[i];
if (subKernel.returnType === 'Integer') {
result.push(
` gl_FragData[${i + 1}][0] = float(subKernelResult_${subKernel.name})`,
` gl_FragData[${i + 1}][0] = float(subKernelResult_${subKernel.name})`
);
} else {
result.push(
` gl_FragData[${i + 1}][0] = subKernelResult_${subKernel.name}`,
` gl_FragData[${i + 1}][0] = subKernelResult_${subKernel.name}`
);
}
}
Expand All @@ -11229,7 +11229,7 @@ float integerCorrectionModulo(float number, float divisor) {
for (let i = 0; i < this.subKernels.length; ++i) {
result.push(
` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`
);
}
return result;
Expand All @@ -11252,7 +11252,7 @@ float integerCorrectionModulo(float number, float divisor) {
result.push(
` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`,
` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`,
` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`
);
}
return result;
Expand All @@ -11277,11 +11277,11 @@ float integerCorrectionModulo(float number, float divisor) {
const subKernel = this.subKernels[i];
if (subKernel.returnType === 'Integer') {
result.push(
` gl_FragData[${i + 1}] = float(subKernelResult_${this.subKernels[i].name})`,
` gl_FragData[${i + 1}] = float(subKernelResult_${this.subKernels[i].name})`
);
} else {
result.push(
` gl_FragData[${i + 1}] = subKernelResult_${this.subKernels[i].name}`,
` gl_FragData[${i + 1}] = subKernelResult_${this.subKernels[i].name}`
);
}
}
Expand All @@ -11290,7 +11290,7 @@ float integerCorrectionModulo(float number, float divisor) {
for (let i = 0; i < this.subKernels.length; ++i) {
result.push(
` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`
);
}
break;
Expand All @@ -11299,7 +11299,7 @@ float integerCorrectionModulo(float number, float divisor) {
result.push(
` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`,
` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`,
` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`
);
}
break;
Expand All @@ -11309,7 +11309,7 @@ float integerCorrectionModulo(float number, float divisor) {
` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`,
` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`,
` gl_FragData[${i + 1}][3] = subKernelResult_${this.subKernels[i].name}[3]`,
` gl_FragData[${i + 1}][3] = subKernelResult_${this.subKernels[i].name}[3]`
);
}
break;
Expand Down Expand Up @@ -13222,7 +13222,7 @@ class WebGL2Kernel extends WebGLKernel {
result.push(
' threadId = indexTo3D(index, uOutputDim)',
' kernel()',
` data0.${channel} = kernelResult`,
` data0.${channel} = kernelResult`
);
}

Expand All @@ -13232,11 +13232,11 @@ class WebGL2Kernel extends WebGLKernel {
const subKernel = this.subKernels[i];
if (subKernel.returnType === 'Integer') {
result.push(
` data${i + 1}.${channel} = float(subKernelResult_${subKernel.name})`,
` data${i + 1}.${channel} = float(subKernelResult_${subKernel.name})`
);
} else {
result.push(
` data${i + 1}.${channel} = subKernelResult_${subKernel.name}`,
` data${i + 1}.${channel} = subKernelResult_${subKernel.name}`
);
}
}
Expand All @@ -13257,11 +13257,11 @@ class WebGL2Kernel extends WebGLKernel {
const subKernel = this.subKernels[i];
if (subKernel.returnType === 'Integer') {
result.push(
` data${i + 1}[0] = float(subKernelResult_${subKernel.name})`,
` data${i + 1}[0] = float(subKernelResult_${subKernel.name})`
);
} else {
result.push(
` data${i + 1}[0] = subKernelResult_${subKernel.name}`,
` data${i + 1}[0] = subKernelResult_${subKernel.name}`
);
}
}
Expand All @@ -13284,7 +13284,7 @@ class WebGL2Kernel extends WebGLKernel {
const subKernel = this.subKernels[i];
result.push(
` data${i + 1}[0] = subKernelResult_${subKernel.name}[0]`,
` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]`,
` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]`
);
}
return result;
Expand All @@ -13308,7 +13308,7 @@ class WebGL2Kernel extends WebGLKernel {
result.push(
` data${i + 1}[0] = subKernelResult_${subKernel.name}[0]`,
` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]`,
` data${i + 1}[2] = subKernelResult_${subKernel.name}[2]`,
` data${i + 1}[2] = subKernelResult_${subKernel.name}[2]`
);
}
return result;
Expand All @@ -13327,7 +13327,7 @@ class WebGL2Kernel extends WebGLKernel {
if (!this.subKernels) return result;
for (let i = 0; i < this.subKernels.length; ++i) {
result.push(
` data${i + 1} = subKernelResult_${this.subKernels[i].name}`,
` data${i + 1} = subKernelResult_${this.subKernels[i].name}`
);
}
return result;
Expand Down
40 changes: 20 additions & 20 deletions dist/gpu-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -15621,7 +15621,7 @@ float integerCorrectionModulo(float number, float divisor) {
result.push(
' threadId = indexTo3D(index, uOutputDim)',
' kernel()',
` gl_FragData[0].${channel} = kernelResult`,
` gl_FragData[0].${channel} = kernelResult`
);
}

Expand All @@ -15631,11 +15631,11 @@ float integerCorrectionModulo(float number, float divisor) {
const subKernel = this.subKernels[i];
if (subKernel.returnType === 'Integer') {
result.push(
` gl_FragData[${i + 1}].${channel} = float(subKernelResult_${this.subKernels[i].name})`,
` gl_FragData[${i + 1}].${channel} = float(subKernelResult_${this.subKernels[i].name})`
);
} else {
result.push(
` gl_FragData[${i + 1}].${channel} = subKernelResult_${this.subKernels[i].name}`,
` gl_FragData[${i + 1}].${channel} = subKernelResult_${this.subKernels[i].name}`
);
}
}
Expand All @@ -15656,11 +15656,11 @@ float integerCorrectionModulo(float number, float divisor) {
const subKernel = this.subKernels[i];
if (subKernel.returnType === 'Integer') {
result.push(
` gl_FragData[${i + 1}][0] = float(subKernelResult_${subKernel.name})`,
` gl_FragData[${i + 1}][0] = float(subKernelResult_${subKernel.name})`
);
} else {
result.push(
` gl_FragData[${i + 1}][0] = subKernelResult_${subKernel.name}`,
` gl_FragData[${i + 1}][0] = subKernelResult_${subKernel.name}`
);
}
}
Expand All @@ -15682,7 +15682,7 @@ float integerCorrectionModulo(float number, float divisor) {
for (let i = 0; i < this.subKernels.length; ++i) {
result.push(
` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`
);
}
return result;
Expand All @@ -15705,7 +15705,7 @@ float integerCorrectionModulo(float number, float divisor) {
result.push(
` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`,
` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`,
` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`
);
}
return result;
Expand All @@ -15730,11 +15730,11 @@ float integerCorrectionModulo(float number, float divisor) {
const subKernel = this.subKernels[i];
if (subKernel.returnType === 'Integer') {
result.push(
` gl_FragData[${i + 1}] = float(subKernelResult_${this.subKernels[i].name})`,
` gl_FragData[${i + 1}] = float(subKernelResult_${this.subKernels[i].name})`
);
} else {
result.push(
` gl_FragData[${i + 1}] = subKernelResult_${this.subKernels[i].name}`,
` gl_FragData[${i + 1}] = subKernelResult_${this.subKernels[i].name}`
);
}
}
Expand All @@ -15743,7 +15743,7 @@ float integerCorrectionModulo(float number, float divisor) {
for (let i = 0; i < this.subKernels.length; ++i) {
result.push(
` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`
);
}
break;
Expand All @@ -15752,7 +15752,7 @@ float integerCorrectionModulo(float number, float divisor) {
result.push(
` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`,
` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`,
` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`
);
}
break;
Expand All @@ -15762,7 +15762,7 @@ float integerCorrectionModulo(float number, float divisor) {
` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`,
` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`,
` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`,
` gl_FragData[${i + 1}][3] = subKernelResult_${this.subKernels[i].name}[3]`,
` gl_FragData[${i + 1}][3] = subKernelResult_${this.subKernels[i].name}[3]`
);
}
break;
Expand Down Expand Up @@ -17675,7 +17675,7 @@ class WebGL2Kernel extends WebGLKernel {
result.push(
' threadId = indexTo3D(index, uOutputDim)',
' kernel()',
` data0.${channel} = kernelResult`,
` data0.${channel} = kernelResult`
);
}

Expand All @@ -17685,11 +17685,11 @@ class WebGL2Kernel extends WebGLKernel {
const subKernel = this.subKernels[i];
if (subKernel.returnType === 'Integer') {
result.push(
` data${i + 1}.${channel} = float(subKernelResult_${subKernel.name})`,
` data${i + 1}.${channel} = float(subKernelResult_${subKernel.name})`
);
} else {
result.push(
` data${i + 1}.${channel} = subKernelResult_${subKernel.name}`,
` data${i + 1}.${channel} = subKernelResult_${subKernel.name}`
);
}
}
Expand All @@ -17710,11 +17710,11 @@ class WebGL2Kernel extends WebGLKernel {
const subKernel = this.subKernels[i];
if (subKernel.returnType === 'Integer') {
result.push(
` data${i + 1}[0] = float(subKernelResult_${subKernel.name})`,
` data${i + 1}[0] = float(subKernelResult_${subKernel.name})`
);
} else {
result.push(
` data${i + 1}[0] = subKernelResult_${subKernel.name}`,
` data${i + 1}[0] = subKernelResult_${subKernel.name}`
);
}
}
Expand All @@ -17737,7 +17737,7 @@ class WebGL2Kernel extends WebGLKernel {
const subKernel = this.subKernels[i];
result.push(
` data${i + 1}[0] = subKernelResult_${subKernel.name}[0]`,
` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]`,
` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]`
);
}
return result;
Expand All @@ -17761,7 +17761,7 @@ class WebGL2Kernel extends WebGLKernel {
result.push(
` data${i + 1}[0] = subKernelResult_${subKernel.name}[0]`,
` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]`,
` data${i + 1}[2] = subKernelResult_${subKernel.name}[2]`,
` data${i + 1}[2] = subKernelResult_${subKernel.name}[2]`
);
}
return result;
Expand All @@ -17780,7 +17780,7 @@ class WebGL2Kernel extends WebGLKernel {
if (!this.subKernels) return result;
for (let i = 0; i < this.subKernels.length; ++i) {
result.push(
` data${i + 1} = subKernelResult_${this.subKernels[i].name}`,
` data${i + 1} = subKernelResult_${this.subKernels[i].name}`
);
}
return result;
Expand Down
6 changes: 3 additions & 3 deletions src/backend/cpu/kernel-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ function cpuKernelString(cpuKernel, name) {
' const { context, canvas, constants: incomingConstants } = settings;',
` const output = new Int32Array(${JSON.stringify(Array.from(cpuKernel.output))});`,
` const _constantTypes = ${JSON.stringify(cpuKernel.constantTypes)};`,
` const _constants = ${constantsToString(cpuKernel.constants, cpuKernel.constantTypes)};`,
` const _constants = ${constantsToString(cpuKernel.constants, cpuKernel.constantTypes)};`
);

thisProperties.push(
' constants: _constants,',
' context,',
' output,',
' thread: {x: 0, y: 0, z: 0},',
' thread: {x: 0, y: 0, z: 0},'
);

if (cpuKernel.graphical) {
Expand Down Expand Up @@ -92,7 +92,7 @@ function cpuKernelString(cpuKernel, name) {
thisProperties.push(
' _imageData,',
' _colorData,',
` color: ${colorFn},`,
` color: ${colorFn},`
);

beforeReturn.push(
Expand Down
Loading

0 comments on commit b2a4aa8

Please sign in to comment.