Implementations can use more samples than requested
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 10 Jan 2018 11:16:04 +0000 (12:16 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 31 Jan 2018 10:00:07 +0000 (05:00 -0500)
commit2cb743a59becace2c1118015689c5ea2859764cf
treeeedcd6f1d8c65444d68fc2213778f0d21477409f
parent8f95ea871c70f42909bda3787a4a3af4abcdaebe
Implementations can use more samples than requested

KHR-GL45.copy_image.samples_mismatch tests that
implementations produce an error when attempting to
copy between images with different sample counts,
however, it relies on the hardware always allocating
exactly the number of samples requested, which may
not happen, since according to the spec for
glTexImage*Multisample:

   "samples represents a request for a desired minimum
    number of samples. Since different implementations
    may support different sample counts for multi-
    sampled textures, the actual number of samples
    allocated for the texture image is implementation
    dependent."

Since the test doesn't account for this, it can end
up expecting an error for the case where it requested
two textures with different sample counts but the
implementation ended up rounding one of them up to the
same number of samples used by the other one, in which
case the Copy operation will not produce an error any
more.

This patch fixes this by checking the actual sample
counts allocated for each texture and adjusting the
test expectation based on that.

Components: OpenGL

VK-GL-CTS issue: 932

Affects:
KHR-GL45.copy_image.samples_mismatch
KHR-GL46.copy_image.samples_mismatch

Change-Id: Idc1ce3026cbaae09cc65dc5194dd26f9bcddea0f
external/openglcts/modules/gl/gl4cCopyImageTests.cpp