dEQP-VK: Fix and inline the Image::getPixelOffset helper
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 27 Apr 2017 15:02:22 +0000 (08:02 -0700)
committerPyry Haulos <phaulos@google.com>
Wed, 3 May 2017 17:47:06 +0000 (10:47 -0700)
commit5e1fb53c166f5145e8a68aa96da9d16fcde7a30d
tree9b1cfe3764993db8e9787ca71e914c3da8321324
parentbce45b549d21f068a75d005fe55bd87460b5df29
dEQP-VK: Fix and inline the Image::getPixelOffset helper

The helper was wrong in a number of ways.  First, it tries to calculate
an offset to the particular mip level and array layer requested even
though the driver already provides that as part of the offset returned
by getImageSubresourceLayout.  If someone tried to use this with a
non-zero mip level or array layer they would get the wrong offset
because it would be added in twice.  Second, the calculation depended on
an array called mipLevelRectSizes array which was used but never
initialized.  This commit gets rid of the helper and just does the right
calculation inside MemoryOp::readLinear and MemoryOp::uploadLinear.

This affects the following groups of tests:

 - dEQP-VK.draw.*
 - dEQP-VK.dynamic_state.*
 - dEQP-VK.query_pool.*

Change-Id: If0da72023cbc437d2a13d60f83e1230f0f90ba39
external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.cpp
external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.hpp