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

[Merged by Bors] - bevy_render: Use RenderDevice to get limits/features and expose AdapterInfo #3931

Closed
wants to merge 8 commits into from

Conversation

superdump
Copy link
Contributor

@superdump superdump commented Feb 13, 2022

Objective

  • WgpuOptions is mutated to be updated with the actual device limits and features, but this information is readily available to both the main and render worlds through the RenderDevice which has .limits() and .features() methods
  • Information about the adapter in terms of its name, the backend in use, etc were not being exposed but have clear use cases for being used to take decisions about what rendering code to use. For example, if something works well on AMD GPUs but poorly on Intel GPUs. Or perhaps something works well in Vulkan but poorly in DX12.

Solution

  • Stop mutating WgpuOptions and don't insert the updated values into the main and render worlds
  • Return AdapterInfo from initialize_renderer and insert it into the main and render worlds
  • Use RenderDevice limits in the lighting code that was using WgpuOptions.limits.
  • Renamed WgpuOptions to WgpuSettings

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Feb 13, 2022
@superdump superdump added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Feb 13, 2022
@Weasy666
Copy link
Contributor

Weasy666 commented Feb 13, 2022

Have you seen #3832 ? 😅

Ah...should have read more carefully, i think the two PRs have a different objective.

@superdump
Copy link
Contributor Author

Also renamed WgpuOptions and related to WgpuSettings as suggested by @cart here: #3832 (comment)

@superdump superdump requested a review from cart February 14, 2022 07:12
Copy link
Contributor

@Weasy666 Weasy666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but could you add module level docs, like mentioned by @alice-i-cecile #3832 (comment) ? To make people aware that AdapterInfo is available as a resource?

@superdump
Copy link
Contributor Author

LGTM, but could you add module level docs, like mentioned by @alice-i-cecile #3832 (comment) ? To make people aware that AdapterInfo is available as a resource?

Done, with links.

@cart
Copy link
Member

cart commented Feb 16, 2022

bors r+

bors bot pushed a commit that referenced this pull request Feb 16, 2022
…erInfo (#3931)

# Objective

- `WgpuOptions` is mutated to be updated with the actual device limits and features, but this information is readily available to both the main and render worlds through the `RenderDevice` which has .limits() and .features() methods
- Information about the adapter in terms of its name, the backend in use, etc were not being exposed but have clear use cases for being used to take decisions about what rendering code to use. For example, if something works well on AMD GPUs but poorly on Intel GPUs. Or perhaps something works well in Vulkan but poorly in DX12.

## Solution

- Stop mutating `WgpuOptions `and don't insert the updated values into the main and render worlds
- Return `AdapterInfo` from `initialize_renderer` and insert it into the main and render worlds
- Use `RenderDevice` limits in the lighting code that was using `WgpuOptions.limits`.
- Renamed `WgpuOptions` to `WgpuSettings`
@bors bors bot changed the title bevy_render: Use RenderDevice to get limits/features and expose AdapterInfo [Merged by Bors] - bevy_render: Use RenderDevice to get limits/features and expose AdapterInfo Feb 16, 2022
@bors bors bot closed this Feb 16, 2022
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
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants