(rank: number, uniformPrefix = '')
| 57 | } |
| 58 | |
| 59 | function getSourceCoords(rank: number, uniformPrefix = ''): string { |
| 60 | if (rank >= 5) { |
| 61 | throw Error(`Tile for rank ${rank} is not yet supported`); |
| 62 | } |
| 63 | if (rank === 1) { |
| 64 | return `(resRC % ${uniformPrefix}aShape)`; |
| 65 | } |
| 66 | |
| 67 | const currentCoords = ['resRC.x', 'resRC.y', 'resRC.z', 'resRC.w']; |
| 68 | const sourceCoords = []; |
| 69 | for (let i = 0; i < rank; i++) { |
| 70 | sourceCoords.push(`(${currentCoords[i]} % ${uniformPrefix}aShape[${i}])`); |
| 71 | } |
| 72 | return sourceCoords.join(); |
| 73 | } |
no test coverage detected
searching dependent graphs…