Skip to content
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

Expose more wgpu::RenderPass draw APIs to RenderCommands #6216

Closed
bonsairobo opened this issue Oct 10, 2022 · 1 comment
Closed

Expose more wgpu::RenderPass draw APIs to RenderCommands #6216

bonsairobo opened this issue Oct 10, 2022 · 1 comment
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible

Comments

@bonsairobo
Copy link
Contributor

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

Users should be able to use the full extent of the wgpu draw APIs. While users have access to the wgpu::RenderPass via the RenderContext provided to Node::run, the RenderCommand API only has access to a TrackedRenderPass, which has a limited subset of draw APIs exposed; in particular, all of the multi_draw... variants are missing.

What solution would you like?

Either add more wrapper methods to TrackedRenderPass or find some other abstraction that makes it feasible to work directly with the wgpu::RenderPass from the RenderCommand trait.

What alternative(s) have you considered?

Implementing my own Node instead of using RenderCommand. This would be a major change.

@bonsairobo bonsairobo added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Oct 10, 2022
@IceSentry IceSentry added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Oct 10, 2022
@MDeiml
Copy link
Contributor

MDeiml commented Oct 15, 2022

TrackedRenderPass is just a wrapper to avoid calls to set_render_pipeline, set_bind_group, set_vertex_buffer and set_index_buffer. It should be possible to just add the multi_draw_... methods in the same way the draw_... methods are implemented.

@bors bors bot closed this as completed in dd7ff88 Oct 28, 2022
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

- Allows bevy users to dispatch `multi_draw_indirect`, `multi_draw_indexed_indirect`,  `multi_draw_indirect_count`, `multi_draw_indexed_indirect_count` draw calls.
- Fixes bevyengine#6216

## Solution

- Added the corresponding wrapper methods to `TrackedRenderPass`

---

## Changelog

> Added  `multi_draw_*` draw calls to `TrackedRenderPass`


Co-authored-by: Zhixing Zhang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants