@@ -190,16 +190,17 @@ pub fn prepare_windows(
190
190
. unwrap ( ) ;
191
191
let caps = surface. get_capabilities ( & render_adapter) ;
192
192
let formats = caps. formats ;
193
- // Explicitally request a format, otherwise fallback to the first available format
193
+ // Explicitally request an sRBG format, otherwise fallback to the first available format.
194
194
// For future HDR output support, we'll need to request a format that supports HDR,
195
195
// but as of wgpu 0.15 that is not yet supported.
196
- // TODO: This works if https://github.com/gfx-rs/wgpu/pull/3409 lands in time for wgpu 0.15
197
- // Otherwise, we'll need to use sRGB formats (which WebGPU doesn't support).
198
- let format = if formats. contains ( & TextureFormat :: Rgba8Unorm ) {
199
- TextureFormat :: Rgba8Unorm
200
- } else if formats. contains ( & TextureFormat :: Bgra8Unorm ) {
201
- TextureFormat :: Bgra8Unorm
196
+ let format = if formats. contains ( & TextureFormat :: Rgba8UnormSrgb ) {
197
+ TextureFormat :: Rgba8UnormSrgb
198
+ } else if formats. contains ( & TextureFormat :: Bgra8UnormSrgb ) {
199
+ TextureFormat :: Bgra8UnormSrgb
202
200
} else {
201
+ // TODO: If this isn't an sRGB surface (eg. on webgpu), use an sRGB view_format on the SurfaceConfiguration.
202
+ // TODO: webgpu doesn't support sRGB surfaces, and requires an sRGB view_format, but that was causing issues on Vulkan
203
+ // so it's getting skipped for now.
203
204
formats[ 0 ]
204
205
} ;
205
206
SurfaceData { surface, format }
@@ -224,6 +225,8 @@ pub fn prepare_windows(
224
225
CompositeAlphaMode :: PostMultiplied => wgpu:: CompositeAlphaMode :: PostMultiplied ,
225
226
CompositeAlphaMode :: Inherit => wgpu:: CompositeAlphaMode :: Inherit ,
226
227
} ,
228
+ // TODO: Figure out why Vulkan is spitting out tons of validation errors when attempting to use an sRGB view_format on the surface.
229
+ view_formats : vec ! [ ] ,
227
230
} ;
228
231
229
232
// A recurring issue is hitting `wgpu::SurfaceError::Timeout` on certain Linux
0 commit comments