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)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 27 Apr 2017 15:34:57 +0000 (08:34 -0700)
commita3a25c40d420a029038a7748bc3db1bb9552a62d
tree68ff8952e80f66c567ff2e92d893bd9033389ab8
parentf9500046c890bbb03234117290f1924c39e95794
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