D3D12: Support per plane views with NV12 textures

Adds support for NV12 texture format and per plane view aspects.
Only allows planar sampling of imported DX11 textures. See usage
tests for examples and formats.h for rules.

Bug: dawn:551
Change-Id: I44b89d2c07bb9969638e77ce7c756ef367167f0c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38781
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Bryan Bernhart
2021-02-05 20:11:24 +00:00
committed by Commit Bot service account
parent 185c6a5b0f
commit 14a2398e71
20 changed files with 1008 additions and 13 deletions

View File

@@ -109,6 +109,10 @@ namespace utils {
case wgpu::TextureFormat::Depth24Plus:
case wgpu::TextureFormat::Depth24PlusStencil8:
// Block size of a multi-planar format depends on aspect.
case wgpu::TextureFormat::R8BG8Biplanar420Unorm:
case wgpu::TextureFormat::Undefined:
UNREACHABLE();
}
@@ -173,6 +177,9 @@ namespace utils {
case wgpu::TextureFormat::BC7RGBAUnormSrgb:
return 4u;
// Block size of a multi-planar format depends on aspect.
case wgpu::TextureFormat::R8BG8Biplanar420Unorm:
case wgpu::TextureFormat::Undefined:
UNREACHABLE();
}
@@ -237,6 +244,9 @@ namespace utils {
case wgpu::TextureFormat::BC7RGBAUnormSrgb:
return 4u;
// Block size of a multi-planar format depends on aspect.
case wgpu::TextureFormat::R8BG8Biplanar420Unorm:
case wgpu::TextureFormat::Undefined:
UNREACHABLE();
}