cts icon indicating copy to clipboard operation
cts copied to clipboard

reftests: test more ways to write into canvas texture

Open kainino0x opened this issue 3 years ago • 3 comments

We need to test EVERY possible way you can write into a canvas texture and make sure the result shows up on the screen correctly. Ideally with as many texture formats as possible.

I think there are some paths that are supposed to work but Chromium doesn't support yet.

kainino0x avatar Jan 13 '22 02:01 kainino0x

I don't remember why this was marked blocked, but I don't think it's blocked anymore. Changing to Open.

kainino0x avatar Sep 30 '22 22:09 kainino0x

Is this a ref test or just a regular test?

Can you enumerate the tests?

Of the top of my head

  • for alphaMode of [opaque, premultiplied]
    • for format of [rgba8uorm, bgra8uorm, rgba16float]
      • for sampleCount of [1, 4] (do we need other sampleCounts)

Are there more? Maybe for colorSpace of [srgb, display-p3]? A canvas texture's usage is just RENDER_ATTACHMENT so it can't be mapped or copied to right?

greggman avatar Jan 05 '23 22:01 greggman

Sorry, the description wasn't very good. This was meant to be for ref tests about putting data into canvases via things like copies and storage. Canvas textures can indeed have other usages by specifying GPUCanvasConfiguration.usage. (They can't be mapped because textures aren't mappable.)

The reason for this is that we have to make sure that the canvas is signalled as being updated so the compositor will pick it up. The spec says we invalidate the canvas's compositing in getCurrentTexture anyway, not when the canvas is written, but it's still useful I think. Firefox had a bug around this where the canvas didn't get invalidated when copying into the texture.

On that note, one of the test cases here should juts call getCurrentTexture(), without writing the texture at all, which should still clear whatever was in the canvas before.

kainino0x avatar Jan 06 '23 23:01 kainino0x