import '../../../../globals.js';
// Copyright 2023-2024, University of Colorado Boulder
/**
 * TODO: doc
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import { alpenglow, webgpu } from '../../imports.js';
export default class BindGroup {
    constructor(deviceContext, name, layout, resourceMap) {
        this.deviceContext = deviceContext;
        this.name = name;
        this.layout = layout;
        const entries = layout.bindings.map(binding => {
            const resource = resourceMap.get(binding.slot);
            return resource.getBindGroupEntry(binding);
        });
        this.bindGroup = webgpu.deviceCreateBindGroup(deviceContext.device, {
            label: `${this.name} bind group`,
            layout: layout.layout,
            entries: entries
        });
    }
}
alpenglow.register('BindGroup', BindGroup);
//# sourceMappingURL=BindGroup.js.map