Skip to content

Commit 5d70ace

Browse files
authored
Rename deprecated texture info functions and add new ones. (#4192)
This is a step to fixing the tests so they test all optional texture formats. Note: I couldn't figure out how to share the code in validation_test.ts without bigger changes throught the code base. Maybe that can come in another PR. The issue is, the rest of the code base expects that ValidationTest is a class which means you do this function foo(t: ValidationTest) { ... } foo(new ValidationTest()); Things like the Mixin pattern don't support this as the thing returned is at best a constructor but not a type. Hopefully this can be solved later.
1 parent fc2030c commit 5d70ace

File tree

64 files changed

+961
-318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+961
-318
lines changed

src/common/framework/test_config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { assert } from '../util/util.js';
2+
13
export type TestConfig = {
24
/**
35
* Enable debug-level logs (normally logged via `Fixture.debug()`).
@@ -67,3 +69,14 @@ export const globalTestConfig: TestConfig = {
6769
enforceDefaultLimits: false,
6870
logToWebSocket: false,
6971
};
72+
73+
// Check if a device is a compatibility device.
74+
// Note: The CTS generally, requires that if globalTestConfig.compatibility
75+
// is true then the device MUST be a compatibility device since the CTS
76+
// is trying to test that compatibility devices have the correct validation.
77+
export function isCompatibilityDevice(device: GPUDevice) {
78+
if (globalTestConfig.compatibility) {
79+
assert(!device.features.has('webgpu-core'));
80+
}
81+
return globalTestConfig.compatibility;
82+
}

src/resources/cache/hashes.json

Lines changed: 110 additions & 110 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
DepthStencilFormat,
1818
ColorTextureFormat,
1919
isCompressedTextureFormat,
20-
viewCompatible,
20+
viewCompatibleDeprecated,
2121
RegularTextureFormat,
2222
isRegularTextureFormat,
2323
} from '../../../format_info.js';
@@ -80,7 +80,7 @@ class F extends TextureTestMixin(GPUTest) {
8080
srcCopyLevel: number,
8181
dstCopyLevel: number
8282
): void {
83-
this.skipIfTextureFormatNotSupported(srcFormat, dstFormat);
83+
this.skipIfTextureFormatNotSupportedDeprecated(srcFormat, dstFormat);
8484

8585
// If we're in compatibility mode and it's a compressed texture
8686
// then we need to render the texture to test the results of the copy.
@@ -208,7 +208,7 @@ class F extends TextureTestMixin(GPUTest) {
208208
align(dstBlocksPerRow * bytesPerBlock, 4);
209209

210210
if (isCompressedTextureFormat(dstTexture.format) && this.isCompatibility) {
211-
assert(viewCompatible(this.isCompatibility, srcFormat, dstFormat));
211+
assert(viewCompatibleDeprecated(this.isCompatibility, srcFormat, dstFormat));
212212
// compare by rendering. We need the expected texture to match
213213
// the dstTexture so we'll create a texture where we supply
214214
// all of the data in JavaScript.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ bytes in copy works for every format.
14231423
)
14241424
.beforeAllSubcases(t => {
14251425
const info = kTextureFormatInfo[t.params.format];
1426-
t.skipIfTextureFormatNotSupported(t.params.format);
1426+
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
14271427
t.selectDeviceOrSkipTestCase(info.feature);
14281428
})
14291429
.fn(t => {
@@ -1538,7 +1538,7 @@ works for every format with 2d and 2d-array textures.
15381538
)
15391539
.beforeAllSubcases(t => {
15401540
const info = kTextureFormatInfo[t.params.format];
1541-
t.skipIfTextureFormatNotSupported(t.params.format);
1541+
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
15421542
t.selectDeviceOrSkipTestCase(info.feature);
15431543
})
15441544
.fn(t => {
@@ -1636,7 +1636,7 @@ for all formats. We pass origin and copyExtent as [number, number, number].`
16361636
)
16371637
.beforeAllSubcases(t => {
16381638
const info = kTextureFormatInfo[t.params.format];
1639-
t.skipIfTextureFormatNotSupported(t.params.format);
1639+
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
16401640
t.selectDeviceOrSkipTestCase(info.feature);
16411641
})
16421642
.fn(t => {
@@ -1836,7 +1836,7 @@ TODO: Make a variant for depth-stencil formats.
18361836
)
18371837
.beforeAllSubcases(t => {
18381838
const info = kTextureFormatInfo[t.params.format];
1839-
t.skipIfTextureFormatNotSupported(t.params.format);
1839+
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
18401840
t.selectDeviceOrSkipTestCase(info.feature);
18411841
})
18421842
.fn(t => {

src/webgpu/api/operation/render_pass/storeOp.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ g.test('render_pass_store_op,color_attachment_only')
151151
.combine('arrayLayer', kArrayLayers)
152152
)
153153
.beforeAllSubcases(t => {
154-
t.skipIfTextureFormatNotSupported(t.params.colorFormat);
154+
t.skipIfTextureFormatNotSupportedDeprecated(t.params.colorFormat);
155155
})
156156
.fn(t => {
157157
const colorAttachment = t.createTextureTracked({

src/webgpu/api/operation/render_pipeline/pipeline_output_targets.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ g.test('color,attachments')
5757
)
5858
.beforeAllSubcases(t => {
5959
const info = kTextureFormatInfo[t.params.format];
60-
t.skipIfTextureFormatNotSupported(t.params.format);
60+
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
6161
t.selectDeviceOrSkipTestCase(info.feature);
6262
})
6363
.fn(t => {
@@ -159,7 +159,7 @@ g.test('color,component_count')
159159
)
160160
.beforeAllSubcases(t => {
161161
const info = kTextureFormatInfo[t.params.format];
162-
t.skipIfTextureFormatNotSupported(t.params.format);
162+
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
163163
t.selectDeviceOrSkipTestCase(info.feature);
164164
})
165165
.fn(t => {

src/webgpu/api/operation/rendering/color_target_state.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ g.test('blending,formats')
393393
.combine('format', kBlendableFormats)
394394
)
395395
.beforeAllSubcases(t => {
396-
t.skipIfTextureFormatNotSupported(t.params.format);
396+
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
397397
})
398398
.fn(t => {
399399
const { format } = t.params;

src/webgpu/api/operation/resource_init/texture_zero.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ TODO:
99

1010
import { makeTestGroup } from '../../../../common/framework/test_group.js';
1111
import { unreachable } from '../../../../common/util/util.js';
12-
import { isMultisampledTextureFormat, kTextureFormatInfo } from '../../../format_info.js';
12+
import { isMultisampledTextureFormatDeprecated, kTextureFormatInfo } from '../../../format_info.js';
1313

1414
import { checkContentsByBufferCopy, checkContentsByTextureCopy } from './check_texture/by_copy.js';
1515
import {
@@ -42,12 +42,13 @@ export const g = makeTestGroup(TextureZeroInitTest);
4242
g.test('uninitialized_texture_is_zero')
4343
.params(kTestParams)
4444
.beforeAllSubcases(t => {
45-
t.skipIfTextureFormatNotSupported(t.params.format);
45+
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
4646
t.selectDeviceOrSkipTestCase(kTextureFormatInfo[t.params.format].feature);
4747
})
4848
.fn(t => {
4949
t.skipIf(
50-
t.params.sampleCount > 1 && !isMultisampledTextureFormat(t.params.format, t.isCompatibility)
50+
t.params.sampleCount > 1 &&
51+
!isMultisampledTextureFormatDeprecated(t.params.format, t.isCompatibility)
5152
);
5253

5354
const usage = getRequiredTextureUsage(

0 commit comments

Comments
 (0)