Skip to content

Commit

Permalink
fix Default implementation of Image so that size and data match
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobhellermann committed Sep 16, 2021
1 parent 52fd626 commit 7eb7efc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pipelined/bevy_render2/src/texture/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ pub struct Image {

impl Default for Image {
fn default() -> Self {
let format = wgpu::TextureFormat::Rgba8UnormSrgb;
let data = vec![1; format.pixel_size() as usize];
Image {
data: Default::default(),
data,
texture_descriptor: wgpu::TextureDescriptor {
size: wgpu::Extent3d {
width: 1,
height: 1,
depth_or_array_layers: 1,
},
format: wgpu::TextureFormat::Rgba8UnormSrgb,
format,
dimension: wgpu::TextureDimension::D2,
label: None,
mip_level_count: 1,
Expand Down

0 comments on commit 7eb7efc

Please sign in to comment.