Skip to content

need more ImageBitmap copyExternalImageToTexture tests? #4391

@greggman

Description

@greggman

three.js recently ran into this issue

The symptom was that Chrome and Safari rendered differently. That appears to be a bug in Safari. But, tracking it down they were using this png file

png

It has both a gAMA chunk and a cHRM chunk. In WebGL it appears possible to load this file ignoring those chunks. In WebGPU, even using createImageBitmap(..., { colorSpaceConversion: 'none'}) one of the chunks is always applied.

If that's intentional then I guess there is nothing to do, though it means some files that can be loaded in WebGL can not be loaded into WebGPU unless you include you own image decoder.

If it's not intentional we probably need some tests.

The Safari issue also could maybe use a test here as well. It turned out, calling device.queue.copyExternalImageToTexture inside an image's addEventListener(load, ...) event produced different results than outside. It also was affected by internal caches. If you load the image once and use it outside of the callback event (like await for image.decode()), then if you later use it via addEventListener you get a different result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions