Skip to content

Commit

Permalink
Add external_texture test. (#3544)
Browse files Browse the repository at this point in the history
This CL adds a test which creates a pipeline with an external_texture.
It doesn't attempt to use the texture, just creates the pipeline to
validate there are no errors on creation.
  • Loading branch information
dj2 authored Mar 22, 2024
1 parent c2e75b4 commit 061d144
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/webgpu/api/validation/render_pipeline/misc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,37 @@ g.test('pipeline_layout,device_mismatch')

t.doCreateRenderPipelineTest(isAsync, !mismatched, descriptor);
});

g.test('external_texture')
.desc('Tests createRenderPipeline() with an external_texture')
.fn(t => {
const shader = t.device.createShaderModule({
code: `
@vertex
fn vertexMain() -> @builtin(position) vec4f {
return vec4f(1);
}
@group(0) @binding(0) var myTexture: texture_external;
@fragment
fn fragmentMain() -> @location(0) vec4f {
let result = textureLoad(myTexture, vec2u(1, 1));
return vec4f(1);
}
`,
});

const descriptor: GPURenderPipelineDescriptor = {
layout: 'auto',
vertex: {
module: shader,
},
fragment: {
module: shader,
targets: [{ format: 'rgba8unorm' }],
},
};

t.doCreateRenderPipelineTest(false, true, descriptor);
});
1 change: 1 addition & 0 deletions src/webgpu/listing_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,7 @@
"webgpu:api,validation,render_pipeline,inter_stage:max_shader_variable_location:*": { "subcaseMS": 11.050 },
"webgpu:api,validation,render_pipeline,inter_stage:type:*": { "subcaseMS": 6.170 },
"webgpu:api,validation,render_pipeline,misc:basic:*": { "subcaseMS": 0.901 },
"webgpu:api,validation,render_pipeline,misc:external_texture:*": { "subcaseMS": 35.189 },
"webgpu:api,validation,render_pipeline,misc:pipeline_layout,device_mismatch:*": { "subcaseMS": 8.700 },
"webgpu:api,validation,render_pipeline,misc:vertex_state_only:*": { "subcaseMS": 1.125 },
"webgpu:api,validation,render_pipeline,multisample_state:alpha_to_coverage,count:*": { "subcaseMS": 3.200 },
Expand Down

0 comments on commit 061d144

Please sign in to comment.