gpuweb / cts

WebGPU Conformance Test Suite
https://gpuweb.github.io/cts/
BSD 3-Clause "New" or "Revised" License
124 stars 77 forks source link

web_platform: copyExternalImageToTexture with more source types (PNG, ImageData) with color spaces #1476

Open kainino0x opened 2 years ago

kainino0x commented 2 years ago

Followup to #913.

The PNG tests in particular are important because they should have wider browser support than ImageData's colorSpace option.

Here are some test images: https://bugs.chromium.org/p/dawn/issues/detail?id=1139#c8 I took the WebKit test image and cropped it to 1x1 in GIMP. Source: https://webkit.org/blog-files/color-gamut/

Verified they display as expected on my MacBook (displayp3 is brighter than the other two).

We can test all three of these. The displayp3 red should be > 1, the others should be == 1.

kainino0x commented 1 year ago

Edited summary above to add that we need to test high bit depth images as well.

kainino0x commented 1 year ago

Here's a python script for generating test images. It has a few basic examples in it. https://github.com/kainino0x/wide-color-test-images

kainino0x commented 4 months ago

Also added HDR to the list above.

The test case I have in mind is a simple case similar to the 10bpc one I added to WebGL, but with 16 red pixels:

[[   0    1    2    3]
 [1020 1021 1022 1023]
 [1024 1025 1026 1027]
 [and 4 values leading up to the max brightness of the encoding]]
where SDR 1.0 = 1023

with added checks to make sure that the values are in the right range (not just that there are enough distinct values, like in the 10bpc test).