import '../../../../../globals.js';
// Copyright 2024, University of Colorado Boulder
/**
 * Merges two sorted arrays into a single sorted array.
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import { alpenglow, DIRECT_MODULE_DEFAULTS, DirectModule, MAIN_MERGE_DEFAULTS, mainMergeWGSL } from '../../../imports.js';
import { combineOptions } from '../../../../../phet-core/js/optionize.js';
export const MERGE_MODULE_DEFAULTS = {
    // eslint-disable-next-line phet/no-object-spread-on-non-literals
    ...DIRECT_MODULE_DEFAULTS,
    // eslint-disable-next-line phet/no-object-spread-on-non-literals
    ...MAIN_MERGE_DEFAULTS
};
// outputSize: number (sum of inputASize and inputBSize)
export default class MergeModule extends DirectModule {
    constructor(providedOptions) {
        const options = combineOptions({
            main: mainMergeWGSL(providedOptions),
            setDispatchSize: (dispatchSize, outputSize) => {
                dispatchSize.x = Math.ceil(outputSize / providedOptions.blockOutputSize);
            }
        }, providedOptions);
        super(options);
        this.inputA = providedOptions.inputA;
        this.inputB = providedOptions.inputB;
        this.output = providedOptions.output;
    }
}
alpenglow.register('MergeModule', MergeModule);
//# sourceMappingURL=MergeModule.js.map