Skip to content

Commit

Permalink
add NV12_TEXTURE_BAD_SIZE test
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaopengli89 committed Nov 28, 2023
1 parent 7ccaa0e commit eb712be
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/tests/nv12_texture/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,27 @@ static NV12_TEXTURE_BAD_FORMAT_VIEW_PLANE: GpuTestConfiguration = GpuTestConfigu
});
});
});

#[gpu_test]
static NV12_TEXTURE_BAD_SIZE: GpuTestConfiguration = GpuTestConfiguration::new()
.parameters(TestParameters::default().features(wgpu::Features::TEXTURE_FORMAT_NV12))
.run_sync(|ctx| {
let size = wgpu::Extent3d {
width: 255,
height: 255,
depth_or_array_layers: 1,
};

fail(&ctx.device, || {
let _ = ctx.device.create_texture(&wgpu::TextureDescriptor {
label: None,
dimension: wgpu::TextureDimension::D2,
size,
format: wgpu::TextureFormat::NV12,
usage: wgpu::TextureUsages::TEXTURE_BINDING,
mip_level_count: 1,
sample_count: 1,
view_formats: &[wgpu::TextureFormat::R8Unorm, wgpu::TextureFormat::Rg8Unorm],
});
});
});

0 comments on commit eb712be

Please sign in to comment.