playcanvas
Version:
Open-source WebGL/WebGPU 3D engine for the web
28 lines (27 loc) • 953 B
JavaScript
const computeGsplatLocalTileSortSource = `
#include "gsplatLocalBitonicCS"
var<storage, read_write> tileEntries: array<u32>;
var<storage, read> tileSplatCounts: array<u32>;
var<storage, read> depthBuffer: array<u32>;
var<storage, read> smallTileList: array<u32>;
var<storage, read> tileListCounts: array<u32>;
fn main(
localIdx: u32,
wid: vec3u,
numWorkgroups: vec3u
) {
let workgroupIdx = wid.y * numWorkgroups.x + wid.x;
if (workgroupIdx >= tileListCounts[0]) {
return;
}
let tileIdx = smallTileList[workgroupIdx];
let tStart = tileSplatCounts[tileIdx];
let tEnd = tileSplatCounts[tileIdx + 1u];
let count = tEnd - tStart;
bitonicSortRange(localIdx, tStart, count);
}
`;
export {
computeGsplatLocalTileSortSource
};