Skip to content

Commit

Permalink
Compat: Test that depthBiasClamp must be 0
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Jan 10, 2024
1 parent 74db6af commit 39452b3
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
export const description = `
Tests that depthBiasClamp must be zero in compat mode.
`;

import { makeTestGroup } from '../../../../../common/framework/test_group.js';
import { CompatibilityTest } from '../../../compatibility_test.js';

export const g = makeTestGroup(CompatibilityTest);

g.test('depthBiasClamp')
.desc('Tests that depthBiasClamp must be zero in compat mode.')
.params(u =>
u //
.combine('depthBiasClamp', [undefined, 0, 0.1, 1])
.combine('async', [false, true] as const)
)
.fn(t => {
const { depthBiasClamp, async } = t.params;

const module = t.device.createShaderModule({
code: `
@vertex fn vs() -> @builtin(position) vec4f {
return vec4f(0);
}
@fragment fn fs() -> @location(0) vec4f {
return vec4f(0);
}
`,
});

const pipelineDescriptor: GPURenderPipelineDescriptor = {
layout: 'auto',
vertex: {
module,
entryPoint: 'vs',
},
fragment: {
module,
entryPoint: 'fs',
targets: [{ format: 'rgba8unorm' }],
},
depthStencil: {
format: 'depth24plus',
...(depthBiasClamp !== undefined && { depthBiasClamp }),
},
};

const success = !depthBiasClamp;
t.doCreateRenderPipelineTest(async, success, pipelineDescriptor);
});
1 change: 1 addition & 0 deletions src/webgpu/listing_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,7 @@
"webgpu:compat,api,validation,encoding,programmable,pipeline_bind_group_compat:twoDifferentTextureViews,compute_pass,used:*": { "subcaseMS": 49.405 },
"webgpu:compat,api,validation,encoding,programmable,pipeline_bind_group_compat:twoDifferentTextureViews,render_pass,unused:*": { "subcaseMS": 16.002 },
"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,shader_module:interpolate:*": { "subcaseMS": 1.502 },
"webgpu:compat,api,validation,render_pipeline,shader_module:sample_mask:*": { "subcaseMS": 14.801 },
Expand Down

0 comments on commit 39452b3

Please sign in to comment.