UNPKG

pixi.js

Version:

PixiJS — The HTML5 Creation Engine =============

44 lines (41 loc) 1.13 kB
import { ShaderStage } from '../../../shared/shader/const.mjs'; "use strict"; function generateGpuLayoutGroups({ groups }) { const layout = []; for (let i = 0; i < groups.length; i++) { const group = groups[i]; if (!layout[group.group]) { layout[group.group] = []; } if (group.isUniform) { layout[group.group].push({ binding: group.binding, visibility: ShaderStage.VERTEX | ShaderStage.FRAGMENT, buffer: { type: "uniform" } }); } else if (group.type === "sampler") { layout[group.group].push({ binding: group.binding, visibility: ShaderStage.FRAGMENT, sampler: { type: "filtering" } }); } else if (group.type === "texture_2d") { layout[group.group].push({ binding: group.binding, visibility: ShaderStage.FRAGMENT, texture: { sampleType: "float", viewDimension: "2d", multisampled: false } }); } } return layout; } export { generateGpuLayoutGroups }; //# sourceMappingURL=generateGpuLayoutGroups.mjs.map