Improve image logging in some renderpass tests
authorRicardo Garcia <rgarcia@igalia.com>
Tue, 7 Apr 2020 16:11:01 +0000 (18:11 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 17 Apr 2020 09:15:36 +0000 (05:15 -0400)
commit3c12deb6000947c6a94809c99cd4ae68e1839262
tree4b168c3070f021d6c5ac84b9ae1d3d3003a2a854
parent2a934fc35e1ceb9e53144501dac7bbf3d21e2528
Improve image logging in some renderpass tests

Some renderpass tests have a reference buffer where some of the "pixel
components" are set to have a boolean value and some of them are left unset
(this means 3 possible values: unset, set to false, set to true). When writing
to real images in a variety of formats, they store either 0.0 (for "false") or
1.0 (for "true"), no matter the actual pixel format because it works in any
case. But when logging those images, they are translated to RGBA8 PNG format
using the logging facilities, which do not adapt well to this case.

In particular, unnormalized formats have their component value ranges checked
dynamically and adapted to an approximation if needed, which sometimes means
the reference image and the output image look nothing like each other even when
the test passes.

This commit does a small image color translation for both the result image and
the reference buffer only for the purpose of logging, without affecting the
tests themselves. All images are transformed to RGBA8, unsigned
normalized format prior to logging. Unset component values are
translated to a 3x3 grid with values 0.0 and 0.25, component values set
to false are translated to 0.5 and component values set to true are
translated to 1.0, providing clear visual separation between all 3
possibilities while unifying the representation of the reference buffer
and the output image.

In addition, to minimize the cost of that translation and reducing CPU impact
in general, this commit stops logging images when tests pass.

No test results should be affected by these changes.

Affected tests:
dEQP-VK.renderpass*.*allocation.simple.*
dEQP-VK.renderpass*.*allocation.formats.*
dEQP-VK.renderpass*.*allocation.attachment.*
dEQP-VK.renderpass*.*allocation.attachment_allocation.*
dEQP-VK.renderpass*.*allocation.attachment_write_mask.*

Components: Vulkan
VK-GL-CTS issue: 2299

Change-Id: I1f85b7576de7987ab980555ad095064208164a33
external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp