Skip to content

Conversation

@maki-rs
Copy link

@maki-rs maki-rs commented Oct 3, 2023

Fix for #370

pixels.resize_with(pixels_buffer_size, Default::default);

let alpha_mode = surface_capabilities.alpha_modes[0];
let alpha_mode = self.alpha_mode;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably check whether the selected alpha mode is supported by the surface. Return an error if it is not.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the same be done for Pixels::surface_texture_format and Pixels::render_texture_format then?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that is the case. AlphaMode is for the surface configuration, not for any textures. The original code here used the first alpha mode from the surface capabilities. Even if that isn't a great default choice, it was at least guaranteed to be supported by the surface.

///```
///use pixels::wgpu::CompositeAlphaMode;
///
///let mut pixels = PixelsBuilder::new(320, 240, surface_texture)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is not passing in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants