Skip to content

Could not call same function from different places #207

Description

@Renha

Weird behavior, try to execute this:

function demo3( assert, mode ) {
	var gpu = new GPU({ mode: mode });
	
	var f = gpu.createKernel(function(a, b) {
		function custom_adder(a,b) {
			return a+b;
		}
		function some_fun_1(a,b) {
			return custom_adder(a,b);
		}
		function some_fun_2(a,b) {
			return custom_adder(a,b);
		}
		return some_fun_1(1,2)+some_fun_2(a[this.thread.x], b[this.thread.x]);
	}, {
		dimensions : [6]
	}).setDebug(true).setOutput([6]);
	
	var a = [1, 2, 3, 5, 6, 7];
	var b = [4, 5, 6, 1, 2, 3];
	
	var res = f(a,b);
	return res;
}
console.log(demo3() );

there is error

An error occurred compiling the shaders: ERROR: 0:129: 'custom_adder' : no matching overloaded function found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions