File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1+ use crate :: graphics:: color;
12use std:: borrow:: Cow ;
23use wgpu:: util:: DeviceExt ;
34use wgpu:: vertex_attr_array;
@@ -123,7 +124,11 @@ impl Pipeline {
123124 module : & shader,
124125 entry_point : "fs_main" ,
125126 targets : & [ Some ( wgpu:: ColorTargetState {
126- format : wgpu:: TextureFormat :: Rgba8UnormSrgb ,
127+ format : if color:: GAMMA_CORRECTION {
128+ wgpu:: TextureFormat :: Rgba8UnormSrgb
129+ } else {
130+ wgpu:: TextureFormat :: Rgba8Unorm
131+ } ,
127132 blend : Some ( wgpu:: BlendState {
128133 color : wgpu:: BlendComponent {
129134 src_factor : wgpu:: BlendFactor :: SrcAlpha ,
@@ -171,7 +176,11 @@ impl Pipeline {
171176 mip_level_count : 1 ,
172177 sample_count : 1 ,
173178 dimension : wgpu:: TextureDimension :: D2 ,
174- format : wgpu:: TextureFormat :: Rgba8UnormSrgb ,
179+ format : if color:: GAMMA_CORRECTION {
180+ wgpu:: TextureFormat :: Rgba8UnormSrgb
181+ } else {
182+ wgpu:: TextureFormat :: Rgba8Unorm
183+ } ,
175184 usage : wgpu:: TextureUsages :: RENDER_ATTACHMENT
176185 | wgpu:: TextureUsages :: COPY_SRC ,
177186 view_formats : & [ ] ,
You can’t perform that action at this time.
0 commit comments