Skip to content

Commit 1bf1671

Browse files
jamienicolteoxoy
authored andcommitted
[test] Add external texture GPU tests
These tests cover the external texture binding resource. They ensure the WGSL functions `textureDimensions()`, `textureLoad()`, and `textureSampleBaseClampToEdge()` work as expected for both `TextureView`s and `ExternalTexture`s bound to external texture resource bindings. For external textures, they ensure multiplanar YUV formats work as expected including handling color space transformation. And that the provided sample and load transforms correctly handle cropping, flipping, and rotation.
1 parent bd85c9a commit 1bf1671

5 files changed

Lines changed: 1159 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@group(0) @binding(0)
2+
var tex: texture_external;
3+
4+
@group(0) @binding(1)
5+
var<storage, read_write> output: vec2<u32>;
6+
7+
@compute @workgroup_size(1)
8+
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
9+
output = textureDimensions(tex);
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@group(0) @binding(0)
2+
var tex: texture_external;
3+
4+
@group(0) @binding(1)
5+
var<storage, read> coords: array<vec2<u32>>;
6+
@group(0) @binding(2)
7+
var<storage, read_write> output: array<vec4<f32>>;
8+
9+
@compute @workgroup_size(1)
10+
fn main(@builtin(global_invocation_id) id: vec3<u32>) {
11+
output[id.x] = textureLoad(tex, coords[id.x]);
12+
}

0 commit comments

Comments
 (0)