[Pas2js] Possible WebGL demo?

Stephen Wright stephenmichaelwright at yahoo.co.uk
Thu May 3 18:06:45 CEST 2018


Hi Michael
I have been using a great single page Javascript utility (gpu.js)  to allow accelerated computation using WebGL without needing to know anything about WebGL. It is released under an MIT licence and is a really good entry level introduction to parallel computing.
If you substituted the WebGL calls for the PAS version of these calls and left the rest as an ASM block this would be a good test for the Pas2JS webGL calls because we could do a back to back test with the original version? and could be a starting point for then having a Pascal version of this utility ?? 
If we used reverse engineering we could have a Pas Version (while still keeping it in line with the JavaScript version from time to time?) and credit the original authors as well. Perhaps WarleyAlex might have some ideas on how practical this reverse engineering is?
If others think this is a good idea and that it will be OK with the original authors then I will be happy to do some work on this.
Steve
More detail is available at  gpu.js - GPU Accelerated JavaScript

| 
| 
| 
|  |  |

 |

 |
| 
|  | 
gpu.js - GPU Accelerated JavaScript

gpu.js is a single-file JavaScript library for GPGPU in the browser. gpu.js will automatically compile specially...
 |

 |

 |



gpu.js is a JavaScript Acceleration library for GPGPU (General purpose computing on GPUs) in Javascript. gpu.js will automatically compile simple JavaScript functions into shader language and run them on the GPU. In case a GPU is not available, the functions will still run in regular JavaScript.

gpu.js relies on the assumption that the kernel function is using only a subset of legal JavaScript syntax:
   
   - 1D, 2D, 3D array of numbers or just numbers as kernel input
   - 1D, 2D, 3D array of numbers as kernel output
   - Number variables
   - Custom and custom native functions
   - Arithmetic operations (+, +=, -, *, /, %)
   - Javascript Math functions (Math.floor() and etc.)
   - Loops
   - if and else statements
   - const and let
   - No variables captured by a closure




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20180503/6b4ee311/attachment.html>


More information about the Pas2js mailing list