import '../../../../../globals.js';
import { combineOptions } from '../../../../../phet-core/js/optionize.js';
import { alpenglow, DIRECT_MODULE_DEFAULTS, DirectModule, MAIN_REDUCE_DEFAULTS, mainReduceWGSL } from '../../../imports.js';
export const MAIN_REDUCE_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_REDUCE_DEFAULTS
};
// inputSize: number
export default class MainReduceModule extends DirectModule {
    constructor(providedOptions) {
        const options = combineOptions({
            main: mainReduceWGSL(providedOptions),
            setDispatchSize: (dispatchSize, inputSize) => {
                dispatchSize.x = Math.ceil(inputSize / (providedOptions.workgroupSize * providedOptions.grainSize));
            }
        }, providedOptions);
        super(options);
        this.input = options.input;
        this.output = options.output;
    }
}
alpenglow.register('MainReduceModule', MainReduceModule);
//# sourceMappingURL=MainReduceModule.js.map