ERROR Error: Error compiling fragment shader: ERROR: 0:145: 'pow' : no matching overloaded function found
Do I understand correctly that in 2.x you're writing matching functions from scratch?
No, that is incorrect. What is likely happening is that a type isn't being correctly detected and casted. We use standard functions where possible, and only use non-standard when absolutely needed.
Can you share a snippet of what you have that reproduces this?
Sure. The gpu.js files are downloaded from bin folder and renamed for the purpose of easily switching versions. When you uncomment 1.10.2, the script works. in 2.x it doesn't.
<!doctype html>
<html lang="en">
<head>
<script src="gpu-browser-2.0.0-rc2.js"></script>
<!-- <script src="gpu-browser-2.0.0-rc3.js"></script> -->
<!-- <script src="gpu-1.10.2.js"></script> -->
<script>
function task () {
let result = 0;
for (let t = 10; t > 0; t--) {
for (let i = 5000000; i > 0; i--) {
result += Math.pow(i, -i);
}
}
return result;
};
const gpu = new GPU({ mode: 'gpu' });
const kernel = gpu.createKernel(task, {
output: [1]
});
const result = kernel();
alert(result[0]);
</script>
</head>
<body></body>
</html>
I know what this issue is here, and will be adding a fix in the next day or two.
thank you:)
I believe this has been resolved in v2.0.0 rc 4 and I as well added unit tests to prevent this from popping up in the future. Ty for bringing this to my attention!
Let me know if that doesn't work for you, and as well if this or anything resembling it come up in the future.