How to pass texture parameter to tslFn with setLayout

This is my example:

const test = tslFn(([texNode, uv]) => {
       .... some logic
       
       return texNode.uv(transformedUV);
})
.setLayout({
    name: 'test',
    type: 'vec4',
    inputs: [
		{ name: 'texNode', type: '????' },
		{ name: 'uv', type: 'vec2' },
    ]
});
const texNode = texture(anyTexture);
this.colorNode = test(texNode, uv);

What type of input should I decalre in setLayout? I haven’t found an example in the source code of three.js.

@sunag I’m still trying to find it out. Can you help me :pray:?

Hi, try not to use setLayout(), it is not compatible with texture with parameter yet. This should work without setLayout().

Okay, thanks. I’ve tried not to use it a lot, but that cases many troubles when we migrate our app from old version to webgpu. we use setLayout to make some code to a reuseable function, and the texture parameter always be a uniform when it is called. Will we support it in the future?

We will definitely support this soon.

Thanks! It’s very helpful to me.