Closed Bug 1677183 Opened 4 years ago Closed 2 years ago

Implement Queue.copyImageBitmapToTexture in WebGPU

Categories

(Core :: Graphics: WebGPU, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: kvark, Assigned: aosmond, NeedInfo)

References

Details

Attachments

(1 file)

See https://gpuweb.github.io/gpuweb/#dom-gpuqueue-copyimagebitmaptotexture

This is required to run the textured-cube WebGPU example.

Related to our ability to flip Y

See Also: → 1367251
Blocks: 1710678
Assignee: nobody → aosmond
Blocks: webgpu-in-nightly
No longer blocks: webgpu-mvp
See Also: → 1769591
Attachment #9274712 - Attachment description: Bug 1677183 - Implement WebGPU's Queue.copyExternalImageToTexture. → Bug 1677183 - Implement WebGPU's Queue.copyExternalImageToTexture. r=jgilbert

Here's what I ended up thinking about CORS:

Only DOM element objects have CORS.
Both DOM element objects and non-DOM objects have "origin-clean" flags.
In Gecko, we implement origin-clean via isWriteOnly, where origin-clean IFF !isWriteOnly.

See
https://html.spec.whatwg.org/multipage/canvas.html#the-image-argument-is-not-origin-clean for how CORS becomes origin-clean = false.

See https://html.spec.whatwg.org/multipage/canvas.html#security-with-canvas-elements for how this propagates.

In particular:

All bitmaps start with their origin-clean set to true. The flag is set to false when cross-origin images are used.

The value of the origin-clean flag is propagated from a source canvas element's bitmap to a new ImageBitmap object by createImageBitmap(). Conversely, a destination canvas element's bitmap will have its origin-clean flags set to false by drawImage if the source image is an ImageBitmap object whose bitmap has its origin-clean flag set to false.

I think we might have some of our CORS checks wrong, but I want to think more about it. But this is unblocked and good to land.

Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4e76508f9136
Implement WebGPU's Queue.copyExternalImageToTexture. r=jgilbert,jimb,emilio

Backed out for causing mochitest failures on test_queue_copyExternalImageToTexture.html

Backout link

Push with failures

Failure log 1 // Failure log 2

Flags: needinfo?(aosmond)
Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/746fbd28a600
Implement WebGPU's Queue.copyExternalImageToTexture. r=jgilbert,jimb,emilio
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
Regressions: 1785863
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: