cts
cts copied to clipboard
reftests: test more ways to write into canvas texture
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.
I don't remember why this was marked blocked, but I don't think it's blocked anymore. Changing to Open.
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)
- for format of [rgba8uorm, bgra8uorm, rgba16float]
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?
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.