Skip to content

Commit

Permalink
Merge branch 'gpuweb:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
hmallen99 authored Oct 15, 2024
2 parents b977ae1 + bca9099 commit a4dda98
Show file tree
Hide file tree
Showing 21 changed files with 4,417 additions and 1,052 deletions.
17 changes: 9 additions & 8 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@types/webpack-env": "^1.18.5",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"@webgpu/types": "^0.1.46",
"@webgpu/types": "^0.1.48",
"ansi-colors": "4.1.3",
"babel-jest": "^29.6.3",
"babel-plugin-add-header-comment": "^1.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Tests for capability checking for features enabling optional texture formats.
import { makeTestGroup } from '../../../../../common/framework/test_group.js';
import { getGPU } from '../../../../../common/util/navigator_gpu.js';
import { assert } from '../../../../../common/util/util.js';
import { kCanvasTextureFormats } from '../../../../capability_info.js';
import { kAllTextureFormats, kTextureFormatInfo } from '../../../../format_info.js';
import { kAllCanvasTypes, createCanvas } from '../../../../util/create_elements.js';
import { ValidationTest } from '../../validation_test.js';
Expand Down Expand Up @@ -161,15 +162,15 @@ g.test('canvas_configuration')
usage: GPUTextureUsage.COPY_SRC | GPUTextureUsage.COPY_DST,
};

if (enable_required_feature) {
t.expectValidationError(() => {
ctx.configure(canvasConf);
});
} else {
t.shouldThrow('TypeError', () => {
ctx.configure(canvasConf);
});
}
const expectedError =
enable_required_feature &&
(kCanvasTextureFormats as unknown as Array<GPUTextureFormat>).includes(format)
? false
: 'TypeError';

t.shouldThrow(expectedError, () => {
ctx.configure(canvasConf);
});
});

g.test('canvas_configuration_view_formats')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,21 @@ g.test('subresources,color_attachment_and_bind_group')
{ bgLayer: 0, bgLayerCount: 1 },
{ bgLayer: 1, bgLayerCount: 1 },
{ bgLayer: 1, bgLayerCount: 2 },
{ bgLayer: 0, bgLayerCount: kTextureLayers },
])
.combine('bgUsage', kTextureBindingTypes)
.unless(t => t.bgUsage !== 'sampled-texture' && t.bgLevelCount > 1)
.combine('inSamePass', [true, false])
)
.beforeAllSubcases(t => {
if (t.isCompatibility) {
t.skipIf(t.params.bgLayer !== 0, 'view base array layer must equal 0 in compatibility mode');
t.skipIf(
t.params.bgLayerCount !== kTextureLayers,
'view array layers must equal texture array layers in compatibility mode'
);
}
})
.fn(t => {
const {
colorAttachmentLevel,
Expand Down Expand Up @@ -288,13 +298,23 @@ g.test('subresources,depth_stencil_attachment_and_bind_group')
{ bgLayer: 0, bgLayerCount: 1 },
{ bgLayer: 1, bgLayerCount: 1 },
{ bgLayer: 1, bgLayerCount: 2 },
{ bgLayer: 0, bgLayerCount: kTextureLayers },
])
.beginSubcases()
.combine('depthReadOnly', [true, false])
.combine('stencilReadOnly', [true, false])
.combine('bgAspect', ['depth-only', 'stencil-only'] as const)
.combine('inSamePass', [true, false])
)
.beforeAllSubcases(t => {
if (t.isCompatibility) {
t.skipIf(t.params.bgLayer !== 0, 'view base array layer must equal 0 in compatibility mode');
t.skipIf(
t.params.bgLayerCount !== kTextureLayers,
'view array layers must equal texture array layers in compatibility mode'
);
}
})
.fn(t => {
const {
dsLevel,
Expand Down Expand Up @@ -411,6 +431,7 @@ g.test('subresources,multiple_bind_groups')
{ base: 0, count: 1 },
{ base: 1, count: 1 },
{ base: 1, count: 2 },
{ base: 0, count: kTextureLayers },
])
.combine('bg1Levels', [
{ base: 0, count: 1 },
Expand All @@ -421,6 +442,7 @@ g.test('subresources,multiple_bind_groups')
{ base: 0, count: 1 },
{ base: 1, count: 1 },
{ base: 1, count: 2 },
{ base: 0, count: kTextureLayers },
])
.combine('bgUsage0', kTextureBindingTypes)
.combine('bgUsage1', kTextureBindingTypes)
Expand All @@ -432,6 +454,18 @@ g.test('subresources,multiple_bind_groups')
.beginSubcases()
.combine('inSamePass', [true, false])
)
.beforeAllSubcases(t => {
if (t.isCompatibility) {
t.skipIf(
t.params.bg0Layers.base !== 0 || t.params.bg1Layers.base !== 0,
'view base array layer must equal 0 in compatibility mode'
);
t.skipIf(
t.params.bg0Layers.count !== kTextureLayers || t.params.bg1Layers.count !== kTextureLayers,
'view array layers must equal texture array layers in compatibility mode'
);
}
})
.fn(t => {
const { bg0Levels, bg0Layers, bg1Levels, bg1Layers, bgUsage0, bgUsage1, inSamePass } = t.params;

Expand Down Expand Up @@ -524,6 +558,7 @@ g.test('subresources,depth_stencil_texture_in_bind_groups')
{ base: 0, count: 1 },
{ base: 1, count: 1 },
{ base: 1, count: 2 },
{ base: 0, count: kTextureLayers },
])
.combine('view1Levels', [
{ base: 0, count: 1 },
Expand All @@ -534,11 +569,25 @@ g.test('subresources,depth_stencil_texture_in_bind_groups')
{ base: 0, count: 1 },
{ base: 1, count: 1 },
{ base: 1, count: 2 },
{ base: 0, count: kTextureLayers },
])
.combine('aspect0', ['depth-only', 'stencil-only'] as const)
.combine('aspect1', ['depth-only', 'stencil-only'] as const)
.combine('inSamePass', [true, false])
)
.beforeAllSubcases(t => {
if (t.isCompatibility) {
t.skipIf(
t.params.view0Layers.base !== 0 || t.params.view1Layers.base !== 0,
'view base array layer must equal 0 in compatibility mode'
);
t.skipIf(
t.params.view0Layers.count !== kTextureLayers ||
t.params.view1Layers.count !== kTextureLayers,
'view array layers must equal texture array layers in compatibility mode'
);
}
})
.fn(t => {
const { view0Levels, view0Layers, view1Levels, view1Layers, aspect0, aspect1, inSamePass } =
t.params;
Expand Down
5 changes: 2 additions & 3 deletions src/webgpu/listing_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,6 @@
"webgpu:shader,execution,expression,call,builtin,textureSample:depth_array_2d_coords:*": { "subcaseMS": 92.601 },
"webgpu:shader,execution,expression,call,builtin,textureSample:depth_array_3d_coords:*": { "subcaseMS": 20.301 },
"webgpu:shader,execution,expression,call,builtin,textureSample:sampled_1d_coords:*": { "subcaseMS": 1.200 },
"webgpu:shader,execution,expression,call,builtin,textureSample:sampled_2d_coords,derivatives:*": { "subcaseMS": 0.091 },
"webgpu:shader,execution,expression,call,builtin,textureSample:sampled_2d_coords:*": { "subcaseMS": 12.500 },
"webgpu:shader,execution,expression,call,builtin,textureSample:sampled_3d_coords:*": { "subcaseMS": 36.002 },
"webgpu:shader,execution,expression,call,builtin,textureSample:sampled_array_2d_coords:*": { "subcaseMS": 92.500 },
Expand All @@ -1612,8 +1611,6 @@
"webgpu:shader,execution,expression,call,builtin,textureSampleCompareLevel:3d_coords:*": { "subcaseMS": 10.301 },
"webgpu:shader,execution,expression,call,builtin,textureSampleCompareLevel:arrayed_2d_coords:*": { "subcaseMS": 705.100 },
"webgpu:shader,execution,expression,call,builtin,textureSampleCompareLevel:arrayed_3d_coords:*": { "subcaseMS": 622.700 },
"webgpu:shader,execution,expression,call,builtin,textureSampleCompareLevel:control_flow:*": { "subcaseMS": 2.202 },
"webgpu:shader,execution,expression,call,builtin,textureSampleCompareLevel:stage:*": { "subcaseMS": 7.901 },
"webgpu:shader,execution,expression,call,builtin,textureSampleGrad:sampled_2d_coords:*": { "subcaseMS": 82.401 },
"webgpu:shader,execution,expression,call,builtin,textureSampleGrad:sampled_3d_coords:*": { "subcaseMS": 309.101 },
"webgpu:shader,execution,expression,call,builtin,textureSampleGrad:sampled_array_2d_coords:*": { "subcaseMS": 352.900 },
Expand Down Expand Up @@ -1864,6 +1861,8 @@
"webgpu:shader,execution,padding:array_of_matCx3:*": { "subcaseMS": 8.650 },
"webgpu:shader,execution,padding:array_of_struct:*": { "subcaseMS": 5.801 },
"webgpu:shader,execution,padding:array_of_vec3:*": { "subcaseMS": 10.500 },
"webgpu:shader,execution,padding:array_of_vec3h,elementwise:*": { "subcaseMS": 24.607 },
"webgpu:shader,execution,padding:array_of_vec3h:*": { "subcaseMS": 26.941 },
"webgpu:shader,execution,padding:matCx3:*": { "subcaseMS": 10.050 },
"webgpu:shader,execution,padding:struct_explicit:*": { "subcaseMS": 12.000 },
"webgpu:shader,execution,padding:struct_implicit:*": { "subcaseMS": 33.201 },
Expand Down
Loading

0 comments on commit a4dda98

Please sign in to comment.