-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conversion from rgba to rg8unorm should copy correct pixel values
https://bugs.webkit.org/show_bug.cgi?id=270558 rdar://123810638 Reviewed by Mike Wyrzykowski. * LayoutTests/fast/webgpu/conversion-to-rg8unorm-expected.txt: Added. * LayoutTests/fast/webgpu/conversion-to-rg8unorm.html: Added. * Source/WebCore/Modules/WebGPU/GPUQueue.cpp: (WebCore::copyToDestinationFormat): Canonical link: https://commits.webkit.org/275738@main
- Loading branch information
1 parent
efc0277
commit 4e0d0a1
Showing
3 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This test passes if it does not crash. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<script> | ||
if (window.testRunner) { testRunner.dumpAsText(); testRunner.waitUntilDone() } | ||
onload = async () => { | ||
try { | ||
let adapter0 = await navigator.gpu.requestAdapter( | ||
{ | ||
} | ||
); | ||
|
||
let device0 = await adapter0.requestDevice( | ||
{ | ||
label: 'a', | ||
requiredFeatures: [ | ||
'depth-clip-control', | ||
'texture-compression-etc2', | ||
'texture-compression-astc', | ||
'indirect-first-instance', | ||
'shader-f16', | ||
'rg11b10ufloat-renderable', | ||
'bgra8unorm-storage' | ||
], | ||
requiredLimits: { | ||
maxVertexAttributes: 23, | ||
maxVertexBufferArrayStride: 46861, | ||
maxStorageTexturesPerShaderStage: 33, | ||
maxBindingsPerBindGroup: 1499, | ||
}, | ||
} | ||
); | ||
|
||
let canvas0 = document.createElement('canvas'); | ||
let imageBitMap0 = await createImageBitmap(canvas0); | ||
|
||
let videoFrame1 = new VideoFrame(imageBitMap0, {timestamp: 0}); | ||
|
||
let texture0 = device0.createTexture( | ||
{ | ||
label: 'a', | ||
size: { | ||
width: 373, | ||
depthOrArrayLayers: 1, | ||
}, | ||
mipLevelCount: 6, | ||
sampleCount: 1, | ||
format: 'rg8unorm', | ||
usage: GPUTextureUsage.STORAGE_BINDING | GPUTextureUsage.RENDER_ATTACHMENT, | ||
} | ||
); | ||
|
||
device0.queue.copyExternalImageToTexture( | ||
{ | ||
source: videoFrame1, | ||
origin: { | ||
x: 2707, | ||
y: 4310, | ||
}, | ||
}, | ||
{ | ||
texture: texture0, | ||
mipLevel: 2591, | ||
origin: [ | ||
5319, | ||
466, | ||
9625, | ||
6005, | ||
622 | ||
], | ||
aspect: 'stencil-only', | ||
colorSpace: 'srgb', | ||
premultipliedAlpha: true, | ||
}, | ||
[ | ||
4191 | ||
] | ||
); | ||
} catch { } | ||
if (window.testRunner) { testRunner.notifyDone() } | ||
}; | ||
</script> | ||
This test passes if it does not crash. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters