mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-22 15:31:03 +01:00
refactor: vertex_index_common: use size_of_val instead of magic number
This commit is contained in:
1 parent
764b15a556
commit
5c29ad548b
1 file changed
+1
-2
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user