Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename deprecated texture info functions and add new ones. #4192

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/common/framework/test_config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { assert } from '../util/util.js';

export type TestConfig = {
/**
* Enable debug-level logs (normally logged via `Fixture.debug()`).
Expand Down Expand Up @@ -67,3 +69,14 @@ export const globalTestConfig: TestConfig = {
enforceDefaultLimits: false,
logToWebSocket: false,
};

// Check if a device is a compatibility device.
// Note: The CTS generally, requires that if globalTestConfig.compatibility
// is true then the device MUST be a compatibility device since the CTS
// is trying to test that compatibility devices have the correct validation.
export function isCompatibilityDevice(device: GPUDevice) {
if (globalTestConfig.compatibility) {
assert(!device.features.has('webgpu-core'));
}
return globalTestConfig.compatibility;
}
220 changes: 110 additions & 110 deletions src/resources/cache/hashes.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
DepthStencilFormat,
ColorTextureFormat,
isCompressedTextureFormat,
viewCompatible,
viewCompatibleDeprecated,
RegularTextureFormat,
isRegularTextureFormat,
} from '../../../format_info.js';
Expand Down Expand Up @@ -80,7 +80,7 @@ class F extends TextureTestMixin(GPUTest) {
srcCopyLevel: number,
dstCopyLevel: number
): void {
this.skipIfTextureFormatNotSupported(srcFormat, dstFormat);
this.skipIfTextureFormatNotSupportedDeprecated(srcFormat, dstFormat);

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

if (isCompressedTextureFormat(dstTexture.format) && this.isCompatibility) {
assert(viewCompatible(this.isCompatibility, srcFormat, dstFormat));
assert(viewCompatibleDeprecated(this.isCompatibility, srcFormat, dstFormat));
// compare by rendering. We need the expected texture to match
// the dstTexture so we'll create a texture where we supply
// all of the data in JavaScript.
Expand Down
8 changes: 4 additions & 4 deletions src/webgpu/api/operation/command_buffer/image_copy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,7 @@ bytes in copy works for every format.
)
.beforeAllSubcases(t => {
const info = kTextureFormatInfo[t.params.format];
t.skipIfTextureFormatNotSupported(t.params.format);
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
t.selectDeviceOrSkipTestCase(info.feature);
})
.fn(t => {
Expand Down Expand Up @@ -1538,7 +1538,7 @@ works for every format with 2d and 2d-array textures.
)
.beforeAllSubcases(t => {
const info = kTextureFormatInfo[t.params.format];
t.skipIfTextureFormatNotSupported(t.params.format);
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
t.selectDeviceOrSkipTestCase(info.feature);
})
.fn(t => {
Expand Down Expand Up @@ -1636,7 +1636,7 @@ for all formats. We pass origin and copyExtent as [number, number, number].`
)
.beforeAllSubcases(t => {
const info = kTextureFormatInfo[t.params.format];
t.skipIfTextureFormatNotSupported(t.params.format);
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
t.selectDeviceOrSkipTestCase(info.feature);
})
.fn(t => {
Expand Down Expand Up @@ -1836,7 +1836,7 @@ TODO: Make a variant for depth-stencil formats.
)
.beforeAllSubcases(t => {
const info = kTextureFormatInfo[t.params.format];
t.skipIfTextureFormatNotSupported(t.params.format);
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
t.selectDeviceOrSkipTestCase(info.feature);
})
.fn(t => {
Expand Down
2 changes: 1 addition & 1 deletion src/webgpu/api/operation/render_pass/storeOp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ g.test('render_pass_store_op,color_attachment_only')
.combine('arrayLayer', kArrayLayers)
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.colorFormat);
t.skipIfTextureFormatNotSupportedDeprecated(t.params.colorFormat);
})
.fn(t => {
const colorAttachment = t.createTextureTracked({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ g.test('color,attachments')
)
.beforeAllSubcases(t => {
const info = kTextureFormatInfo[t.params.format];
t.skipIfTextureFormatNotSupported(t.params.format);
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
t.selectDeviceOrSkipTestCase(info.feature);
})
.fn(t => {
Expand Down Expand Up @@ -159,7 +159,7 @@ g.test('color,component_count')
)
.beforeAllSubcases(t => {
const info = kTextureFormatInfo[t.params.format];
t.skipIfTextureFormatNotSupported(t.params.format);
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
t.selectDeviceOrSkipTestCase(info.feature);
})
.fn(t => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ g.test('blending,formats')
.combine('format', kBlendableFormats)
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
})
.fn(t => {
const { format } = t.params;
Expand Down
7 changes: 4 additions & 3 deletions src/webgpu/api/operation/resource_init/texture_zero.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TODO:

import { makeTestGroup } from '../../../../common/framework/test_group.js';
import { unreachable } from '../../../../common/util/util.js';
import { isMultisampledTextureFormat, kTextureFormatInfo } from '../../../format_info.js';
import { isMultisampledTextureFormatDeprecated, kTextureFormatInfo } from '../../../format_info.js';

import { checkContentsByBufferCopy, checkContentsByTextureCopy } from './check_texture/by_copy.js';
import {
Expand Down Expand Up @@ -42,12 +42,13 @@ export const g = makeTestGroup(TextureZeroInitTest);
g.test('uninitialized_texture_is_zero')
.params(kTestParams)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.format);
t.skipIfTextureFormatNotSupportedDeprecated(t.params.format);
t.selectDeviceOrSkipTestCase(kTextureFormatInfo[t.params.format].feature);
})
.fn(t => {
t.skipIf(
t.params.sampleCount > 1 && !isMultisampledTextureFormat(t.params.format, t.isCompatibility)
t.params.sampleCount > 1 &&
!isMultisampledTextureFormatDeprecated(t.params.format, t.isCompatibility)
);

const usage = getRequiredTextureUsage(
Expand Down
Loading