Skip to content

Commit 486c151

Browse files
authored
[dx12,vulkan] Add support for P010 texture format (#8086)
P010 is a 4:2:0 chroma subsampled planar format, similar to NV12. Each component uses 16 bits of storage, of which only the high 10 bits are used. On DX12 this maps to DXGI_FORMAT_P010, and on Vulkan this maps to G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16. The existing "nv12" gpu test module has been renamed to "planar_texture", and a new test P010_TEXTURE_CREATION_SAMPLING has been added similar to the existing NV12_TEXTURE_CREATION_SAMPLING. The remaining tests in this module have been converted to validation tests, and now test both NV12 and P010 formats.
1 parent 01b3204 commit 486c151

File tree

19 files changed

+570
-310
lines changed

19 files changed

+570
-310
lines changed

tests/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub use wgpu_macros::gpu_test;
3737
pub fn fail<T>(
3838
device: &wgpu::Device,
3939
callback: impl FnOnce() -> T,
40-
expected_msg_substring: Option<&'static str>,
40+
expected_msg_substring: Option<&str>,
4141
) -> T {
4242
device.push_error_scope(wgpu::ErrorFilter::Validation);
4343
let result = callback();

tests/tests/wgpu-gpu/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ mod instance;
3636
mod life_cycle;
3737
mod mem_leaks;
3838
mod mesh_shader;
39-
mod nv12_texture;
4039
mod occlusion_query;
4140
mod oob_indexing;
4241
mod oom;
4342
mod pipeline;
4443
mod pipeline_cache;
44+
mod planar_texture;
4545
mod poll;
4646
mod push_constants;
4747
mod query_set;
@@ -96,12 +96,12 @@ fn all_tests() -> Vec<wgpu_test::GpuTestInitializer> {
9696
life_cycle::all_tests(&mut tests);
9797
mem_leaks::all_tests(&mut tests);
9898
mesh_shader::all_tests(&mut tests);
99-
nv12_texture::all_tests(&mut tests);
10099
occlusion_query::all_tests(&mut tests);
101100
oob_indexing::all_tests(&mut tests);
102101
oom::all_tests(&mut tests);
103102
pipeline_cache::all_tests(&mut tests);
104103
pipeline::all_tests(&mut tests);
104+
planar_texture::all_tests(&mut tests);
105105
poll::all_tests(&mut tests);
106106
push_constants::all_tests(&mut tests);
107107
query_set::all_tests(&mut tests);

tests/tests/wgpu-gpu/nv12_texture/mod.rs

Lines changed: 0 additions & 277 deletions
This file was deleted.

0 commit comments

Comments
 (0)