-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compat: Test that depthBiasClamp must be 0
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
src/webgpu/compat/api/validation/render_pipeline/depth_stencil_state.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters