KhronosGroup / OpenCL-CTS

The OpenCL Conformance Tests
Apache License 2.0
185 stars 198 forks source link

The channel count of "sRGBx" is 4? #1110

Open luoanquan opened 3 years ago

luoanquan commented 3 years ago

https://github.com/KhronosGroup/OpenCL-CTS/blob/0d74b3f926e547b2ae6d13de55b16aa5a6711265/test_common/harness/imageHelpers.cpp#L147

luoanquan commented 3 years ago
As the spec, CL_sRGBx is a four channel image format, where the three channels represent RED, GREEN, and BLUE components in the sRGB color space. The fourth channel is ignored. The channel count of "sRGBx" is 4?
jlewis-austin commented 3 years ago

I agree that from a storage perspective and spec definition both CL_sRGBx and CL_RGBx should be 4 channels. The helper get_pixel_bytes() depends on the channel count, and would be wrong for both formats. Are you seeing test failures due to this?

One think to keep in mind if changing it would be that some validation code could possibly be depending on that count to figure out which channels to pay attention to.

bashbaug commented 3 years ago

I see both usages in my quick grep through the CTS tests: some places use the "channel count" to determine storage requirements and other places use the "channel count" to determine how much data to verify.

If we want to fix this we'll need to separate out the two usages, otherwise changing from 3 to 4 will fix one class of bugs only to cause another.