wgpu: Round down Context3D sample count to nearest power of 2 (#13762)

This commit is contained in:
Aaron Hill 2023-10-28 20:18:52 -04:00 committed by GitHub
parent cc49aaee58
commit 46320c6238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -545,6 +545,12 @@ impl Context3D for WgpuContext3D {
if sample_count == 0 {
sample_count = 1;
}
let next_pot = sample_count.next_power_of_two();
if sample_count != next_pot {
// Round down to nearest power of 2
sample_count = next_pot / 2;
}
let texture_label = create_debug_label!("Render target texture");
let format = wgpu::TextureFormat::Rgba8Unorm;