wgsl-plus
Version:
A WGSL preprocessor, prettifier, minifier, obfuscator, and compiler with C-style macros, conditional compilation, file linking, and multi-format output for WebGPU shaders.
16 lines (15 loc) • 381 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = nextName;
exports.resetNameIndex = resetNameIndex;
let index = 0;
/**
* Generates a simple obfuscated name based on an index.
* @returns An obfuscated name (e.g., "_0").
*/
function nextName() {
return `_${(index++).toString(36)}`;
}
function resetNameIndex() {
index = 0;
}
;