Skip to content

Commit

Permalink
validation: clamp low_high test must reference the test function (#3899)
Browse files Browse the repository at this point in the history
The clamp validation test creates a 'foo' function that contains
code to be checked.  The entry point must call 'foo' in order
for those override expressions to be checked.

Bug: crbug.com/351378281
  • Loading branch information
dneto0 authored Aug 13, 2024
1 parent cdd0502 commit d849b67
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/webgpu/listing_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -862,14 +862,14 @@
"webgpu:compat,api,validation,encoding,programmable,pipeline_bind_group_compat:twoDifferentTextureViews,render_pass,used:*": { "subcaseMS": 0.000 },
"webgpu:compat,api,validation,render_pipeline,depth_stencil_state:depthBiasClamp:*": { "subcaseMS": 1.604 },
"webgpu:compat,api,validation,render_pipeline,fragment_state:colorState:*": { "subcaseMS": 32.604 },
"webgpu:compat,api,validation,render_pipeline,vertex_state:maxVertexAttributesVertexIndexInstanceIndex:*": { "subcaseMS": 3.700 },
"webgpu:compat,api,validation,render_pipeline,unsupported_wgsl:interpolate:*": { "subcaseMS": 3.488 },
"webgpu:compat,api,validation,render_pipeline,unsupported_wgsl:sample_index:*": { "subcaseMS": 0.487 },
"webgpu:compat,api,validation,render_pipeline,unsupported_wgsl:sample_mask:*": { "subcaseMS": 0.408 },
"webgpu:compat,api,validation,render_pipeline,unsupported_wgsl:textureLoad_with_depth_textures,computePipeline:*": { "subcaseMS": 1.259 },
"webgpu:compat,api,validation,render_pipeline,unsupported_wgsl:textureLoad_with_depth_textures,renderPipeline:*": { "subcaseMS": 1.259 },
"webgpu:compat,api,validation,render_pipeline,unsupported_wgsl:unsupportedStorageTextureFormats,computePipeline:*": { "subcaseMS": 1.206 },
"webgpu:compat,api,validation,render_pipeline,unsupported_wgsl:unsupportedStorageTextureFormats,renderPipeline:*": { "subcaseMS": 1.206 },
"webgpu:compat,api,validation,render_pipeline,vertex_state:maxVertexAttributesVertexIndexInstanceIndex:*": { "subcaseMS": 3.700 },
"webgpu:compat,api,validation,texture,createTexture:depthOrArrayLayers_incompatible_with_textureBindingViewDimension:*": { "subcaseMS": 12.712 },
"webgpu:compat,api,validation,texture,createTexture:format_reinterpretation:*": { "subcaseMS": 7.012 },
"webgpu:compat,api,validation,texture,createTexture:invalidTextureBindingViewDimension:*": { "subcaseMS": 6.022 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ fn foo() {
code: wgsl,
constants,
reference: ['o_low', 'o_high'],
statements: ['foo();'],
});
}
});
Expand Down
5 changes: 5 additions & 0 deletions src/webgpu/shader/validation/shader_validation_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,14 @@ export class ShaderValidationTest extends GPUTest {
constants?: Record<string, GPUPipelineConstantValue>;
// List of additional module-scope variable the entrypoint needs to reference
reference?: string[];
// List of additional statements to insert in the entry point.
statements?: string[];
}) {
const phonies: Array<string> = [];

if (args.statements !== undefined) {
phonies.push(...args.statements);
}
if (args.constants !== undefined) {
phonies.push(...keysOf(args.constants).map(c => `_ = ${c};`));
}
Expand Down

0 comments on commit d849b67

Please sign in to comment.