import '../../../../globals.js';
// Copyright 2023-2024, University of Colorado Boulder
/**
 * TODO: doc
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import { optionize3 } from '../../../../phet-core/js/optionize.js';
import { alpenglow, Module, PIPELINE_BLUEPRINT_DEFAULTS, PipelineBlueprint } from '../../imports.js';
export const INDIRECT_MODULE_DEFAULTS = {
    // eslint-disable-next-line phet/no-object-spread-on-non-literals
    ...PIPELINE_BLUEPRINT_DEFAULTS
};
export default class IndirectModule extends Module {
    constructor(providedOptions) {
        const options = optionize3()({}, INDIRECT_MODULE_DEFAULTS, providedOptions);
        const pipelineBlueprint = new PipelineBlueprint(options);
        options.create(pipelineBlueprint);
        const dispatch = (context, indirectBuffer, indirectOffset = 0) => {
            context.dispatchIndirect(pipelineBlueprint, indirectBuffer, indirectOffset);
        };
        super([pipelineBlueprint], (context, data) => {
            options.execute(context, dispatch, data);
        });
    }
}
alpenglow.register('IndirectModule', IndirectModule);
//# sourceMappingURL=IndirectModule.js.map