(outputShape: number[])
| 28 | enableShapeUniforms: boolean; |
| 29 | |
| 30 | constructor(outputShape: number[]) { |
| 31 | this.outputShape = outputShape; |
| 32 | this.enableShapeUniforms = useShapeUniforms(this.outputShape.length); |
| 33 | const rank = outputShape.length; |
| 34 | |
| 35 | const channels = getChannels('rc', rank); |
| 36 | const dtype = getCoordsDataType(rank); |
| 37 | const sourceCoords = getSourceCoords(rank, channels); |
| 38 | const innerDims = channels.slice(-2); |
| 39 | const coords = rank <= 1 ? 'rc' : `vec2(${innerDims.join(',')})`; |
| 40 | |
| 41 | this.userCode = ` |
| 42 | void main() { |
| 43 | ${dtype} rc = getOutputCoords(); |
| 44 | vec4 packedInput = getA(${sourceCoords}); |
| 45 | |
| 46 | setOutput(getChannel(packedInput, ${coords})); |
| 47 | } |
| 48 | `; |
| 49 | } |
| 50 | } |
nothing calls this directly
no test coverage detected