Skip to content

Commit

Permalink
refactor: vertex_index_common: use size_of_val instead of magic n…
Browse files Browse the repository at this point in the history
…umber
  • Loading branch information
ErichDonGubler committed Jul 4, 2024
1 parent 764b15a commit 5c29ad5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/tests/vertex_indices/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use std::{num::NonZeroU64, ops::Range};
use itertools::Itertools;
use strum::IntoEnumIterator;
use wgpu::util::{BufferInitDescriptor, DeviceExt, RenderEncoder};

use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters, TestingContext};
use wgt::RenderBundleDescriptor;

Expand Down Expand Up @@ -379,7 +378,7 @@ async fn vertex_index_common(ctx: TestingContext) {

let expected = test.expectation(&ctx);

let buffer_size = 4 * expected.len() as u64;
let buffer_size = (std::mem::size_of_val(&expected[0]) * expected.len()) as u64;
let cpu_buffer = ctx.device.create_buffer(&wgpu::BufferDescriptor {
label: None,
size: buffer_size,
Expand Down

0 comments on commit 5c29ad5

Please sign in to comment.