import '../../../../../globals.js';
// Copyright 2024, University of Colorado Boulder
/**
 * TODO: doc
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import { alpenglow, DIRECT_MODULE_DEFAULTS, DirectModule, MAIN_TWO_PASS_INITIALIZE_ADDRESSES_DEFAULTS, mainTwoPassInitializeAddressesWGSL } from '../../../imports.js';
import { combineOptions } from '../../../../../phet-core/js/optionize.js';
export const MAIN_TWO_PASS_INITIALIZE_ADDRESSES_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_TWO_PASS_INITIALIZE_ADDRESSES_DEFAULTS
};
// inputSize: number - numBins (!)
export default class MainTwoPassInitializeAddressesModule extends DirectModule {
    constructor(providedOptions) {
        const options = combineOptions({
            main: mainTwoPassInitializeAddressesWGSL(providedOptions),
            setDispatchSize: (dispatchSize, numBins) => {
                // TODO: ensure this doesn't write PAST the end of the buffer(!)
                dispatchSize.x = Math.ceil((numBins + 2) / 256);
            }
        }, providedOptions);
        super(options);
        this.addresses = options.addresses;
    }
}
alpenglow.register('MainTwoPassInitializeAddressesModule', MainTwoPassInitializeAddressesModule);
//# sourceMappingURL=MainTwoPassInitializeAddressesModule.js.map