Skip to content

Conversation

@msvbg
Copy link
Contributor

@msvbg msvbg commented Feb 27, 2024

Objective

bevy_tasks provides utilities for parallel mapping over slices. It can be useful to have a chunk index available in the iteration function to know which part of the original slice is being processed.

Solution

Adds an index argument to the parallel map functions in bevy_tasks.


Changelog

Changed

  • par_chunk_map, par_splat_map, par_chunk_map_mut, and par_splat_map_mut now provide a chunk index during iteration.

Migration Guide

Functions passed as arguments to par_chunk_map, par_splat_map, par_chunk_map_mut, and par_splat_map_mut must now take an additional index argument.

@msvbg msvbg changed the title Add an index argument to iteration using par_chunk_map Add an index argument to parallel iteration helpers in bevy_tasks Feb 27, 2024
@msvbg
Copy link
Contributor Author

msvbg commented Feb 27, 2024

@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Tasks Tools for parallel and async work labels Feb 28, 2024
@james7132 james7132 added this pull request to the merge queue Feb 29, 2024
Merged via the queue into bevyengine:main with commit 21adeb6 Feb 29, 2024
@msvbg msvbg deleted the par-map-indexing branch February 29, 2024 09:15
@msvbg
Copy link
Contributor Author

msvbg commented Feb 29, 2024

@alice-i-cecile Can you add a C-Breaking-Change to this one? (Or give me permission to add it myself)

@rparrett rparrett added the M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Feb 29, 2024
@alice-i-cecile
Copy link
Member

@msvbg invite to the Bevy Org sent, which will give you triage permissions :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Tasks Tools for parallel and async work C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants