@@ -155,6 +155,12 @@ async fn run(
155
155
)
156
156
} ) ;
157
157
158
+ // HACK(eddyb) this (alongside `.add_srgb_suffix()` calls elsewhere)
159
+ // forces sRGB output, even on WebGPU (which handles it differently).
160
+ surface_config
161
+ . view_formats
162
+ . push ( surface_config. format . add_srgb_suffix ( ) ) ;
163
+
158
164
// FIXME(eddyb) should this be toggled by a CLI arg?
159
165
// NOTE(eddyb) VSync was disabled in the past, but without VSync,
160
166
// especially for simpler shaders, you can easily hit thousands
@@ -185,7 +191,7 @@ async fn run(
185
191
& pipeline_layout,
186
192
surface_with_config. as_ref ( ) . map_or_else (
187
193
|pending| pending. preferred_format ,
188
- |( _, surface_config) | surface_config. format ,
194
+ |( _, surface_config) | surface_config. format . add_srgb_suffix ( ) ,
189
195
) ,
190
196
compiled_shader_modules,
191
197
) ;
@@ -288,9 +294,10 @@ async fn run(
288
294
return ;
289
295
}
290
296
} ;
291
- let output_view = output
292
- . texture
293
- . create_view ( & wgpu:: TextureViewDescriptor :: default ( ) ) ;
297
+ let output_view = output. texture . create_view ( & wgpu:: TextureViewDescriptor {
298
+ format : Some ( surface_config. format . add_srgb_suffix ( ) ) ,
299
+ ..wgpu:: TextureViewDescriptor :: default ( )
300
+ } ) ;
294
301
let mut encoder = device
295
302
. create_command_encoder ( & wgpu:: CommandEncoderDescriptor { label : None } ) ;
296
303
{
0 commit comments