Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bevy_render: Do not automatically enable MAPPABLE_PRIMARY_BUFFERS (#3698
) # Objective - When using `WgpuOptionsPriority::Functionality`, which is the default, wgpu::Features::MAPPABLE_PRIMARY_BUFFERS would be automatically enabled. This feature can and does have a significant negative impact on performance for discrete GPUs where resizable bar is not supported, which is a common case. As such, this feature should not be automatically enabled. - Fixes the performance regression part of #3686 and at least some, if not all cases of #3687 ## Solution - When using `WgpuOptionsPriority::Functionality`, use the adapter-supported features, enable `TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES` and disable `MAPPABLE_PRIMARY_BUFFERS`
- Loading branch information
ef823d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that there is also another occurrence of TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES here:
bevy/crates/bevy_render/src/options.rs
Line 52 in 435fb7a
Does this also need to be changed?
ef823d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so.
TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES
doesn't includeMAPPABLE_PRIMARY_BUFFERS
, so disablingMAPPABLE_PRIMARY_BUFFERS
doesn't have any effect.ef823d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I got confused testing a version without this commit and mistakenly assumed the line was meaningful.