Skip to content

Commit

Permalink
Fix bgra8unorm storage handling
Browse files Browse the repository at this point in the history
Related to gpuweb#3847

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/gpuweb/cts/issues/3847?shareId=XXXX-XXXX-XXXX-XXXX).
  • Loading branch information
wailin247 committed Nov 19, 2024
1 parent 467c899 commit be96537
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/webgpu/api/operation/storage_texture/read_only.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ g.test('basic')
t.selectDeviceOrSkipTestCase('bgra8unorm-storage');
}
if (t.isCompatibility) {
t.skipIfTextureFormatNotUsableAsStorageTexture(t.params.format);
t.skipIfTextureFormatNotUsableAsStorageTexture(t.params.format, t.device);
}
})
.fn(t => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ g.test('basic')
.unless(p => p.textureDimension === '1d' && p.depthOrArrayLayers > 1)
)
.beforeAllSubcases(t => {
t.skipIfTextureFormatNotUsableAsStorageTexture(t.params.format);
t.skipIfTextureFormatNotUsableAsStorageTexture(t.params.format, t.device);
})
.fn(t => {
const { format, shaderStage, textureDimension, depthOrArrayLayers } = t.params;
Expand Down
6 changes: 6 additions & 0 deletions src/webgpu/api/validation/texture/bgra8unorm_storage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ class BGRA8UnormStorageValidationTests extends ValidationTest {
});
}, !success);
}

skipIfTextureFormatNotUsableAsStorageTexture(format: GPUTextureFormat, device: GPUDevice): void {
if (format === 'bgra8unorm' && !device.features.has('bgra8unorm-storage')) {
this.skip('bgra8unorm-storage feature is not supported');
}
}
}

export const g = makeTestGroup(BGRA8UnormStorageValidationTests);
Expand Down

0 comments on commit be96537

Please sign in to comment.