Skip to content

Commit

Permalink
wgpu: Round down Context3D sample count to nearest power of 2 (#13762)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 authored Oct 29, 2023
1 parent cc49aae commit 46320c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions render/wgpu/src/context3d/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 46320c6

Please sign in to comment.