bevyengine / bevyengine/bevy

Label the command encoder of the `RenderContext`

Open
#16,003 3 comments 0 reactions 0 assignees View on GitHub
A-Diagnostics A-Rendering C-Feature C-Usability D-Modest S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

The command encoder of `RenderContext` doesn't have any debug label. This makes debugging on Metal quite painful because the top-level items are command encoder in the debug view, and the various other labelled items (_e.g._ compute or render pass) are collapsed children. At a glance you end up with a list of 10+ unlabelled command encoder, and you have to figure out which are from Bevy, which from wgpu itself, and which others (_e.g._ from Hanabi).

## What solution would you like?

It's slightly annoying because `RenderContext::command_encoder()` lazily creates the command encoder so it's not clear when exactly it's created and by who (probably by Bevy itself). But at least if it had a standard Bevy-related name, that would help a bit.

## What alternative(s) have you considered?

There's no way to label it after creation I believe.

It looks like Bevy is naming its internal encoders, by creating them explicitly from within `ViewNode::run()` instead of calling `RenderContext::command_encoder()`, so despite the fact that the `RenderContext` has already a command encoder which, from the look of the API, feels like it's the one you should be using. It's unclear why Bevy doesn't use the existing command encoder, and I don't think it's documented. If that's the way to go, I can use that in Hanabi too, but it would be nice to explain it somewhere.

![Image](https://github.com/user-attachments/assets/95c5e043-2b24-4572-9353-59528e28e758)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.