Skip to content

Commit 89ec85a

Browse files
authored
Merge branch 'main' into skip-hmtlve
2 parents 3fec95c + 5241b4a commit 89ec85a

File tree

9 files changed

+45
-78
lines changed

9 files changed

+45
-78
lines changed

src/unittests/floating_point.spec.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3536,19 +3536,27 @@ const kRoundIntervalCases = {
35363536
f32: [
35373537
{ input: 2 ** 30, expected: 2 ** 30 },
35383538
{ input: -(2 ** 30), expected: -(2 ** 30) },
3539-
{ input: 0x80000000, expected: 0x80000000 }, // https://github.com/gpuweb/cts/issues/2766
3539+
{ input: 0x8000_0000, expected: 0x8000_0000 }, // https://github.com/gpuweb/cts/issues/2766
35403540
],
35413541
f16: [
35423542
{ input: 2 ** 14, expected: 2 ** 14 },
35433543
{ input: -(2 ** 14), expected: -(2 ** 14) },
35443544
{ input: 0x8000, expected: 0x8000 }, // https://github.com/gpuweb/cts/issues/2766
35453545
],
3546+
abstract: [
3547+
{ input: 2 ** 62, expected: 2 ** 62 },
3548+
{ input: -(2 ** 62), expected: -(2 ** 62) },
3549+
{
3550+
input: 0x8000_0000_0000_0000,
3551+
expected: 0x8000_0000_0000_0000,
3552+
}, // https://github.com/gpuweb/cts/issues/2766
3553+
],
35463554
} as const;
35473555

35483556
g.test('roundInterval')
35493557
.params(u =>
35503558
u
3551-
.combine('trait', ['f32', 'f16'] as const)
3559+
.combine('trait', ['f32', 'f16', 'abstract'] as const)
35523560
.beginSubcases()
35533561
.expandWithParams<ScalarToIntervalCase>(p => {
35543562
const constants = FP[p.trait].constants();
@@ -3579,7 +3587,7 @@ g.test('roundInterval')
35793587
{ input: constants.negative.max, expected: 0 },
35803588
...kRoundIntervalCases[p.trait],
35813589

3582-
// 32-bit subnormals
3590+
// Subnormals
35833591
{ input: constants.positive.subnormal.max, expected: 0 },
35843592
{ input: constants.positive.subnormal.min, expected: 0 },
35853593
{ input: constants.negative.subnormal.min, expected: 0 },

src/webgpu/api/operation/command_buffer/image_copy.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,6 +1413,7 @@ bytes in copy works for every format.
14131413
.beforeAllSubcases(t => {
14141414
const info = kTextureFormatInfo[t.params.format];
14151415
t.skipIfTextureFormatNotSupported(t.params.format);
1416+
t.skipIfCopyTextureToTextureNotSupportedForFormat(t.params.format);
14161417
t.selectDeviceOrSkipTestCase(info.feature);
14171418
})
14181419
.fn(t => {
@@ -1510,6 +1511,7 @@ works for every format with 2d and 2d-array textures.
15101511
.beforeAllSubcases(t => {
15111512
const info = kTextureFormatInfo[t.params.format];
15121513
t.skipIfTextureFormatNotSupported(t.params.format);
1514+
t.skipIfCopyTextureToTextureNotSupportedForFormat(t.params.format);
15131515
t.selectDeviceOrSkipTestCase(info.feature);
15141516
})
15151517
.fn(t => {
@@ -1590,6 +1592,7 @@ for all formats. We pass origin and copyExtent as [number, number, number].`
15901592
.beforeAllSubcases(t => {
15911593
const info = kTextureFormatInfo[t.params.format];
15921594
t.skipIfTextureFormatNotSupported(t.params.format);
1595+
t.skipIfCopyTextureToTextureNotSupportedForFormat(t.params.format);
15931596
t.selectDeviceOrSkipTestCase(info.feature);
15941597
})
15951598
.fn(t => {
@@ -1790,6 +1793,7 @@ TODO: Make a variant for depth-stencil formats.
17901793
.beforeAllSubcases(t => {
17911794
const info = kTextureFormatInfo[t.params.format];
17921795
t.skipIfTextureFormatNotSupported(t.params.format);
1796+
t.skipIfCopyTextureToTextureNotSupportedForFormat(t.params.format);
17931797
t.selectDeviceOrSkipTestCase(info.feature);
17941798
})
17951799
.fn(t => {

src/webgpu/api/validation/encoding/createRenderBundleEncoder.spec.ts

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,7 @@ g.test('valid_texture_formats')
196196
g.test('depth_stencil_readonly')
197197
.desc(
198198
`
199-
Tests that createRenderBundleEncoder validation of depthReadOnly and stencilReadOnly
200-
- With depth-only formats
201-
- With stencil-only formats
202-
- With depth-stencil-combined formats
199+
Test that allow combinations of depth-stencil format, depthReadOnly and stencilReadOnly are allowed.
203200
`
204201
)
205202
.params(u =>
@@ -215,44 +212,9 @@ g.test('depth_stencil_readonly')
215212
})
216213
.fn(t => {
217214
const { depthStencilFormat, depthReadOnly, stencilReadOnly } = t.params;
218-
219-
let shouldError = false;
220-
if (
221-
kTextureFormatInfo[depthStencilFormat].depth &&
222-
kTextureFormatInfo[depthStencilFormat].stencil &&
223-
depthReadOnly !== stencilReadOnly
224-
) {
225-
shouldError = true;
226-
}
227-
228-
t.expectValidationError(() => {
229-
t.device.createRenderBundleEncoder({
230-
colorFormats: [],
231-
depthStencilFormat,
232-
depthReadOnly,
233-
stencilReadOnly,
234-
});
235-
}, shouldError);
236-
});
237-
238-
g.test('depth_stencil_readonly_with_undefined_depth')
239-
.desc(
240-
`
241-
Tests that createRenderBundleEncoder validation of depthReadOnly and stencilReadOnly is ignored
242-
if there is no depthStencilFormat set.
243-
`
244-
)
245-
.params(u =>
246-
u //
247-
.beginSubcases()
248-
.combine('depthReadOnly', [false, true])
249-
.combine('stencilReadOnly', [false, true])
250-
)
251-
.fn(t => {
252-
const { depthReadOnly, stencilReadOnly } = t.params;
253-
254215
t.device.createRenderBundleEncoder({
255-
colorFormats: ['bgra8unorm'],
216+
colorFormats: [],
217+
depthStencilFormat,
256218
depthReadOnly,
257219
stencilReadOnly,
258220
});

src/webgpu/api/validation/encoding/render_bundle.spec.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Tests execution of render bundles.
33
`;
44

55
import { makeTestGroup } from '../../../../common/framework/test_group.js';
6-
import { kDepthStencilFormats, kTextureFormatInfo } from '../../../format_info.js';
6+
import { kDepthStencilFormats } from '../../../format_info.js';
77
import { ValidationTest } from '../validation_test.js';
88

99
export const g = makeTestGroup(ValidationTest);
@@ -170,18 +170,6 @@ g.test('depth_stencil_readonly_mismatch')
170170
.combine('bundleStencilReadOnly', [false, true])
171171
.combine('passDepthReadOnly', [false, true])
172172
.combine('passStencilReadOnly', [false, true])
173-
.filter(p => {
174-
// For combined depth/stencil formats the depth and stencil read only state must match
175-
// in order to create a valid render bundle or render pass.
176-
const depthStencilInfo = kTextureFormatInfo[p.depthStencilFormat];
177-
if (depthStencilInfo.depth && depthStencilInfo.stencil) {
178-
return (
179-
p.passDepthReadOnly === p.passStencilReadOnly &&
180-
p.bundleDepthReadOnly === p.bundleStencilReadOnly
181-
);
182-
}
183-
return true;
184-
})
185173
)
186174
.beforeAllSubcases(t => {
187175
t.selectDeviceForTextureFormatOrSkipTestCase(t.params.depthStencilFormat);

src/webgpu/api/validation/render_pass/attachment_compatibility.spec.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -551,13 +551,6 @@ Test that the depth stencil read only state in render passes or bundles is compa
551551
.filter(p => {
552552
if (p.format) {
553553
const depthStencilInfo = kTextureFormatInfo[p.format];
554-
// For combined depth/stencil formats the depth and stencil read only state must match
555-
// in order to create a valid render bundle or render pass.
556-
if (depthStencilInfo.depth && depthStencilInfo.stencil) {
557-
if (p.depthReadOnly !== p.stencilReadOnly) {
558-
return false;
559-
}
560-
}
561554
// If the format has no depth aspect, the depthReadOnly, depthWriteEnabled of the pipeline must not be true
562555
// in order to create a valid render pipeline.
563556
if (!depthStencilInfo.depth && p.depthWriteEnabled) {

src/webgpu/api/validation/render_pass/render_pass_descriptor.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -909,10 +909,8 @@ g.test('depth_stencil_attachment,loadOp_storeOp_match_depthReadOnly_stencilReadO
909909
const hasDepth = info.depth;
910910
const hasStencil = info.stencil;
911911

912-
const goodAspectCombo =
913-
(hasDepth && hasStencil ? !depthReadOnly === !stencilReadOnly : true) &&
914-
(hasDepthSettings ? hasDepth : true) &&
915-
(hasStencilSettings ? hasStencil : true);
912+
const goodAspectSettingsPresent =
913+
(hasDepthSettings ? hasDepth : true) && (hasStencilSettings ? hasStencil : true);
916914

917915
const hasBothDepthOps = !!depthLoadOp && !!depthStoreOp;
918916
const hasBothStencilOps = !!stencilLoadOp && !!stencilStoreOp;
@@ -923,7 +921,7 @@ g.test('depth_stencil_attachment,loadOp_storeOp_match_depthReadOnly_stencilReadO
923921
const goodStencilCombo =
924922
hasStencil && !stencilReadOnly ? hasBothStencilOps : hasNeitherStencilOps;
925923

926-
const shouldError = !goodAspectCombo || !goodDepthCombo || !goodStencilCombo;
924+
const shouldError = !goodAspectSettingsPresent || !goodDepthCombo || !goodStencilCombo;
927925

928926
t.expectValidationError(() => {
929927
encoder.finish();

src/webgpu/listing_meta.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,6 @@
517517
"webgpu:api,validation,encoding,createRenderBundleEncoder:attachment_state,limits,maxColorAttachmentBytesPerSample,unaligned:*": { "subcaseMS": 0.750 },
518518
"webgpu:api,validation,encoding,createRenderBundleEncoder:attachment_state,limits,maxColorAttachments:*": { "subcaseMS": 0.145 },
519519
"webgpu:api,validation,encoding,createRenderBundleEncoder:depth_stencil_readonly:*": { "subcaseMS": 1.804 },
520-
"webgpu:api,validation,encoding,createRenderBundleEncoder:depth_stencil_readonly_with_undefined_depth:*": { "subcaseMS": 14.825 },
521520
"webgpu:api,validation,encoding,createRenderBundleEncoder:valid_texture_formats:*": { "subcaseMS": 2.130 },
522521
"webgpu:api,validation,encoding,encoder_open_state:compute_pass_commands:*": { "subcaseMS": 4.208 },
523522
"webgpu:api,validation,encoding,encoder_open_state:non_pass_commands:*": { "subcaseMS": 26.191 },
@@ -1360,7 +1359,7 @@
13601359
"webgpu:shader,execution,expression,call,builtin,refract:f32_vec4:*": { "subcaseMS": 610.150 },
13611360
"webgpu:shader,execution,expression,call,builtin,reverseBits:i32:*": { "subcaseMS": 9.594 },
13621361
"webgpu:shader,execution,expression,call,builtin,reverseBits:u32:*": { "subcaseMS": 7.969 },
1363-
"webgpu:shader,execution,expression,call,builtin,round:abstract_float:*": { "subcaseMS": 19.408 },
1362+
"webgpu:shader,execution,expression,call,builtin,round:abstract_float:*": { "subcaseMS": 450.551 },
13641363
"webgpu:shader,execution,expression,call,builtin,round:f16:*": { "subcaseMS": 30.509 },
13651364
"webgpu:shader,execution,expression,call,builtin,round:f32:*": { "subcaseMS": 12.407 },
13661365
"webgpu:shader,execution,expression,call,builtin,saturate:abstract_float:*": { "subcaseMS": 527.425 },

src/webgpu/shader/execution/expression/call/builtin/round.spec.ts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ Component-wise when T is a vector.
1212

1313
import { makeTestGroup } from '../../../../../../common/framework/test_group.js';
1414
import { GPUTest } from '../../../../../gpu_test.js';
15-
import { TypeF32, TypeF16 } from '../../../../../util/conversion.js';
15+
import { TypeF32, TypeF16, TypeAbstractFloat } from '../../../../../util/conversion.js';
1616
import { FP } from '../../../../../util/floating_point.js';
17-
import { fullF32Range, fullF16Range } from '../../../../../util/math.js';
17+
import { fullF32Range, fullF16Range, fullF64Range } from '../../../../../util/math.js';
1818
import { makeCaseCache } from '../../case_cache.js';
19-
import { allInputSources, run } from '../../expression.js';
19+
import { allInputSources, onlyConstInputSource, run } from '../../expression.js';
2020

21-
import { builtin } from './builtin.js';
21+
import { abstractBuiltin, builtin } from './builtin.js';
2222

2323
export const g = makeTestGroup(GPUTest);
2424

@@ -43,15 +43,30 @@ export const d = makeCaseCache('round', {
4343
FP.f16.roundInterval
4444
);
4545
},
46+
abstract: () => {
47+
return FP.abstract.generateScalarToIntervalCases(
48+
[
49+
0x8000_0000_0000_0000, // https://github.com/gpuweb/cts/issues/2766
50+
...fullF64Range(),
51+
],
52+
'unfiltered',
53+
FP.abstract.roundInterval
54+
);
55+
},
4656
});
4757

4858
g.test('abstract_float')
4959
.specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions')
5060
.desc(`abstract float tests`)
5161
.params(u =>
52-
u.combine('inputSource', allInputSources).combine('vectorize', [undefined, 2, 3, 4] as const)
62+
u
63+
.combine('inputSource', onlyConstInputSource)
64+
.combine('vectorize', [undefined, 2, 3, 4] as const)
5365
)
54-
.unimplemented();
66+
.fn(async t => {
67+
const cases = await d.get('abstract');
68+
await run(t, abstractBuiltin('round'), [TypeAbstractFloat], TypeAbstractFloat, t.params, cases);
69+
});
5570

5671
g.test('f32')
5772
.specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions')

src/webgpu/util/floating_point.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5108,7 +5108,7 @@ class FPAbstractTraits extends FPTraits {
51085108
public readonly remainderInterval = (x: number, y: number): FPInterval => {
51095109
return this.toInterval(kF32Traits.remainderInterval(x, y));
51105110
};
5111-
public readonly roundInterval = this.unimplementedScalarToInterval.bind(this, 'roundInterval');
5111+
public readonly roundInterval = this.roundIntervalImpl.bind(this);
51125112
public readonly saturateInterval = this.saturateIntervalImpl.bind(this);
51135113
public readonly signInterval = this.signIntervalImpl.bind(this);
51145114
public readonly sinInterval = this.unimplementedScalarToInterval.bind(this, 'sinInterval');

0 commit comments

Comments
 (0)