@@ -121,6 +121,27 @@ pub struct WindowSurfaces {
121
121
configured_windows : HashSet < WindowId > ,
122
122
}
123
123
124
+ /// Creates and (re)configures window surfaces, and obtains a swapchain texture for rendering.
125
+ ///
126
+ /// NOTE: `get_current_texture` in `prepare_windows` can take a long time if the GPU workload is
127
+ /// the performance bottleneck. This can be seen in profiles as multiple prepare-stage systems all
128
+ /// taking an unusually long time to complete, and all finishing at about the same time as the
129
+ /// `prepare_windows` system. Improvements in bevy are planned to avoid this happening when it
130
+ /// should not but it will still happen as it is easy for a user to create a large GPU workload
131
+ /// relative to the GPU performance and/or CPU workload.
132
+ /// This can be caused by many reasons, but several of them are:
133
+ /// - GPU workload is more than your current GPU can manage
134
+ /// - Error / performance bug in your custom shaders
135
+ /// - wgpu was unable to detect a proper GPU hardware-accelerated device given the chosen
136
+ /// [`Backends`](crate::settings::Backends), [`WgpuLimits`](crate::settings::WgpuLimits),
137
+ /// and/or [`WgpuFeatures`](crate::settings::WgpuFeatures). For example, on Windows currently
138
+ /// `DirectX 11` is not supported by wgpu 0.12 and so if your GPU/drivers do not support Vulkan,
139
+ /// it may be that a software renderer called "Microsoft Basic Render Driver" using `DirectX 12`
140
+ /// will be chosen and performance will be very poor. This is visible in a log message that is
141
+ /// output during renderer initialization. Future versions of wgpu will support `DirectX 11`, but
142
+ /// another alternative is to try to use [`ANGLE`](https://github.com/gfx-rs/wgpu#angle) and
143
+ /// [`Backends::GL`](crate::settings::Backends::GL) if your GPU/drivers support `OpenGL 4.3` / `OpenGL ES 3.0` or
144
+ /// later.
124
145
pub fn prepare_windows (
125
146
// By accessing a NonSend resource, we tell the scheduler to put this system on the main thread,
126
147
// which is necessary for some OS s
0 commit comments