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

[pull] main from gpuweb:main #79

Merged
merged 3 commits into from
Jan 24, 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
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,16 @@ function getPipelineDescriptor(
return;
}

const typedVec = interleaveFormat.includes('uint') ? 'vec4u' : 'vec4f';

const code = `
${getDescription(testValue, actualLimit, sampleCount, targets)}
@vertex fn vs() -> @builtin(position) vec4f {
return vec4f(0);
}

@fragment fn fs() -> @location(0) vec4f {
return vec4f(0);
@fragment fn fs() -> @location(0) ${typedVec} {
return ${typedVec}(0);
}
`;
const module = device.createShaderModule({ code });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ Parameters:
const calls: TextureCall<vec2>[] = generateTextureBuiltinInputs2D(50, {
method: samplePoints,
descriptor,
mipLevel: { num: texture.mipLevelCount, type: L },
hashInputs: [stage, format, samplePoints, C, L],
}).map(({ coords, mipLevel }) => {
return {
Expand Down
2 changes: 2 additions & 0 deletions src/webgpu/web_platform/canvas/configure.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ g.test('format')
)
.beforeAllSubcases(t => {
t.selectDeviceForTextureFormatOrSkipTestCase(t.params.format);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
})
.fn(t => {
const { canvasType, format } = t.params;
Expand Down Expand Up @@ -446,6 +447,7 @@ g.test('viewFormats')
)
)
.beforeAllSubcases(t => {
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
t.selectDeviceOrSkipTestCase([t.params.viewFormatFeature]);
})
.fn(t => {
Expand Down
16 changes: 16 additions & 0 deletions src/webgpu/web_platform/canvas/readbackFromWebGPUCanvas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ g.test('onscreenCanvas,snapshot')
.combine('colorSpace', kCanvasColorSpaces)
.combine('snapshotType', ['toDataURL', 'toBlob', 'imageBitmap'])
)
.beforeAllSubcases(t => {
// rgba16float may not be color-renderable in compat mode
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
})
.fn(async t => {
const canvas = initWebGPUCanvasContent(
t,
Expand Down Expand Up @@ -323,6 +327,10 @@ g.test('offscreenCanvas,snapshot')
.combine('colorSpace', kCanvasColorSpaces)
.combine('snapshotType', ['convertToBlob', 'transferToImageBitmap', 'imageBitmap'] as const)
)
.beforeAllSubcases(t => {
// rgba16float may not be color-renderable in compat mode
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
})
.fn(async t => {
const offscreenCanvas = initWebGPUCanvasContent(
t,
Expand Down Expand Up @@ -378,6 +386,10 @@ g.test('onscreenCanvas,uploadToWebGL')
.combine('webgl', ['webgl', 'webgl2'])
.combine('upload', ['texImage2D', 'texSubImage2D'])
)
.beforeAllSubcases(t => {
// rgba16float may not be color-renderable in compat mode
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
})
.fn(t => {
const { format, webgl, upload } = t.params;
const canvas = initWebGPUCanvasContent(t, format, t.params.alphaMode, 'srgb', 'onscreen');
Expand Down Expand Up @@ -459,6 +471,10 @@ g.test('drawTo2DCanvas')
.combine('webgpuCanvasType', kAllCanvasTypes)
.combine('canvas2DType', kAllCanvasTypes)
)
.beforeAllSubcases(t => {
// rgba16float may not be color-renderable in compat mode
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.format);
})
.fn(t => {
const { format, webgpuCanvasType, alphaMode, colorSpace, canvas2DType } = t.params;

Expand Down
2 changes: 2 additions & 0 deletions src/webgpu/web_platform/copyToTexture/ImageBitmap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ g.test('from_ImageData')
.beforeAllSubcases(t => {
t.skipIf(typeof ImageData === 'undefined', 'ImageData does not exist in this environment');
t.skipIfTextureFormatNotSupported(t.params.dstFormat);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.dstFormat);
})
.fn(async t => {
const {
Expand Down Expand Up @@ -182,6 +183,7 @@ g.test('from_canvas')
.beforeAllSubcases(t => {
t.skipIf(typeof ImageData === 'undefined', 'ImageData does not exist in this environment');
t.skipIfTextureFormatNotSupported(t.params.dstFormat);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.dstFormat);
})
.fn(async t => {
const {
Expand Down
1 change: 1 addition & 0 deletions src/webgpu/web_platform/copyToTexture/ImageData.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ g.test('from_ImageData')
.beforeAllSubcases(t => {
t.skipIf(typeof ImageData === 'undefined', 'ImageData does not exist in this environment');
t.skipIfTextureFormatNotSupported(t.params.dstColorFormat);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.dstColorFormat);
})
.fn(t => {
const { width, height, dstColorFormat, dstPremultiplied, srcDoFlipYDuringCopy } = t.params;
Expand Down
5 changes: 5 additions & 0 deletions src/webgpu/web_platform/copyToTexture/canvas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ g.test('copy_contents_from_2d_context_canvas')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.dstColorFormat);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.dstColorFormat);
})
.fn(t => {
const { width, height, canvasType, dstAlphaMode } = t.params;
Expand Down Expand Up @@ -559,6 +560,7 @@ g.test('copy_contents_from_gl_context_canvas')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.dstColorFormat);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.dstColorFormat);
})
.fn(t => {
const { width, height, canvasType, contextName, srcPremultiplied, dstAlphaMode } = t.params;
Expand Down Expand Up @@ -628,6 +630,7 @@ g.test('copy_contents_from_gpu_context_canvas')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.dstColorFormat);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.dstColorFormat);
t.selectMismatchedDeviceOrSkipTestCase(undefined);
})
.fn(t => {
Expand Down Expand Up @@ -694,6 +697,7 @@ g.test('copy_contents_from_bitmaprenderer_context_canvas')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.dstColorFormat);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.dstColorFormat);
})
.fn(async t => {
const { width, height, canvasType, dstAlphaMode } = t.params;
Expand Down Expand Up @@ -770,6 +774,7 @@ g.test('color_space_conversion')
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.dstColorFormat);
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.dstColorFormat);
})
.fn(t => {
const {
Expand Down
1 change: 1 addition & 0 deletions src/webgpu/web_platform/copyToTexture/image.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ g.test('from_image')
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotSupported(t.params.dstColorFormat);
if (typeof HTMLImageElement === 'undefined') t.skip('HTMLImageElement not available');
t.selectDeviceForRenderableColorFormatOrSkipTestCase(t.params.dstColorFormat);
})
.fn(async t => {
const { width, height, dstColorFormat, dstPremultiplied, srcDoFlipYDuringCopy } = t.params;
Expand Down
Loading