File tree 8 files changed +19
-8
lines changed
bevy_pbr/src/render_graph/forward_pipeline
8 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ pub(crate) fn build_forward_pipeline(shaders: &mut Assets<Shader>) -> PipelineDe
34
34
} ,
35
35
} ) ,
36
36
color_states : vec ! [ ColorStateDescriptor {
37
- format: TextureFormat :: Bgra8UnormSrgb ,
37
+ format: TextureFormat :: default ( ) ,
38
38
color_blend: BlendDescriptor {
39
39
src_factor: BlendFactor :: SrcAlpha ,
40
40
dst_factor: BlendFactor :: OneMinusSrcAlpha ,
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ impl PipelineDescriptor {
91
91
} ,
92
92
} ) ,
93
93
color_states : vec ! [ ColorStateDescriptor {
94
- format: TextureFormat :: Bgra8UnormSrgb ,
94
+ format: TextureFormat :: default ( ) ,
95
95
color_blend: BlendDescriptor {
96
96
src_factor: BlendFactor :: SrcAlpha ,
97
97
dst_factor: BlendFactor :: OneMinusSrcAlpha ,
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ impl BaseRenderGraphBuilder for RenderGraph {
209
209
mip_level_count : 1 ,
210
210
sample_count : msaa. samples ,
211
211
dimension : TextureDimension :: D2 ,
212
- format : TextureFormat :: Bgra8UnormSrgb ,
212
+ format : TextureFormat :: default ( ) ,
213
213
usage : TextureUsage :: OUTPUT_ATTACHMENT ,
214
214
} ,
215
215
) ,
Original file line number Diff line number Diff line change @@ -206,6 +206,17 @@ impl TextureFormat {
206
206
}
207
207
}
208
208
209
+ impl Default for TextureFormat {
210
+ fn default ( ) -> Self {
211
+ if cfg ! ( target_os = "android" ) {
212
+ // Bgra8UnormSrgb texture missing on some Android devices
213
+ TextureFormat :: Rgba8UnormSrgb
214
+ } else {
215
+ TextureFormat :: Bgra8UnormSrgb
216
+ }
217
+ }
218
+ }
219
+
209
220
bitflags:: bitflags! {
210
221
#[ repr( transparent) ]
211
222
pub struct TextureUsage : u32 {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ pub fn build_sprite_sheet_pipeline(shaders: &mut Assets<Shader>) -> PipelineDesc
40
40
} ,
41
41
} ) ,
42
42
color_states : vec ! [ ColorStateDescriptor {
43
- format: TextureFormat :: Bgra8UnormSrgb ,
43
+ format: TextureFormat :: default ( ) ,
44
44
color_blend: BlendDescriptor {
45
45
src_factor: BlendFactor :: SrcAlpha ,
46
46
dst_factor: BlendFactor :: OneMinusSrcAlpha ,
@@ -88,7 +88,7 @@ pub fn build_sprite_pipeline(shaders: &mut Assets<Shader>) -> PipelineDescriptor
88
88
} ,
89
89
} ) ,
90
90
color_states : vec ! [ ColorStateDescriptor {
91
- format: TextureFormat :: Bgra8UnormSrgb ,
91
+ format: TextureFormat :: default ( ) ,
92
92
color_blend: BlendDescriptor {
93
93
src_factor: BlendFactor :: SrcAlpha ,
94
94
dst_factor: BlendFactor :: OneMinusSrcAlpha ,
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ pub fn build_ui_pipeline(shaders: &mut Assets<Shader>) -> PipelineDescriptor {
42
42
} ,
43
43
} ) ,
44
44
color_states : vec ! [ ColorStateDescriptor {
45
- format: TextureFormat :: Bgra8UnormSrgb ,
45
+ format: TextureFormat :: default ( ) ,
46
46
color_blend: BlendDescriptor {
47
47
src_factor: BlendFactor :: SrcAlpha ,
48
48
dst_factor: BlendFactor :: OneMinusSrcAlpha ,
Original file line number Diff line number Diff line change @@ -562,7 +562,7 @@ impl WgpuFrom<&Window> for wgpu::SwapChainDescriptor {
562
562
fn from ( window : & Window ) -> Self {
563
563
wgpu:: SwapChainDescriptor {
564
564
usage : wgpu:: TextureUsage :: OUTPUT_ATTACHMENT ,
565
- format : wgpu :: TextureFormat :: Bgra8UnormSrgb ,
565
+ format : TextureFormat :: default ( ) . wgpu_into ( ) ,
566
566
width : window. width ( ) ,
567
567
height : window. height ( ) ,
568
568
present_mode : if window. vsync ( ) {
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ fn setup(
134
134
mip_level_count : 1 ,
135
135
sample_count : msaa. samples ,
136
136
dimension : TextureDimension :: D2 ,
137
- format : TextureFormat :: Bgra8UnormSrgb ,
137
+ format : TextureFormat :: default ( ) ,
138
138
usage : TextureUsage :: OUTPUT_ATTACHMENT ,
139
139
} ,
140
140
) ,
You can’t perform that action at this time.
0 commit comments