| 176 | } |
| 177 | |
| 178 | VkDeviceSize computeImageDataSize(VkFormat format, VkExtent3D extent) |
| 179 | { |
| 180 | const VltFormatInfo* formatInfo = imageFormatInfo(format); |
| 181 | |
| 182 | VkDeviceSize size = 0; |
| 183 | |
| 184 | for (auto aspects = formatInfo->aspectMask; aspects;) |
| 185 | { |
| 186 | auto aspect = getNextAspect(aspects); |
| 187 | auto elementSize = formatInfo->elementSize; |
| 188 | auto planeExtent = extent; |
| 189 | |
| 190 | if (formatInfo->flags.test(VltFormatFlag::MultiPlane)) |
| 191 | { |
| 192 | auto plane = &formatInfo->planes[getPlaneIndex(aspect)]; |
| 193 | planeExtent.width /= plane->blockSize.width; |
| 194 | planeExtent.height /= plane->blockSize.height; |
| 195 | elementSize = plane->elementSize; |
| 196 | } |
| 197 | |
| 198 | size += elementSize * flattenImageExtent(computeBlockCount(planeExtent, formatInfo->blockSize)); |
| 199 | } |
| 200 | |
| 201 | return size; |
| 202 | } |
| 203 | |
| 204 | static VkColorComponentFlags remapComponentFlag( |
| 205 | VkColorComponentFlags mask, |
no test coverage detected