UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

2 lines (1 loc) 985 B
export const computeGsplatLocalTileSortSource: "\n\n#include \"gsplatLocalBitonicCS\"\n\n@group(0) @binding(0) var<storage, read_write> tileEntries: array<u32>;\n@group(0) @binding(1) var<storage, read> tileSplatCounts: array<u32>;\n@group(0) @binding(2) var<storage, read> depthBuffer: array<u32>;\n@group(0) @binding(3) var<storage, read> smallTileList: array<u32>;\n@group(0) @binding(4) var<storage, read> tileListCounts: array<u32>;\n\n@compute @workgroup_size(256)\nfn main(\n @builtin(local_invocation_index) localIdx: u32,\n @builtin(workgroup_id) wid: vec3u,\n @builtin(num_workgroups) numWorkgroups: vec3u\n) {\n let workgroupIdx = wid.y * numWorkgroups.x + wid.x;\n if (workgroupIdx >= tileListCounts[0]) {\n return;\n }\n let tileIdx = smallTileList[workgroupIdx];\n let tStart = tileSplatCounts[tileIdx];\n let tEnd = tileSplatCounts[tileIdx + 1u];\n let count = tEnd - tStart;\n\n bitonicSortRange(localIdx, tStart, count);\n}\n";