Skip to content

Multithreaded render command encoding #9172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 64 commits into from
Feb 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
11af143
Add RenderContext::add_async_command_buffer()
JMS55 Jul 16, 2023
a64583c
WIP
JMS55 Jul 16, 2023
66d2b83
More WIP
JMS55 Jul 16, 2023
8b391d2
Misc
JMS55 Jul 16, 2023
6bbbe41
Complete RenderContext::finish()
JMS55 Jul 16, 2023
a4f2ab6
Misc
JMS55 Jul 16, 2023
d5112d6
More lifetime WIP
JMS55 Jul 16, 2023
f002065
Fix lifetime issues
JMS55 Jul 16, 2023
ad04cd5
Misc lifetime rename
JMS55 Jul 16, 2023
6f2fbfa
Move trace into command gen task
JMS55 Jul 16, 2023
6e04259
Misc formatting
JMS55 Jul 16, 2023
2b447f4
Avoid unnecessary work when no command buffer generation tasks are qu…
JMS55 Jul 16, 2023
0c830b9
Revert rename
JMS55 Jul 16, 2023
ef4a411
Pass RenderDevice as task parameter
JMS55 Jul 16, 2023
5446d28
Use command buffer generation tasks in more nodes
JMS55 Jul 16, 2023
d52bcba
Use arcanized wgpu
JMS55 Jul 16, 2023
585ed5c
Fix bug with wrong color attachment
JMS55 Jul 17, 2023
175d1c8
Merge commit 'c6a1bf063b69a81e9af3de647cdebcefeba8b1d0' into multi-th…
JMS55 Aug 1, 2023
4cb683d
Update wgpu/naga/naga_oil
JMS55 Aug 1, 2023
53dbfd4
Merge remote-tracking branch 'bevy/main' into multi-threaded-command-…
JMS55 Aug 8, 2023
f406770
Merge commit 'ac8f36743e7cb7e6a85e563e3ff52e57ec1676a5' into multi-th…
JMS55 Aug 12, 2023
8004266
Merge commit 'cfa3303cf3c9dab5c285daab4e0e9086525836cc' into multi-th…
JMS55 Aug 16, 2023
533a6b5
Merge commit '8ace2ff9e361dd7ef1bc620b84674def0cb56454' into multi-th…
JMS55 Sep 24, 2023
821b2d6
wip, need to fix raw-window-handle 0.6 stuff
Elabajaba Dec 27, 2023
7770046
works
Elabajaba Jan 8, 2024
65abdb3
fix re-export
Elabajaba Jan 9, 2024
511e96a
bump wgpu
Elabajaba Jan 9, 2024
9b0d8d3
update + fmt
Elabajaba Jan 17, 2024
e3cb986
wgpu 0.19
Elabajaba Jan 18, 2024
83de50b
replace deprecated traits (#2)
mockersf Jan 19, 2024
82b889f
do the wrong thing to make webgpu work for now by making it a mutuall…
Elabajaba Jan 19, 2024
216b147
;
Elabajaba Jan 19, 2024
54f8642
wgpu 0.19.1
Elabajaba Jan 22, 2024
c5471fe
(WIP) have webgpu override webgl feature when targeting wasm
Elabajaba Jan 23, 2024
474ff2e
remove nice warning as it breaks webgpu
Elabajaba Jan 24, 2024
6c3da2c
remove instance_index workaround as it's no longer needed and now bre…
Elabajaba Jan 24, 2024
01a617b
remove unnecessary pub
Elabajaba Jan 24, 2024
3e68449
TextureDataOrder::LayerMajor -> default()
Elabajaba Jan 24, 2024
8d109b6
fix missed deprecated block_size -> block_copy_size
Elabajaba Jan 24, 2024
d2508cd
`webgpu` feature docs
Elabajaba Jan 24, 2024
0508445
fix weird linux timeout check
Elabajaba Jan 24, 2024
d03a634
example readme template fix
Elabajaba Jan 24, 2024
1ccbc90
update features
Elabajaba Jan 24, 2024
817a6f8
move safety comment to satisfy CI
Elabajaba Jan 24, 2024
76c4165
fix raw_handle docs
Elabajaba Jan 24, 2024
cde76a8
satisfy safety gods
Elabajaba Jan 24, 2024
934bb55
Merge remote-tracking branch 'elabajaba/wgpu-019' into multi-threaded…
JMS55 Jan 26, 2024
1447214
Fix
JMS55 Jan 26, 2024
1a1dad4
Merge commit '35ac1b152ee1b2c7b2930f67d93be0db6f395b47' into multi-th…
JMS55 Jan 26, 2024
818a176
WIP
JMS55 Jan 26, 2024
1888180
Misc
JMS55 Jan 26, 2024
601d660
Misc cleanup
JMS55 Jan 26, 2024
38e8151
WIP
JMS55 Jan 27, 2024
c738af2
Merge commit '8f25805b66f533d260a50a3fdcf12e89c8ffb493' into multi-th…
JMS55 Jan 27, 2024
7e837f5
Merge commit 'c227fc9fada2a327d174644a3ce7e5c210aecfb6' into multi-th…
JMS55 Jan 27, 2024
cb7df79
Merge commit '14f1a4f10e35375df512e50e26b3ffd3fe88dcb7' into multi-th…
JMS55 Jan 30, 2024
bdd9950
Merge commit 'e3126a494f4759d52f2492559d3f585a41a4ce29' into multi-th…
JMS55 Feb 1, 2024
b966ee8
HACK: Serial encoding for AMD + Windows + Vulkan
JMS55 Feb 1, 2024
d1c3cdc
Bypass unused
JMS55 Feb 1, 2024
8ed95d5
Fix unused import
JMS55 Feb 1, 2024
b66799f
Remove redundant code
JMS55 Feb 7, 2024
ecb810f
Merge commit 'ab16f5ed6afad717896c278381a0692531eedf44' into multi-th…
JMS55 Feb 7, 2024
14a2822
Merge commit '5313730534684408b6281fb2727144d6890524b0' into multi-th…
JMS55 Feb 9, 2024
7d1f6f7
Add trace to shadow pass
JMS55 Feb 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Misc lifetime rename
  • Loading branch information
JMS55 committed Jul 16, 2023
commit ad04cd50c247f2c1ae76589217ea6eddfd39e076
20 changes: 10 additions & 10 deletions crates/bevy_render/src/renderer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ pub async fn initialize_renderer(
///
/// The [`RenderDevice`] is used to create render resources and the
/// the [`CommandEncoder`] is used to record a series of GPU operations.
pub struct RenderContext<'a> {
pub struct RenderContext<'w> {
render_device: RenderDevice,
command_encoder: Option<CommandEncoder>,
command_buffer_queue: Vec<QueuedCommandBuffer<'a>>,
command_buffer_queue: Vec<QueuedCommandBuffer<'w>>,
}

impl<'a> RenderContext<'a> {
impl<'w> RenderContext<'w> {
/// Creates a new [`RenderContext`] from a [`RenderDevice`].
pub fn new(render_device: RenderDevice) -> Self {
Self {
Expand All @@ -319,10 +319,10 @@ impl<'a> RenderContext<'a> {

/// Creates a new [`TrackedRenderPass`] for the context,
/// configured using the provided `descriptor`.
pub fn begin_tracked_render_pass<'b>(
&'b mut self,
descriptor: RenderPassDescriptor<'b, '_>,
) -> TrackedRenderPass<'b> {
pub fn begin_tracked_render_pass<'a>(
&'a mut self,
descriptor: RenderPassDescriptor<'a, '_>,
) -> TrackedRenderPass<'a> {
// Cannot use command_encoder() as we need to split the borrow on self
let command_encoder = self.command_encoder.get_or_insert_with(|| {
self.render_device
Expand Down Expand Up @@ -352,7 +352,7 @@ impl<'a> RenderContext<'a> {
/// buffer.
pub fn add_command_buffer_generation_task(
&mut self,
task: impl FnOnce() -> CommandBuffer + 'a + Send,
task: impl FnOnce() -> CommandBuffer + 'w + Send,
) {
self.flush_encoders();

Expand Down Expand Up @@ -393,7 +393,7 @@ impl<'a> RenderContext<'a> {
}
}

enum QueuedCommandBuffer<'a> {
enum QueuedCommandBuffer<'w> {
Ready(CommandBuffer),
Task(Box<dyn FnOnce() -> CommandBuffer + 'a + Send>),
Task(Box<dyn FnOnce() -> CommandBuffer + 'w + Send>),
}