Lines Matching defs:const
134 bool operator() (const Type& a, const Type& b) const
147 const deInt32 defaultSize = 64;
148 const deInt32 defaultHalfSize = defaultSize / 2;
149 const deInt32 defaultQuarterSize = defaultSize / 4;
150 const deInt32 defaultSixteenthSize = defaultSize / 16;
151 const deInt32 defaultQuarterSquaredSize = defaultQuarterSize * defaultQuarterSize;
152 const deUint32 defaultRootSize = static_cast<deUint32>(deSqrt(defaultSize));
153 const VkExtent3D defaultExtent = {defaultSize, defaultSize, 1};
154 const VkExtent3D defaultHalfExtent = {defaultHalfSize, defaultHalfSize, 1};
155 const VkExtent3D defaultQuarterExtent = {defaultQuarterSize, defaultQuarterSize, 1};
156 const VkExtent3D defaultRootExtent = {defaultRootSize, defaultRootSize, 1};
157 const VkExtent3D default1dExtent = {defaultSize, 1, 1};
158 const VkExtent3D default1dQuarterSquaredExtent = {defaultQuarterSquaredSize, 1, 1};
159 const VkExtent3D default3dExtent = {defaultQuarterSize, defaultQuarterSize, defaultQuarterSize};
160 const VkExtent3D default3dSmallExtent = {defaultSixteenthSize, defaultSixteenthSize, defaultSixteenthSize};
162 const VkImageSubresourceLayers defaultSourceLayer =
172 const VkImageCopy2KHR imageCopy2 =
175 DE_NULL, // const void* pNext;
186 const VkBufferCopy2KHR bufferCopy2 =
189 DE_NULL, // const void* pNext;
199 const VkBufferImageCopy2KHR bufferImageCopy2 =
202 DE_NULL, // const void* pNext;
215 const VkImageBlit2KHR imageBlit2 =
218 DE_NULL, // const void* pNext;
251 const VkImageResolve2KHR imageResolve2 =
254 DE_NULL, // const void* pNext;
401 de::MovePtr<Allocation> allocateBuffer (const InstanceInterface& vki,
402 const DeviceInterface& vkd,
403 const VkPhysicalDevice& physDevice,
404 const VkDevice device,
405 const VkBuffer& buffer,
406 const MemoryRequirement requirement,
414 const VkMemoryRequirements memoryRequirements = getBufferMemoryRequirements(vkd, device, buffer);
431 de::MovePtr<Allocation> allocateImage (const InstanceInterface& vki,
432 const DeviceInterface& vkd,
433 const VkPhysicalDevice& physDevice,
434 const VkDevice device,
435 const VkImage& image,
436 const MemoryRequirement requirement,
439 const deUint32 offset)
456 const VkMemoryDedicatedAllocateInfo dedicatedAllocationInfo =
459 DE_NULL, // const void* pNext
501 inline deUint32 getArraySize(const ImageParms& parms)
506 inline VkImageCreateFlags getCreateFlags(const ImageParms& parms)
514 inline VkExtent3D getExtent3D(const ImageParms& parms, deUint32 mipLevel = 0u)
516 const bool isCompressed = isCompressedFormat(parms.format);
517 const deUint32 blockWidth = (isCompressed) ? getBlockWidth(parms.format) : 1u;
518 const deUint32 blockHeight = (isCompressed) ? getBlockHeight(parms.format) : 1u;
523 const VkExtent3D extent =
532 const tcu::TextureFormat mapCombinedToDepthTransferFormat (const tcu::TextureFormat& combinedFormat)
563 const TestParams m_params;
576 void uploadBuffer (const tcu::ConstPixelBufferAccess& bufferAccess, const Allocation& bufferAlloc);
577 void uploadImage (const tcu::ConstPixelBufferAccess& src, VkImage dst, const ImageParms& parms, const deUint32 mipLevels = 1u);
580 deUint32 calculateSize (tcu::ConstPixelBufferAccess src) const
586 const ImageParms& imageParms,
587 const deUint32 mipLevel = 0u);
591 void uploadImageAspect (const tcu::ConstPixelBufferAccess& src,
592 const VkImage& dst,
593 const ImageParms& parms,
594 const deUint32 mipLevels = 1u);
596 const tcu::PixelBufferAccess& dst,
597 const ImageParms& parms,
598 const deUint32 mipLevel = 0u);
609 const DeviceInterface& vk = context.getDeviceInterface();
610 const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex();
624 const tcu::TextureChannelClass channelClass = tcu::getTextureChannelClass(buffer.getFormat().type);
640 const tcu::IVec4 bits = tcu::min(tcu::getTextureFormatBitDepth(buffer.getFormat()), tcu::IVec4(32));
641 const int signBit = (channelClass == tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER ? 1 : 0);
662 const tcu::Vec4 redColor (maxValue.x(), 0.0, 0.0, maxValue.w());
663 const tcu::Vec4 greenColor (0.0, maxValue.y(), 0.0, maxValue.w());
664 const tcu::Vec4 blueColor (0.0, 0.0, maxValue.z(), maxValue.w());
665 const tcu::Vec4 whiteColor (maxValue.x(), maxValue.y(), maxValue.z(), maxValue.w());
666 const tcu::Vec4 blackColor (0.0f, 0.0f, 0.0f, 0.0f);
742 void CopiesAndBlittingTestInstance::uploadBuffer (const tcu::ConstPixelBufferAccess& bufferAccess, const Allocation& bufferAlloc)
744 const DeviceInterface& vk = m_context.getDeviceInterface();
745 const deUint32 bufferSize = calculateSize(bufferAccess);
752 void CopiesAndBlittingTestInstance::uploadImageAspect (const tcu::ConstPixelBufferAccess& imageAccess, const VkImage& image, const ImageParms& parms, const deUint32 mipLevels)
754 const InstanceInterface& vki = m_context.getInstanceInterface();
755 const DeviceInterface& vk = m_context.getDeviceInterface();
756 const VkPhysicalDevice vkPhysDevice = m_context.getPhysicalDevice();
757 const VkDevice vkDevice = m_device;
758 const VkQueue queue = m_queue;
761 const deUint32 bufferSize = calculateSize(imageAccess);
763 const deUint32 arraySize = getArraySize(parms);
764 const VkExtent3D imageExtent = getExtent3D(parms);
769 const VkBufferCreateInfo bufferParams =
772 DE_NULL, // const void* pNext;
778 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
787 const VkBufferMemoryBarrier preBufferBarrier =
790 DE_NULL, // const void* pNext;
800 const VkImageAspectFlags formatAspect = (m_params.extensionFlags & SEPARATE_DEPTH_STENCIL_LAYOUT) ? getAspectFlags(imageAccess.getFormat()) : getAspectFlags(parms.format);
801 const bool skipPreImageBarrier = (m_params.extensionFlags & SEPARATE_DEPTH_STENCIL_LAYOUT) ? false : ((formatAspect == (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT) &&
804 const VkImageMemoryBarrier preImageBarrier =
807 DE_NULL, // const void* pNext;
824 const VkImageMemoryBarrier postImageBarrier =
827 DE_NULL, // const void* pNext;
846 const VkExtent3D copyExtent =
853 const bool isCompressed = isCompressedFormat(parms.format);
854 const deUint32 blockWidth = (isCompressed) ? getBlockWidth(parms.format) : 1u;
855 const deUint32 blockHeight = (isCompressed) ? getBlockHeight(parms.format) : 1u;
859 const VkBufferImageCopy copyRegion =
883 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL,
886 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &postImageBarrier);
893 void CopiesAndBlittingTestInstance::uploadImage (const tcu::ConstPixelBufferAccess& src, VkImage dst, const ImageParms& parms, const deUint32 mipLevels)
917 const tcu::ConstPixelBufferAccess expected = m_expectedTextureLevel[0]->getAccess();
921 const tcu::Vec4 threshold (0.0f);
927 const tcu::UVec4 threshold (0u);
945 const tcu::ConstPixelBufferAccess src = m_sourceTextureLevel->getAccess();
946 const tcu::ConstPixelBufferAccess dst = m_destinationTextureLevel->getAccess();
956 const tcu::PixelBufferAccess& dst,
957 const ImageParms& imageParms,
958 const deUint32 mipLevel)
960 const InstanceInterface& vki = m_context.getInstanceInterface();
961 const DeviceInterface& vk = m_context.getDeviceInterface();
962 const VkPhysicalDevice physDevice = m_context.getPhysicalDevice();
963 const VkDevice device = m_device;
964 const VkQueue queue = m_queue;
969 const VkDeviceSize pixelDataSize = calculateSize(dst);
970 const VkExtent3D imageExtent = getExtent3D(imageParms, mipLevel);
974 const VkBufferCreateInfo bufferParams =
977 DE_NULL, // const void* pNext;
983 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
995 const VkImageAspectFlags formatAspect = getAspectFlags(imageParms.format);
996 const VkImageMemoryBarrier imageBarrier =
999 DE_NULL, // const void* pNext;
1016 const VkBufferMemoryBarrier bufferBarrier =
1019 DE_NULL, // const void* pNext;
1029 const VkImageMemoryBarrier postImageBarrier =
1032 DE_NULL, // const void* pNext;
1050 const bool isCompressed = isCompressedFormat(imageParms.format);
1051 const deUint32 blockWidth = (isCompressed) ? getBlockWidth(imageParms.format) : 1u;
1052 const deUint32 blockHeight = (isCompressed) ? getBlockHeight(imageParms.format) : 1u;
1057 const VkImageAspectFlags aspect = isCompressedFormat(m_params.dst.image.format) ?
1059 const VkBufferImageCopy copyRegion =
1075 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &imageBarrier);
1077 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT|VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 1, &bufferBarrier, 1, &postImageBarrier);
1089 const ImageParms& parms,
1090 const deUint32 mipLevel)
1092 const tcu::TextureFormat imageFormat = getSizeCompatibleTcuTextureFormat(parms.format);
1119 const QueueSelectionOptions queueOptions,
1122 const InstanceInterface& instanceDriver = context.getInstanceInterface();
1123 const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
1138 const std::vector<VkQueueFamilyProperties> queueFamilies = getPhysicalDeviceQueueFamilyProperties(instanceDriver, physicalDevice);
1144 const float queuePriority = 1.0f;
1145 const VkDeviceQueueCreateInfo deviceQueueCreateInfos[] = {
1148 nullptr, // const void* pNext;
1152 &queuePriority, // const float* pQueuePriorities;
1156 nullptr, // const void* pNext;
1160 &queuePriority, // const float* pQueuePriorities;
1165 const auto extensionNames = context.getDeviceCreationExtensions();
1166 const auto& deviceFeatures2 = context.getDeviceFeatures2();
1168 const void* pNext = &deviceFeatures2;
1183 DE_NULL, // const void* pNext;
1187 context.getResourceInterface()->getCacheData() // const void* pInitialData;
1201 const VkDeviceCreateInfo deviceCreateInfo =
1204 pNext, // const void* pNext;
1207 deviceQueueCreateInfos, // const VkDeviceQueueCreateInfo* pQueueCreateInfos;
1209 DE_NULL, // const char* const* ppEnabledLayerNames;
1211 extensionNames.data(), // const char* const* ppEnabledExtensionNames;
1212 DE_NULL, // const VkPhysicalDeviceFeatures* pEnabledFeatures;
1222 const InstanceInterface& vki = m_context.getInstanceInterface();
1223 const DeviceInterface& vk = m_context.getDeviceInterface();
1224 const VkPhysicalDevice physDevice = m_context.getPhysicalDevice();
1268 const InstanceInterface& vki = context.getInstanceInterface();
1269 const DeviceInterface& vk = context.getDeviceInterface();
1270 const VkPhysicalDevice vkPhysDevice = context.getPhysicalDevice();
1277 const VkImageCreateInfo sourceImageParams =
1280 DE_NULL, // const void* pNext;
1293 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
1304 const VkImageCreateInfo destinationImageParams =
1307 DE_NULL, // const void* pNext;
1320 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
1332 const bool srcCompressed = isCompressedFormat(m_params.src.image.format);
1333 const bool dstCompressed = isCompressedFormat(m_params.dst.image.format);
1335 const tcu::TextureFormat srcTcuFormat = getSizeCompatibleTcuTextureFormat(m_params.src.image.format);
1336 const tcu::TextureFormat dstTcuFormat = getSizeCompatibleTcuTextureFormat(m_params.dst.image.format);
1353 const DeviceInterface& vk = m_context.getDeviceInterface();
1354 const VkDevice vkDevice = m_device;
1355 const VkQueue queue = m_queue;
1367 const deUint32 blockWidth = getBlockWidth(m_params.src.image.format);
1368 const deUint32 blockHeight = getBlockHeight(m_params.src.image.format);
1383 const deUint32 blockWidth = getBlockWidth(m_params.dst.image.format);
1384 const deUint32 blockHeight = getBlockHeight(m_params.dst.image.format);
1411 DE_NULL, // const void* pNext;
1430 DE_NULL, // const void* pNext;
1449 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, DE_LENGTH_OF_ARRAY(imageBarriers), imageBarriers);
1463 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, DE_LENGTH_OF_ARRAY(imageBarriers), imageBarriers);
1473 const VkCopyImageInfo2KHR copyImageInfo2KHR =
1476 DE_NULL, // const void* pNext;
1482 imageCopies2KHR.data() // const VkImageCopy2KHR* pRegions;
1500 const tcu::Vec4 fThreshold (0.0f);
1501 const tcu::UVec4 uThreshold (0u);
1507 const tcu::Sampler::DepthStencilMode mode = tcu::Sampler::MODE_DEPTH;
1508 const tcu::ConstPixelBufferAccess depthResult = tcu::getEffectiveDepthStencilAccess(result, mode);
1509 const tcu::ConstPixelBufferAccess expectedResult = tcu::getEffectiveDepthStencilAccess(m_expectedTextureLevel[0]->getAccess(), mode);
1525 const tcu::Sampler::DepthStencilMode mode = tcu::Sampler::MODE_STENCIL;
1526 const tcu::ConstPixelBufferAccess stencilResult = tcu::getEffectiveDepthStencilAccess(result, mode);
1527 const tcu::ConstPixelBufferAccess expectedResult = tcu::getEffectiveDepthStencilAccess(m_expectedTextureLevel[0]->getAccess(), mode);
1577 const tcu::ConstPixelBufferAccess srcSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(src, srcOffset.x, srcOffset.y, srcOffset.z, extent.width, extent.height, extent.depth), tcu::Sampler::MODE_DEPTH);
1578 const tcu::PixelBufferAccess dstSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(dst, dstOffset.x, dstOffset.y, dstOffset.z, extent.width, extent.height, extent.depth), tcu::Sampler::MODE_DEPTH);
1585 const tcu::ConstPixelBufferAccess srcSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(src, srcOffset.x, srcOffset.y, srcOffset.z, extent.width, extent.height, extent.depth), tcu::Sampler::MODE_STENCIL);
1586 const tcu::PixelBufferAccess dstSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(dst, dstOffset.x, dstOffset.y, dstOffset.z, extent.width, extent.height, extent.depth), tcu::Sampler::MODE_STENCIL);
1592 const tcu::ConstPixelBufferAccess srcSubRegion = tcu::getSubregion(src, srcOffset.x, srcOffset.y, srcOffset.z, extent.width, extent.height, extent.depth);
1594 const tcu::PixelBufferAccess dstWithSrcFormat (srcSubRegion.getFormat(), dst.getSize(), dst.getDataPtr());
1595 const tcu::PixelBufferAccess dstSubRegion = tcu::getSubregion(dstWithSrcFormat, dstOffset.x, dstOffset.y, dstOffset.z, extent.width, extent.height, extent.depth);
1605 const std::string& name,
1606 const TestParams params)
1611 virtual TestInstance* createInstance (Context& context) const
1616 virtual void checkSupport (Context& context) const
1632 const VkPhysicalDeviceLimits limits = context.getDeviceProperties().limits;
1724 const InstanceInterface& vki = context.getInstanceInterface();
1725 const DeviceInterface& vk = context.getDeviceInterface();
1726 const VkPhysicalDevice vkPhysDevice = context.getPhysicalDevice();
1733 const VkImageCreateInfo sourceImageParams =
1736 DE_NULL, // const void* pNext;
1749 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
1760 const VkImageCreateInfo destinationImageParams =
1763 DE_NULL, // const void* pNext;
1776 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
1788 const bool srcCompressed = isCompressedFormat(m_params.src.image.format);
1789 const bool dstCompressed = isCompressedFormat(m_params.dst.image.format);
1791 const tcu::TextureFormat srcTcuFormat = getSizeCompatibleTcuTextureFormat(m_params.src.image.format);
1792 const tcu::TextureFormat dstTcuFormat = getSizeCompatibleTcuTextureFormat(m_params.dst.image.format);
1808 const DeviceInterface& vk = m_context.getDeviceInterface();
1809 const VkDevice vkDevice = m_device;
1810 const VkQueue queue = m_queue;
1822 const deUint32 blockWidth = getBlockWidth(m_params.src.image.format);
1823 const deUint32 blockHeight = getBlockHeight(m_params.src.image.format);
1833 const deUint32 blockWidth = getBlockWidth(m_params.dst.image.format);
1834 const deUint32 blockHeight = getBlockHeight(m_params.dst.image.format);
1856 DE_NULL, // const void* pNext;
1875 DE_NULL, // const void* pNext;
1894 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, DE_LENGTH_OF_ARRAY(imageBarriers), imageBarriers);
1903 const VkCopyImageInfo2KHR copyImageInfo2KHR =
1906 DE_NULL, // const void* pNext;
1912 imageCopies2KHR.data() // const VkImageCopy2KHR* pRegions;
1937 const tcu::Vec4 fThreshold (0.0f);
1938 const tcu::UVec4 uThreshold (0u);
1944 const tcu::Sampler::DepthStencilMode mode = tcu::Sampler::MODE_DEPTH;
1945 const tcu::ConstPixelBufferAccess depthResult = tcu::getEffectiveDepthStencilAccess(result, mode);
1946 const tcu::ConstPixelBufferAccess expectedResult = tcu::getEffectiveDepthStencilAccess(expected, mode);
1962 const tcu::Sampler::DepthStencilMode mode = tcu::Sampler::MODE_STENCIL;
1963 const tcu::ConstPixelBufferAccess stencilResult = tcu::getEffectiveDepthStencilAccess(result, mode);
1964 const tcu::ConstPixelBufferAccess expectedResult = tcu::getEffectiveDepthStencilAccess(expected, mode);
2047 const tcu::ConstPixelBufferAccess srcSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(src, srcOffset.x, srcOffset.y, srcOffset.z, extent.width, extent.height, extent.depth), tcu::Sampler::MODE_DEPTH);
2048 const tcu::PixelBufferAccess dstSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(dst, dstOffset.x, dstOffset.y, dstOffset.z, extent.width, extent.height, extent.depth), tcu::Sampler::MODE_DEPTH);
2055 const tcu::ConstPixelBufferAccess srcSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(src, srcOffset.x, srcOffset.y, srcOffset.z, extent.width, extent.height, extent.depth), tcu::Sampler::MODE_STENCIL);
2056 const tcu::PixelBufferAccess dstSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(dst, dstOffset.x, dstOffset.y, dstOffset.z, extent.width, extent.height, extent.depth), tcu::Sampler::MODE_STENCIL);
2062 const tcu::ConstPixelBufferAccess srcSubRegion = tcu::getSubregion(src, srcOffset.x, srcOffset.y, srcOffset.z, extent.width, extent.height, extent.depth);
2064 const tcu::PixelBufferAccess dstWithSrcFormat (srcSubRegion.getFormat(), dst.getSize(), dst.getDataPtr());
2065 const tcu::PixelBufferAccess dstSubRegion = tcu::getSubregion(dstWithSrcFormat, dstOffset.x, dstOffset.y, dstOffset.z, extent.width, extent.height, extent.depth);
2075 const std::string& name,
2076 const TestParams params)
2081 virtual TestInstance* createInstance (Context& context) const
2086 virtual void checkSupport (Context& context) const
2096 const VkPhysicalDeviceLimits limits = context.getDeviceProperties().limits;
2181 const InstanceInterface& vki = context.getInstanceInterface();
2182 const DeviceInterface& vk = context.getDeviceInterface();
2183 const VkPhysicalDevice vkPhysDevice = context.getPhysicalDevice();
2190 const VkBufferCreateInfo sourceBufferParams =
2193 DE_NULL, // const void* pNext;
2199 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
2209 const VkBufferCreateInfo destinationBufferParams =
2212 DE_NULL, // const void* pNext;
2218 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
2229 const int srcLevelWidth = (int)(m_params.src.buffer.size/4); // Here the format is VK_FORMAT_R32_UINT, we need to divide the buffer size by 4
2233 const int dstLevelWidth = (int)(m_params.dst.buffer.size/4);
2242 const DeviceInterface& vk = m_context.getDeviceInterface();
2243 const VkQueue queue = m_queue;
2245 const VkBufferMemoryBarrier srcBufferBarrier =
2248 DE_NULL, // const void* pNext;
2258 const VkBufferMemoryBarrier dstBufferBarrier =
2261 DE_NULL, // const void* pNext;
2287 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 1, &srcBufferBarrier, 0, (const VkImageMemoryBarrier*)DE_NULL);
2296 const VkCopyBufferInfo2KHR copyBufferInfo2KHR =
2299 DE_NULL, // const void* pNext;
2303 &bufferCopies2KHR[0] // const VkBufferCopy2KHR* pRegions;
2309 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 1, &dstBufferBarrier, 0, (const VkImageMemoryBarrier*)DE_NULL);
2335 const std::string& name,
2336 const TestParams params)
2341 virtual TestInstance* createInstance (Context& context) const
2346 virtual void checkSupport(Context& context) const
2383 const InstanceInterface& vki = context.getInstanceInterface();
2384 const DeviceInterface& vk = context.getDeviceInterface();
2385 const VkPhysicalDevice vkPhysDevice = context.getPhysicalDevice();
2392 const VkImageCreateInfo sourceImageParams =
2395 DE_NULL, // const void* pNext;
2408 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
2419 const VkBufferCreateInfo destinationBufferParams =
2422 DE_NULL, // const void* pNext;
2428 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
2452 const DeviceInterface& vk = m_context.getDeviceInterface();
2453 const VkDevice vkDevice = m_device;
2454 const VkQueue queue = m_queue;
2457 const VkImageMemoryBarrier imageBarrier =
2460 DE_NULL, // const void* pNext;
2477 const VkBufferMemoryBarrier bufferBarrier =
2480 DE_NULL, // const void* pNext;
2507 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &imageBarrier);
2516 const VkCopyImageToBufferInfo2KHR copyImageToBufferInfo2KHR =
2519 DE_NULL, // const void* pNext;
2524 &bufferImageCopies2KHR[0] // const VkBufferImageCopy2KHR* pRegions;
2530 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 1, &bufferBarrier, 0, (const VkImageMemoryBarrier*)DE_NULL);
2548 const std::string& name,
2549 const TestParams params)
2554 virtual TestInstance* createInstance (Context& context) const
2559 virtual void checkSupport (Context& context) const
2583 const int texelSize = src.getFormat().getPixelSize();
2584 const VkExtent3D extent = region.bufferImageCopy.imageExtent;
2585 const VkOffset3D srcOffset = region.bufferImageCopy.imageOffset;
2586 const int texelOffset = (int) region.bufferImageCopy.bufferOffset / texelSize;
2587 const deUint32 baseArrayLayer = region.bufferImageCopy.imageSubresource.baseArrayLayer;
2594 const tcu::ConstPixelBufferAccess srcSubRegion = tcu::getSubregion(src, srcOffset.x, srcOffset.y + y, srcOffset.z + z + baseArrayLayer,
2596 const tcu::PixelBufferAccess dstSubRegion = tcu::getSubregion(dst, texelIndex, 0, region.bufferImageCopy.imageExtent.width, 1);
2644 const InstanceInterface& vki = m_context.getInstanceInterface();
2645 const bool useTwoQueues = m_options != QueueSelectionOptions::Universal;
2662 const DeviceInterface& vk = m_context.getDeviceInterface();
2664 const DeviceInterface& vk = (DE_NULL != m_deviceDriver) ? *m_deviceDriver : m_context.getDeviceInterface();
2673 const VkDevice vkDevice = m_device;
2674 const VkQueue queue = m_queue;
2675 const VkCommandBuffer commandBuffer = m_alternativeCmdBuffer.get();
2676 const VkCommandPool commandPool = m_alternativeCmdPool.get();
2678 const ImageParms& srcImageParams = m_params.src.image;
2682 const VkImageCreateInfo sourceImageParams =
2685 DE_NULL, // const void* pNext;
2698 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
2726 const tcu::CompressedTexture compressedMipLevelToCheck = m_texture->getCompressedLevel(mipLevelToCheckIdx, arrayLayerToCheckIdx);
2734 const auto imageBarrier = makeImageMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT,
2748 const auto bufferBarrier = makeBufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, m_destination->get(), 0, bufferSize);
2768 vk.cmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &imageBarrier);
2778 const VkCopyImageToBufferInfo2KHR copyImageToBufferInfo2KHR =
2781 DE_NULL, // const void* pNext;
2786 &bufferImageCopy2KHR // const VkBufferImageCopy2KHR* pRegions;
2793 vk.cmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 1, &bufferBarrier, 0, (const VkImageMemoryBarrier*)DE_NULL);
2801 const deUint8* referenceData = (deUint8 *)compressedMipLevelToCheck.getData();
2802 const deUint8* resultData = (deUint8 *)m_destination->getAllocation().getHostPtr();
2819 const std::string& name,
2820 const TestParams params)
2825 virtual TestInstance* createInstance (Context& context) const
2829 virtual void checkSupport (Context& context) const;
2834 void CopyCompressedImageToBufferTestCase::checkSupport(Context& context) const
2846 const auto& instance = context.getInstanceInterface();
2889 const InstanceInterface& vki = context.getInstanceInterface();
2890 const DeviceInterface& vk = context.getDeviceInterface();
2891 const VkPhysicalDevice vkPhysDevice = context.getPhysicalDevice();
2898 const VkBufferCreateInfo sourceBufferParams =
2901 DE_NULL, // const void* pNext;
2907 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
2917 const VkImageCreateInfo destinationImageParams =
2920 DE_NULL, // const void* pNext;
2933 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
2959 const DeviceInterface& vk = m_context.getDeviceInterface();
2960 const VkDevice vkDevice = m_device;
2961 const VkQueue queue = m_queue;
2963 const VkImageMemoryBarrier imageBarrier =
2966 DE_NULL, // const void* pNext;
3000 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &imageBarrier);
3009 const VkCopyBufferToImageInfo2KHR copyBufferToImageInfo2KHR =
3012 DE_NULL, // const void* pNext;
3017 bufferImageCopies2KHR.data() // const VkBufferImageCopy2KHR* pRegions;
3036 const std::string& name,
3037 const TestParams params)
3044 virtual TestInstance* createInstance (Context& context) const
3049 virtual void checkSupport (Context& context) const
3074 const int texelSize = dst.getFormat().getPixelSize();
3075 const VkExtent3D extent = region.bufferImageCopy.imageExtent;
3076 const VkOffset3D dstOffset = region.bufferImageCopy.imageOffset;
3077 const int texelOffset = (int) region.bufferImageCopy.bufferOffset / texelSize;
3078 const deUint32 baseArrayLayer = region.bufferImageCopy.imageSubresource.baseArrayLayer;
3085 const tcu::ConstPixelBufferAccess srcSubRegion = tcu::getSubregion(src, texelIndex, 0, region.bufferImageCopy.imageExtent.width, 1);
3086 const tcu::PixelBufferAccess dstSubRegion = tcu::getSubregion(dst, dstOffset.x, dstOffset.y + y, dstOffset.z + z + baseArrayLayer,
3123 const int texelSize = dst.getFormat().getPixelSize();
3124 const VkExtent3D extent = region.bufferImageCopy.imageExtent;
3125 const VkOffset3D dstOffset = region.bufferImageCopy.imageOffset;
3126 const int texelOffset = (int)region.bufferImageCopy.bufferOffset / texelSize;
3133 const tcu::ConstPixelBufferAccess srcSubRegion = tcu::getSubregion(src, texelIndex, 0, region.bufferImageCopy.imageExtent.width, 1);
3134 const tcu::PixelBufferAccess dstSubRegion = tcu::getSubregion(dst, dstOffset.x, dstOffset.y + y, dstOffset.z + z,
3149 bool isSupportedDepthStencilFormat(const InstanceInterface& vki, const VkPhysicalDevice physDevice, const VkFormat format)
3161 const InstanceInterface& vki = context.getInstanceInterface();
3162 const DeviceInterface& vk = context.getDeviceInterface();
3163 const VkPhysicalDevice vkPhysDevice = context.getPhysicalDevice();
3164 const VkDevice vkDevice = m_device;
3166 const bool hasDepth = tcu::hasDepthComponent(mapVkFormat(m_params.dst.image.format).order);
3167 const bool hasStencil = tcu::hasStencilComponent(mapVkFormat(m_params.dst.image.format).order);
3193 const VkBufferCreateInfo sourceBufferParams =
3196 DE_NULL, // const void* pNext;
3202 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
3212 const VkImageCreateInfo destinationImageParams =
3215 DE_NULL, // const void* pNext;
3228 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
3264 const VkDevice vkDevice = m_device;
3265 const DeviceInterface& vk = m_context.getDeviceInterface();
3266 const VkQueue queue = m_queue;
3340 const VkImageMemoryBarrier imageBarrier =
3343 DE_NULL, // const void* pNext;
3363 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &imageBarrier);
3378 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &imageBarrier);
3391 const VkCopyBufferToImageInfo2KHR copyBufferToImageInfo2KHR =
3394 DE_NULL, // const void* pNext;
3399 bufferImageCopies2KHR.data() // const VkBufferImageCopy2KHR* pRegions;
3409 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &imageBarrier);
3411 const VkCopyBufferToImageInfo2KHR copyBufferToImageInfo2KHR =
3414 DE_NULL, // const void* pNext;
3419 &bufferImageCopies2KHR[i] // const VkBufferImageCopy2KHR* pRegions;
3454 const std::string& name,
3455 const TestParams params)
3462 virtual TestInstance* createInstance (Context& context) const
3467 virtual void checkSupport (Context& context) const
3483 CompressedTextureForBlit(const tcu::CompressedTexFormat& srcFormat, int width, int height, int depth);
3485 tcu::PixelBufferAccess getDecompressedAccess() const;
3486 const tcu::CompressedTexture& getCompressedTexture() const;
3495 CompressedTextureForBlit::CompressedTextureForBlit(const tcu::CompressedTexFormat& srcFormat, int width, int height, int depth)
3500 const int compressedDataSize (m_compressedTexture.getDataSize());
3504 const int decompressedDataSize (tcu::getPixelSize(decompressedSrcFormat) * width * height * depth);
3556 const int blocksCount = compressedDataSize / static_cast<int>(sizeof(BC6HBlock));
3581 tcu::PixelBufferAccess CompressedTextureForBlit::getDecompressedAccess() const
3586 const tcu::CompressedTexture& CompressedTextureForBlit::getCompressedTexture() const
3606 void uploadCompressedImage (const VkImage& image, const ImageParms& parms);
3608 bool checkNonNearestFilteredResult (const tcu::ConstPixelBufferAccess& result,
3609 const tcu::ConstPixelBufferAccess& clampedReference,
3610 const tcu::ConstPixelBufferAccess& unclampedReference,
3611 const tcu::TextureFormat& sourceFormat);
3612 bool checkNearestFilteredResult (const tcu::ConstPixelBufferAccess& result,
3613 const tcu::ConstPixelBufferAccess& source);
3615 bool checkCompressedNonNearestFilteredResult (const tcu::ConstPixelBufferAccess& result,
3616 const tcu::ConstPixelBufferAccess& clampedReference,
3617 const tcu::ConstPixelBufferAccess& unclampedReference,
3618 const tcu::CompressedTexFormat format);
3619 bool checkCompressedNearestFilteredResult (const tcu::ConstPixelBufferAccess& result,
3620 const tcu::ConstPixelBufferAccess& source,
3621 const tcu::CompressedTexFormat format);
3640 const InstanceInterface& vki = context.getInstanceInterface();
3641 const DeviceInterface& vk = context.getDeviceInterface();
3642 const VkPhysicalDevice vkPhysDevice = context.getPhysicalDevice();
3643 const VkDevice vkDevice = m_device;
3648 const VkImageCreateInfo sourceImageParams =
3651 DE_NULL, // const void* pNext;
3664 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
3675 const VkImageCreateInfo destinationImageParams =
3678 DE_NULL, // const void* pNext;
3691 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
3703 const DeviceInterface& vk = m_context.getDeviceInterface();
3704 const VkDevice vkDevice = m_device;
3705 const VkQueue queue = m_queue;
3707 const ImageParms& srcImageParams = m_params.src.image;
3708 const int srcWidth = static_cast<int>(srcImageParams.extent.width);
3709 const int srcHeight = static_cast<int>(srcImageParams.extent.height);
3710 const int srcDepth = static_cast<int>(srcImageParams.extent.depth);
3711 const ImageParms& dstImageParams = m_params.dst.image;
3712 const int dstWidth = static_cast<int>(dstImageParams.extent.width);
3713 const int dstHeight = static_cast<int>(dstImageParams.extent.height);
3714 const int dstDepth = static_cast<int>(dstImageParams.extent.depth);
3723 for (const auto& r : m_params.regions)
3730 for (const auto& r : m_params.regions)
3745 const tcu::TextureFormat srcTcuFormat = mapVkFormat(srcImageParams.format);
3762 const tcu::TextureFormat dstTcuFormat = mapVkFormat(dstImageParams.format);
3771 const VkImageMemoryBarrier imageBarriers[]
3775 DE_NULL, // const void* pNext;
3793 DE_NULL, // const void* pNext;
3812 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 2, imageBarriers);
3821 const VkBlitImageInfo2KHR blitImageInfo2KHR
3824 DE_NULL, // const void* pNext;
3830 ®ions2KHR[0], // const VkImageBlit2KHR* pRegions;
3846 deUint8* const compressedDataSrc (static_cast<deUint8*>(resultAccess.getDataPtr()));
3847 const tcu::CompressedTexFormat dstCompressedFormat (mapVkCompressedFormat(dstImageParams.format));
3863 const int clampedBits = de::clamp<int>(srcBits, 0, 32);
3864 const float srcMaxValue = de::max((float)(1ULL<<clampedBits) - 1.0f, 1.0f);
3865 const float error = 1.0f / srcMaxValue;
3873 tcu::Vec4 getFormatThreshold (const tcu::TextureFormat& format)
3905 const tcu::IVec4 bits = tcu::getTextureFormatMantissaBitDepth(format);
3919 tcu::Vec4 getCompressedFormatThreshold(const tcu::CompressedTexFormat& format)
4031 const float range = isSigned ? 1.0f - (-1.0f)
4044 bool BlittingImages::checkNonNearestFilteredResult (const tcu::ConstPixelBufferAccess& result,
4045 const tcu::ConstPixelBufferAccess& clampedExpected,
4046 const tcu::ConstPixelBufferAccess& unclampedExpected,
4047 const tcu::TextureFormat& srcFormat)
4050 const tcu::TextureFormat dstFormat = result.getFormat();
4051 const tcu::TextureChannelClass dstChannelClass = tcu::getTextureChannelClass(dstFormat.type);
4052 const tcu::TextureChannelClass srcChannelClass = tcu::getTextureChannelClass(srcFormat.type);
4073 const bool srcIsSRGB = tcu::isSRGB(srcFormat);
4074 const tcu::Vec4 srcMaxDiff = getFormatThreshold(srcFormat) * tcu::Vec4(srcIsSRGB ? 2.0f : 1.0f);
4075 const tcu::Vec4 dstMaxDiff = getFormatThreshold(dstFormat);
4076 const tcu::Vec4 threshold = ( srcMaxDiff + dstMaxDiff ) * ((m_params.filter == VK_FILTER_CUBIC_EXT) ? 1.5f : 1.0f);
4092 const tcu::IVec4 dstBitDepth = tcu::getTextureFormatBitDepth(dstFormat);
4093 const tcu::IVec4 srcBitDepth = tcu::getTextureFormatBitDepth(srcFormat);
4117 bool BlittingImages::checkCompressedNonNearestFilteredResult(const tcu::ConstPixelBufferAccess& result,
4118 const tcu::ConstPixelBufferAccess& clampedReference,
4119 const tcu::ConstPixelBufferAccess& unclampedReference,
4120 const tcu::CompressedTexFormat format)
4123 const tcu::TextureFormat dstFormat = result.getFormat();
4127 const tcu::Vec4 acceptedError (0.06f);
4129 const tcu::Vec4 srcMaxDiff = getCompressedFormatThreshold(format);
4130 const tcu::Vec4 dstMaxDiff = m_destinationCompressedTexture ?
4133 const tcu::Vec4 threshold = (srcMaxDiff + dstMaxDiff) * ((m_params.filter == VK_FILTER_CUBIC_EXT) ? 1.5f : 1.0f) + acceptedError;
4197 const tcu::ConstPixelBufferAccess clampedRef = filteredResultVerification ? filteredClampedReference.getAccess() : clampedReference;
4198 const tcu::ConstPixelBufferAccess res = filteredResultVerification ? filteredResult.getAccess() : result;
4206 const tcu::ConstPixelBufferAccess unclampedRef = filteredResultVerification ? filteredUnclampedReference.getAccess() : unclampedReference;
4220 virtual bool compare (const void* pUserData, const int x, const int y, const int z, const tcu::Vec3& srcNormCoord) const = 0;
4222 bool forEach (const void* pUserData,
4223 const std::vector<CopyRegion>& regions,
4224 const int sourceWidth,
4225 const int sourceHeight,
4226 const int sourceDepth,
4227 const tcu::PixelBufferAccess& errorMask) const
4233 const VkImageBlit& blit = regionIter->imageBlit;
4235 const int xStart = deMin32(blit.dstOffsets[0].x, blit.dstOffsets[1].x);
4236 const int yStart = deMin32(blit.dstOffsets[0].y, blit.dstOffsets[1].y);
4237 const int zStart = deMin32(blit.dstOffsets[0].z, blit.dstOffsets[1].z);
4238 const int xEnd = deMax32(blit.dstOffsets[0].x, blit.dstOffsets[1].x);
4239 const int yEnd = deMax32(blit.dstOffsets[0].y, blit.dstOffsets[1].y);
4240 const int zEnd = deMax32(blit.dstOffsets[0].z, blit.dstOffsets[1].z);
4241 const float xScale = static_cast<float>(blit.srcOffsets[1].x - blit.srcOffsets[0].x) / static_cast<float>(blit.dstOffsets[1].x - blit.dstOffsets[0].x);
4242 const float yScale = static_cast<float>(blit.srcOffsets[1].y - blit.srcOffsets[0].y) / static_cast<float>(blit.dstOffsets[1].y - blit.dstOffsets[0].y);
4243 const float zScale = static_cast<float>(blit.srcOffsets[1].z - blit.srcOffsets[0].z) / static_cast<float>(blit.dstOffsets[1].z - blit.dstOffsets[0].z);
4244 const float srcInvW = 1.0f / static_cast<float>(sourceWidth);
4245 const float srcInvH = 1.0f / static_cast<float>(sourceHeight);
4246 const float srcInvD = 1.0f / static_cast<float>(sourceDepth);
4252 const tcu::Vec3 srcNormCoord
4270 tcu::Vec4 getFloatOrFixedPointFormatThreshold (const tcu::TextureFormat& format)
4272 const tcu::TextureChannelClass channelClass = tcu::getTextureChannelClass(format.type);
4273 const tcu::IVec4 bitDepth = tcu::getTextureFormatBitDepth(format);
4282 const bool isSigned = (channelClass == tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT);
4283 const float range = isSigned ? 1.0f - (-1.0f)
4303 bool floatNearestBlitCompare (const tcu::ConstPixelBufferAccess& source,
4304 const tcu::ConstPixelBufferAccess& result,
4305 const tcu::Vec4& sourceThreshold,
4306 const tcu::Vec4& resultThreshold,
4307 const tcu::PixelBufferAccess& errorMask,
4308 const std::vector<CopyRegion>& regions)
4310 const tcu::Sampler sampler (tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
4312 const tcu::IVec4 dstBitDepth (tcu::getTextureFormatBitDepth(result.getFormat()));
4318 const struct Capture
4320 const tcu::ConstPixelBufferAccess& source;
4321 const tcu::ConstPixelBufferAccess& result;
4322 const tcu::Sampler& sampler;
4323 const tcu::LookupPrecision& precision;
4324 const bool isSRGB;
4330 const struct Loop : CompareEachPixelInEachRegion
4334 bool compare (const void* pUserData, const int x, const int y, const int z, const tcu::Vec3& srcNormCoord) const
4336 const Capture& c = *static_cast<const Capture*>(pUserData);
4337 const tcu::TexLookupScaleMode lookupScaleDontCare = tcu::TEX_LOOKUP_SCALE_MINIFY;
4351 bool intNearestBlitCompare (const tcu::ConstPixelBufferAccess& source,
4352 const tcu::ConstPixelBufferAccess& result,
4353 const tcu::PixelBufferAccess& errorMask,
4354 const std::vector<CopyRegion>& regions)
4356 const tcu::Sampler sampler (tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
4361 const tcu::IVec4 srcBitDepth = tcu::getTextureFormatBitDepth(source.getFormat());
4362 const tcu::IVec4 dstBitDepth = tcu::getTextureFormatBitDepth(result.getFormat());
4373 const tcu::PixelBufferAccess convertedSource = convertedSourceTexture.getAccess();
4380 const struct Capture
4382 const tcu::ConstPixelBufferAccess& source;
4383 const tcu::ConstPixelBufferAccess& result;
4384 const tcu::Sampler& sampler;
4385 const tcu::IntLookupPrecision& precision;
4391 const struct Loop : CompareEachPixelInEachRegion
4395 bool compare (const void* pUserData, const int x, const int y, const int z, const tcu::Vec3& srcNormCoord) const
4397 const Capture& c = *static_cast<const Capture*>(pUserData);
4398 const tcu::TexLookupScaleMode lookupScaleDontCare = tcu::TEX_LOOKUP_SCALE_MINIFY;
4399 const tcu::IVec4 dstColor = c.result.getPixelInt(x, y, z);
4408 bool BlittingImages::checkNearestFilteredResult (const tcu::ConstPixelBufferAccess& result,
4409 const tcu::ConstPixelBufferAccess& source)
4412 const tcu::TextureFormat dstFormat = result.getFormat();
4413 const tcu::TextureFormat srcFormat = source.getFormat();
4414 const tcu::TextureChannelClass dstChannelClass = tcu::getTextureChannelClass(dstFormat.type);
4415 const tcu::TextureChannelClass srcChannelClass = tcu::getTextureChannelClass(srcFormat.type);
4442 const tcu::Vec4 srcMaxDiff = getFloatOrFixedPointFormatThreshold(source.getFormat());
4443 const tcu::Vec4 dstMaxDiff = getFloatOrFixedPointFormatThreshold(result.getFormat());
4467 bool BlittingImages::checkCompressedNearestFilteredResult (const tcu::ConstPixelBufferAccess& result,
4468 const tcu::ConstPixelBufferAccess& source,
4469 const tcu::CompressedTexFormat format)
4477 const tcu::TextureFormat& resultFormat (result.getFormat());
4482 const tcu::Vec4 acceptedError (0.04f);
4483 const tcu::Vec4 srcMaxDiff (acceptedError + getCompressedFormatThreshold(format));
4484 const tcu::Vec4 dstMaxDiff (acceptedError + (m_destinationCompressedTexture ?
4581 const tcu::ConstPixelBufferAccess src = clampSource ? clampedSourceLevel.getAccess() : source;
4582 const tcu::ConstPixelBufferAccess res = clampResult ? clampedResultLevel.getAccess() : result;
4598 const std::string failMessage("Result image is incorrect");
4606 const tcu::Sampler::DepthStencilMode mode = tcu::Sampler::MODE_DEPTH;
4607 const tcu::ConstPixelBufferAccess depthResult = tcu::getEffectiveDepthStencilAccess(result, mode);
4608 const tcu::ConstPixelBufferAccess clampedExpected = tcu::getEffectiveDepthStencilAccess(m_expectedTextureLevel[0]->getAccess(), mode);
4609 const tcu::ConstPixelBufferAccess unclampedExpected = tcu::getEffectiveDepthStencilAccess(m_unclampedExpectedTextureLevel->getAccess(), mode);
4610 const tcu::TextureFormat sourceFormat = tcu::getEffectiveDepthStencilTextureFormat(mapVkFormat(m_params.src.image.format), mode);
4618 const tcu::Sampler::DepthStencilMode mode = tcu::Sampler::MODE_STENCIL;
4619 const tcu::ConstPixelBufferAccess stencilResult = tcu::getEffectiveDepthStencilAccess(result, mode);
4620 const tcu::ConstPixelBufferAccess clampedExpected = tcu::getEffectiveDepthStencilAccess(m_expectedTextureLevel[0]->getAccess(), mode);
4621 const tcu::ConstPixelBufferAccess unclampedExpected = tcu::getEffectiveDepthStencilAccess(m_unclampedExpectedTextureLevel->getAccess(), mode);
4622 const tcu::TextureFormat sourceFormat = tcu::getEffectiveDepthStencilTextureFormat(mapVkFormat(m_params.src.image.format), mode);
4630 const tcu::CompressedTexture& compressedLevel = m_sourceCompressedTexture->getCompressedTexture();
4636 const tcu::TextureFormat sourceFormat = mapVkFormat(m_params.src.image.format);
4647 const tcu::Sampler::DepthStencilMode mode = tcu::Sampler::MODE_DEPTH;
4648 const tcu::ConstPixelBufferAccess depthResult = tcu::getEffectiveDepthStencilAccess(result, mode);
4649 const tcu::ConstPixelBufferAccess depthSource = tcu::getEffectiveDepthStencilAccess(m_sourceTextureLevel->getAccess(), mode);
4657 const tcu::Sampler::DepthStencilMode mode = tcu::Sampler::MODE_STENCIL;
4658 const tcu::ConstPixelBufferAccess stencilResult = tcu::getEffectiveDepthStencilAccess(result, mode);
4659 const tcu::ConstPixelBufferAccess stencilSource = tcu::getEffectiveDepthStencilAccess(m_sourceTextureLevel->getAccess(), mode);
4667 const tcu::CompressedTexture& compressedLevel = m_sourceCompressedTexture->getCompressedTexture();
4668 const tcu::PixelBufferAccess& decompressedLevel = m_sourceCompressedTexture->getDecompressedAccess();
4680 tcu::Vec4 linearToSRGBIfNeeded (const tcu::TextureFormat& format, const tcu::Vec4& color)
4685 void scaleFromWholeSrcBuffer (const tcu::PixelBufferAccess& dst, const tcu::ConstPixelBufferAccess& src, const VkOffset3D regionOffset, const VkOffset3D regionExtent, tcu::Sampler::FilterMode filter, const MirrorMode mirrorMode = 0u)
4710 void blit (const tcu::PixelBufferAccess& dst, const tcu::ConstPixelBufferAccess& src, const tcu::Sampler::FilterMode filter, const MirrorMode mirrorMode)
4717 const float sX = (float)src.getWidth() / (float)dst.getWidth();
4718 const float sY = (float)src.getHeight() / (float)dst.getHeight();
4719 const float sZ = (float)src.getDepth() / (float)dst.getDepth();
4721 const int xOffset = (mirrorMode & MIRROR_MODE_X) ? dst.getWidth() - 1 : 0;
4722 const int yOffset = (mirrorMode & MIRROR_MODE_Y) ? dst.getHeight() - 1 : 0;
4723 const int zOffset = (mirrorMode & MIRROR_MODE_Z) ? dst.getDepth() - 1 : 0;
4725 const int xScale = (mirrorMode & MIRROR_MODE_X) ? -1 : 1;
4726 const int yScale = (mirrorMode & MIRROR_MODE_Y) ? -1 : 1;
4727 const int zScale = (mirrorMode & MIRROR_MODE_Z) ? -1 : 1;
4737 void flipCoordinates (CopyRegion& region, const MirrorMode mirrorMode)
4739 const VkOffset3D dstOffset0 = region.imageBlit.dstOffsets[0];
4740 const VkOffset3D dstOffset1 = region.imageBlit.dstOffsets[1];
4741 const VkOffset3D srcOffset0 = region.imageBlit.srcOffsets[0];
4742 const VkOffset3D srcOffset1 = region.imageBlit.srcOffsets[1];
4767 MirrorMode getMirrorMode(const VkOffset3D from, const VkOffset3D to)
4784 MirrorMode getMirrorMode(const VkOffset3D s1, const VkOffset3D s2, const VkOffset3D d1, const VkOffset3D d2)
4786 static const MirrorModeBits kBits[] = { MIRROR_MODE_X, MIRROR_MODE_Y, MIRROR_MODE_Z };
4788 const MirrorMode source = getMirrorMode(s1, s2);
4789 const MirrorMode destination = getMirrorMode(d1, d2);
4795 const MirrorModeBits bit = kBits[i];
4807 const MirrorMode mirrorMode = getMirrorMode(region.imageBlit.srcOffsets[0],
4814 const VkOffset3D srcOffset = region.imageBlit.srcOffsets[0];
4815 const VkOffset3D srcExtent =
4821 const VkOffset3D dstOffset = region.imageBlit.dstOffsets[0];
4822 const VkOffset3D dstExtent =
4845 const tcu::ConstPixelBufferAccess srcSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(src, srcOffset.x, srcOffset.y, srcOffset.z, srcExtent.x, srcExtent.y, srcExtent.z), tcu::Sampler::MODE_DEPTH);
4846 const tcu::PixelBufferAccess dstSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(dst, dstOffset.x, dstOffset.y, dstOffset.z, dstExtent.x, dstExtent.y, dstExtent.z), tcu::Sampler::MODE_DEPTH);
4851 const tcu::ConstPixelBufferAccess depthSrc = getEffectiveDepthStencilAccess(src, tcu::Sampler::MODE_DEPTH);
4852 const tcu::PixelBufferAccess unclampedSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(m_unclampedExpectedTextureLevel->getAccess(), dstOffset.x, dstOffset.y, dstOffset.z, dstExtent.x, dstExtent.y, dstExtent.z), tcu::Sampler::MODE_DEPTH);
4860 const tcu::ConstPixelBufferAccess srcSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(src, srcOffset.x, srcOffset.y, srcOffset.z, srcExtent.x, srcExtent.y, srcExtent.z), tcu::Sampler::MODE_STENCIL);
4861 const tcu::PixelBufferAccess dstSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(dst, dstOffset.x, dstOffset.y, dstOffset.z, dstExtent.x, dstExtent.y, dstExtent.z), tcu::Sampler::MODE_STENCIL);
4866 const tcu::ConstPixelBufferAccess stencilSrc = getEffectiveDepthStencilAccess(src, tcu::Sampler::MODE_STENCIL);
4867 const tcu::PixelBufferAccess unclampedSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(m_unclampedExpectedTextureLevel->getAccess(), dstOffset.x, dstOffset.y, dstOffset.z, dstExtent.x, dstExtent.y, dstExtent.z), tcu::Sampler::MODE_STENCIL);
4874 const tcu::ConstPixelBufferAccess srcSubRegion = tcu::getSubregion(src, srcOffset.x, srcOffset.y, srcOffset.z, srcExtent.x, srcExtent.y, srcExtent.z);
4875 const tcu::PixelBufferAccess dstSubRegion = tcu::getSubregion(dst, dstOffset.x, dstOffset.y, dstOffset.z, dstExtent.x, dstExtent.y, dstExtent.z);
4880 const tcu::PixelBufferAccess unclampedSubRegion = tcu::getSubregion(m_unclampedExpectedTextureLevel->getAccess(), dstOffset.x, dstOffset.y, dstOffset.z, dstExtent.x, dstExtent.y, dstExtent.z);
4888 const tcu::ConstPixelBufferAccess src = m_sourceCompressedTexture ? m_sourceCompressedTexture->getDecompressedAccess() : m_sourceTextureLevel->getAccess();
4889 const tcu::ConstPixelBufferAccess dst = m_destinationCompressedTexture ? m_destinationCompressedTexture->getDecompressedAccess() : m_destinationTextureLevel->getAccess();
4907 void BlittingImages::uploadCompressedImage (const VkImage& image, const ImageParms& parms)
4911 const InstanceInterface& vki = m_context.getInstanceInterface();
4912 const DeviceInterface& vk = m_context.getDeviceInterface();
4913 const VkPhysicalDevice vkPhysDevice = m_context.getPhysicalDevice();
4914 const VkDevice vkDevice = m_device;
4915 const VkQueue queue = m_queue;
4918 const deUint32 bufferSize = m_sourceCompressedTexture->getCompressedTexture().getDataSize();
4920 const deUint32 arraySize = getArraySize(parms);
4921 const VkExtent3D imageExtent
4930 const VkBufferCreateInfo bufferParams
4933 DE_NULL, // const void* pNext;
4939 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
4948 const VkBufferMemoryBarrier preBufferBarrier
4951 DE_NULL, // const void* pNext;
4961 const VkImageMemoryBarrier preImageBarrier
4964 DE_NULL, // const void* pNext;
4981 const VkImageMemoryBarrier postImageBarrier
4984 DE_NULL, // const void* pNext;
5001 const VkExtent3D copyExtent
5029 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL,
5032 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &postImageBarrier);
5044 const std::string& name,
5045 const TestParams params)
5050 virtual TestInstance* createInstance (Context& context) const
5055 virtual void checkSupport (Context& context) const
5151 const InstanceInterface& vki = context.getInstanceInterface();
5152 const DeviceInterface& vk = context.getDeviceInterface();
5153 const VkPhysicalDevice vkPhysDevice = context.getPhysicalDevice();
5154 const VkDevice vkDevice = m_device;
5159 const VkImageCreateInfo sourceImageParams =
5162 DE_NULL, // const void* pNext;
5175 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
5186 const VkImageCreateInfo destinationImageParams =
5189 DE_NULL, // const void* pNext;
5202 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
5214 const tcu::TextureFormat srcTcuFormat = mapVkFormat(m_params.src.image.format);
5215 const tcu::TextureFormat dstTcuFormat = mapVkFormat(m_params.dst.image.format);
5232 const DeviceInterface& vk = m_context.getDeviceInterface();
5233 const VkDevice vkDevice = m_device;
5234 const VkQueue queue = m_queue;
5262 const VkImageMemoryBarrier srcImageBarrier =
5265 DE_NULL, // const void* pNext;
5283 const VkImageMemoryBarrier dstImageBarrier =
5286 DE_NULL, // const void* pNext;
5303 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &srcImageBarrier);
5304 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &dstImageBarrier);
5313 const VkBlitImageInfo2KHR BlitImageInfo2KHR =
5316 DE_NULL, // const void* pNext;
5322 ®ions2KHR[0], // const VkImageBlit2KHR* pRegions;
5339 DE_NULL, // const void* pNext;
5367 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &preImageBarrier);
5373 const deUint32 mipLevel = m_params.regions[regionNdx].imageBlit.dstSubresource.mipLevel;
5376 const VkImageMemoryBarrier preImageBarrier =
5379 DE_NULL, // const void* pNext;
5397 const VkImageMemoryBarrier postImageBarrier =
5400 DE_NULL, // const void* pNext;
5417 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &preImageBarrier);
5426 const VkBlitImageInfo2KHR BlitImageInfo2KHR =
5429 DE_NULL, // const void* pNext;
5435 ®ions2KHR[regionNdx], // const VkImageBlit2KHR* pRegions;
5441 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &postImageBarrier);
5446 const VkImageMemoryBarrier postImageBarrier =
5449 DE_NULL, // const void* pNext;
5466 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &postImageBarrier);
5488 const CopyRegion region = m_params.regions[i];
5489 const deUint32 srcMipLevel = m_params.regions[i].imageBlit.srcSubresource.mipLevel;
5490 const deUint32 dstMipLevel = m_params.regions[i].imageBlit.dstSubresource.mipLevel;
5508 const tcu::ConstPixelBufferAccess& resultAccess = resultLevel->getAccess();
5510 const tcu::Sampler::DepthStencilMode mode = tcu::hasDepthComponent(resultAccess.getFormat().order) ? tcu::Sampler::MODE_DEPTH :
5513 const tcu::ConstPixelBufferAccess result = tcu::hasDepthComponent(resultAccess.getFormat().order) ? getEffectiveDepthStencilAccess(resultAccess, mode) :
5516 const tcu::ConstPixelBufferAccess clampedLevel = tcu::hasDepthComponent(resultAccess.getFormat().order) ? getEffectiveDepthStencilAccess(m_expectedTextureLevel[mipLevelNdx]->getAccess(), mode) :
5519 const tcu::ConstPixelBufferAccess unclampedLevel = tcu::hasDepthComponent(resultAccess.getFormat().order) ? getEffectiveDepthStencilAccess(m_unclampedExpectedTextureLevel[mipLevelNdx]->getAccess(), mode) :
5522 const tcu::TextureFormat srcFormat = tcu::hasDepthComponent(resultAccess.getFormat().order) ? tcu::getEffectiveDepthStencilTextureFormat(mapVkFormat(m_params.src.image.format), mode) :
5526 const tcu::TextureFormat dstFormat = result.getFormat();
5538 const bool srcIsSRGB = tcu::isSRGB(srcFormat);
5539 const tcu::Vec4 srcMaxDiff = getFormatThreshold(srcFormat) * tcu::Vec4(srcIsSRGB ? 2.0f : 1.0f);
5540 const tcu::Vec4 dstMaxDiff = getFormatThreshold(dstFormat);
5541 const tcu::Vec4 threshold = ( srcMaxDiff + dstMaxDiff ) * ((m_params.filter == VK_FILTER_CUBIC_EXT)? 1.5f : 1.0f);
5557 const tcu::IVec4 dstBitDepth = tcu::getTextureFormatBitDepth(dstFormat);
5558 const tcu::IVec4 srcBitDepth = tcu::getTextureFormatBitDepth(srcFormat);
5592 const tcu::ConstPixelBufferAccess& resultAccess = resultLevel->getAccess();
5594 const tcu::Sampler::DepthStencilMode mode = tcu::hasDepthComponent(resultAccess.getFormat().order) ? tcu::Sampler::MODE_DEPTH :
5597 const tcu::ConstPixelBufferAccess result = tcu::hasDepthComponent(resultAccess.getFormat().order) ? getEffectiveDepthStencilAccess(resultAccess, mode) :
5600 const tcu::ConstPixelBufferAccess source = (m_params.singleCommand || mipLevelNdx == 0) ? // Read from source image
5608 const tcu::TextureFormat dstFormat = result.getFormat();
5609 const tcu::TextureChannelClass dstChannelClass = tcu::getTextureChannelClass(dstFormat.type);
5631 const tcu::Vec4 srcMaxDiff = getFloatOrFixedPointFormatThreshold(source.getFormat());
5632 const tcu::Vec4 dstMaxDiff = getFloatOrFixedPointFormatThreshold(result.getFormat());
5665 const std::string failMessage("Result image is incorrect");
5685 const MirrorMode mirrorMode = getMirrorMode(region.imageBlit.srcOffsets[0],
5692 const VkOffset3D srcOffset = region.imageBlit.srcOffsets[0];
5693 const VkOffset3D srcExtent =
5699 const VkOffset3D dstOffset = region.imageBlit.dstOffsets[0];
5700 const VkOffset3D dstExtent =
5722 const tcu::ConstPixelBufferAccess srcSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(src, srcOffset.x, srcOffset.y, srcExtent.x, srcExtent.y), tcu::Sampler::MODE_DEPTH);
5723 const tcu::PixelBufferAccess dstSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(dst, dstOffset.x, dstOffset.y, dstExtent.x, dstExtent.y), tcu::Sampler::MODE_DEPTH);
5728 const tcu::ConstPixelBufferAccess depthSrc = getEffectiveDepthStencilAccess(src, tcu::Sampler::MODE_DEPTH);
5729 const tcu::PixelBufferAccess unclampedSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(m_unclampedExpectedTextureLevel[0]->getAccess(), dstOffset.x, dstOffset.y, dstExtent.x, dstExtent.y), tcu::Sampler::MODE_DEPTH);
5737 const tcu::ConstPixelBufferAccess srcSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(src, srcOffset.x, srcOffset.y, srcExtent.x, srcExtent.y), tcu::Sampler::MODE_STENCIL);
5738 const tcu::PixelBufferAccess dstSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(dst, dstOffset.x, dstOffset.y, dstExtent.x, dstExtent.y), tcu::Sampler::MODE_STENCIL);
5743 const tcu::ConstPixelBufferAccess stencilSrc = getEffectiveDepthStencilAccess(src, tcu::Sampler::MODE_STENCIL);
5744 const tcu::PixelBufferAccess unclampedSubRegion = getEffectiveDepthStencilAccess(tcu::getSubregion(m_unclampedExpectedTextureLevel[0]->getAccess(), dstOffset.x, dstOffset.y, dstExtent.x, dstExtent.y), tcu::Sampler::MODE_STENCIL);
5753 const tcu::ConstPixelBufferAccess srcSubRegion = tcu::getSubregion(src, srcOffset.x, srcOffset.y, layerNdx, srcExtent.x, srcExtent.y, 1);
5754 const tcu::PixelBufferAccess dstSubRegion = tcu::getSubregion(dst, dstOffset.x, dstOffset.y, layerNdx, dstExtent.x, dstExtent.y, 1);
5759 const tcu::PixelBufferAccess unclampedSubRegion = tcu::getSubregion(m_unclampedExpectedTextureLevel[mipLevel]->getAccess(), dstOffset.x, dstOffset.y, layerNdx, dstExtent.x, dstExtent.y, 1);
5768 const tcu::ConstPixelBufferAccess src = m_sourceTextureLevel->getAccess();
5769 const tcu::ConstPixelBufferAccess dst = m_destinationTextureLevel->getAccess();
5795 const std::string& name,
5796 const TestParams params)
5801 virtual TestInstance* createInstance (Context& context) const
5806 virtual void checkSupport (Context& context) const
5808 const InstanceInterface& vki = context.getInstanceInterface();
5809 const VkPhysicalDevice vkPhysDevice = context.getPhysicalDevice();
5856 const VkFormatProperties srcFormatProperties = getPhysicalDeviceFormatProperties (vki, vkPhysDevice, m_params.src.image.format);
5862 const VkFormatProperties dstFormatProperties = getPhysicalDeviceFormatProperties (vki, vkPhysDevice, m_params.dst.image.format);
5945 const ResolveImageToImageOptions m_options;
5953 ResolveImageToImage::ResolveImageToImage (Context& context, TestParams params, const ResolveImageToImageOptions options)
5957 const InstanceInterface& vki = m_context.getInstanceInterface();
5980 const DeviceInterface& vk = m_context.getDeviceInterface();
5982 const DeviceInterface& vk = (DE_NULL != m_deviceDriver) ? *m_deviceDriver : m_context.getDeviceInterface();
6000 const VkPhysicalDevice vkPhysDevice = m_context.getPhysicalDevice();
6001 const VkDevice vkDevice = m_device;
6002 const VkComponentMapping componentMappingRGBA = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A };
6015 const VkSampleCountFlagBits rasterizationSamples = m_params.samples;
6022 DE_NULL, // const void* pNext;
6037 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
6097 const VkImageCreateInfo destinationImageParams =
6100 DE_NULL, // const void* pNext;
6113 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
6125 const VkImageMemoryBarrier m_multisampledImageBarrier =
6128 DE_NULL, // const void* pNext;
6144 const VkImageMemoryBarrier m_multisampledCopyImageBarrier =
6147 DE_NULL, // const void* pNext;
6163 const VkImageMemoryBarrier m_multisampledCopyImageNoCabBarrier =
6166 DE_NULL, // const void* pNext;
6199 const VkAttachmentDescription attachmentDescription =
6212 const VkAttachmentReference colorAttachmentReference =
6218 const VkSubpassDescription subpassDescription =
6223 DE_NULL, // const VkAttachmentReference* pInputAttachments;
6225 &colorAttachmentReference, // const VkAttachmentReference* pColorAttachments;
6226 DE_NULL, // const VkAttachmentReference* pResolveAttachments;
6227 DE_NULL, // const VkAttachmentReference* pDepthStencilAttachment;
6229 DE_NULL // const VkAttachmentReference* pPreserveAttachments;
6233 const VkSubpassDependency subpassDependency =
6244 const deBool useSubpassDependency = m_options == COPY_MS_IMAGE_LAYER_TO_MS_IMAGE || m_options == COPY_MS_IMAGE_TO_MS_IMAGE_MULTIREGION;
6245 const VkRenderPassCreateInfo renderPassParams =
6248 DE_NULL, // const void* pNext;
6251 &attachmentDescription, // const VkAttachmentDescription* pAttachments;
6253 &subpassDescription, // const VkSubpassDescription* pSubpasses;
6255 &subpassDependency // const VkSubpassDependency* pDependencies;
6263 const VkPipelineLayoutCreateInfo pipelineLayoutParams =
6266 DE_NULL, // const void* pNext;
6269 DE_NULL, // const VkDescriptorSetLayout* pSetLayouts;
6271 DE_NULL // const VkPushConstantRange* pPushConstantRanges;
6279 const tcu::Vec4 a (-1.0, -1.0, 0.0, 1.0);
6280 const tcu::Vec4 b (1.0, -1.0, 0.0, 1.0);
6281 const tcu::Vec4 c (1.0, 1.0, 0.0, 1.0);
6290 const VkDeviceSize vertexDataSize = vertices.size() * sizeof(tcu::Vec4);
6291 const VkBufferCreateInfo vertexBufferParams =
6294 DE_NULL, // const void* pNext;
6300 (const deUint32*)DE_NULL, // const deUint32* pQueueFamilyIndices;
6320 const VkImageViewCreateInfo colorAttachmentViewParams =
6323 DE_NULL, // const void* pNext;
6336 const VkFramebufferCreateInfo framebufferParams =
6339 DE_NULL, // const void* pNext;
6343 &sourceAttachmentView.get(), // const VkImageView* pAttachments;
6354 const std::vector<VkViewport> viewports (1, makeViewport(m_params.src.image.extent));
6355 const std::vector<VkRect2D> scissors (1, makeRect2D(m_params.src.image.extent));
6357 const VkPipelineMultisampleStateCreateInfo multisampleStateParams =
6360 DE_NULL, // const void* pNext;
6365 DE_NULL, // const VkSampleMask* pSampleMask;
6370 graphicsPipeline = makeGraphicsPipeline(vk, // const DeviceInterface& vk
6371 vkDevice, // const VkDevice device
6372 *pipelineLayout, // const VkPipelineLayout pipelineLayout
6373 *vertexShaderModule, // const VkShaderModule vertexShaderModule
6374 DE_NULL, // const VkShaderModule tessellationControlModule
6375 DE_NULL, // const VkShaderModule tessellationEvalModule
6376 DE_NULL, // const VkShaderModule geometryShaderModule
6377 *fragmentShaderModule, // const VkShaderModule fragmentShaderModule
6378 *renderPass, // const VkRenderPass renderPass
6379 viewports, // const std::vector<VkViewport>& viewports
6380 scissors, // const std::vector<VkRect2D>& scissors
6381 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, // const VkPrimitiveTopology topology
6382 0u, // const deUint32 subpass
6383 0u, // const deUint32 patchControlPoints
6384 DE_NULL, // const VkPipelineVertexInputStateCreateInfo* vertexInputStateCreateInfo
6385 DE_NULL, // const VkPipelineRasterizationStateCreateInfo* rasterizationStateCreateInfo
6386 &multisampleStateParams); // const VkPipelineMultisampleStateCreateInfo* multisampleStateCreateInfo
6396 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, (uint32_t)srcImageBarriers.size(), srcImageBarriers.data());
6400 const VkClearColorValue clearValue = {{0.0f, 0.0f, 0.0f, 1.0f}};
6401 const auto clearRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, m_params.src.image.extent.depth);
6407 const VkClearColorValue clearValue = {{1.0f, 1.0f, 1.0f, 1.0f}};
6408 const auto clearRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, m_params.src.image.extent.depth);
6415 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, (uint32_t)srcImageBarriers.size(), srcImageBarriers.data());
6420 const VkDeviceSize vertexBufferOffset = 0u;
6440 const tcu::TextureFormat srcTcuFormat = mapVkFormat(m_params.src.image.format);
6441 const tcu::TextureFormat dstTcuFormat = mapVkFormat(m_params.dst.image.format);
6480 const DeviceInterface& vk = m_context.getDeviceInterface();
6481 const VkDevice vkDevice = m_device;
6482 const VkQueue queue = m_queue;
6496 const VkImageResolve imageResolve =
6529 const VkImageMemoryBarrier imageBarriers[] =
6534 DE_NULL, // const void* pNext;
6555 DE_NULL, // const void* pNext;
6573 const VkImageMemoryBarrier postImageBarrier =
6576 DE_NULL, // const void* pNext;
6594 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, DE_LENGTH_OF_ARRAY(imageBarriers), imageBarriers);
6603 const VkResolveImageInfo2KHR ResolveImageInfo2KHR =
6606 DE_NULL, // const void* pNext;
6612 imageResolves2KHR.data() // const VkImageResolve2KHR* pRegions;
6617 vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &postImageBarrier);
6628 const auto intermediateResult = checkIntermediateCopy();
6638 const tcu::ConstPixelBufferAccess expected = m_expectedTextureLevel[0]->getAccess();
6639 const float fuzzyThreshold = 0.01f;
6647 const tcu::ConstPixelBufferAccess resultSub = getSubregion (result, 0u, 0u, arrayLayerNdx, result.getWidth(), result.getHeight(), 1u);
6653 const tcu::ConstPixelBufferAccess expectedSub = getSubregion (expected, 0u, 0u, 2u, expected.getWidth(), expected.getHeight(), 1u);
6654 const tcu::ConstPixelBufferAccess resultSub = getSubregion (result, 0u, 0u, 4u, result.getWidth(), result.getHeight(), 1u);
6662 const tcu::ConstPixelBufferAccess expectedSub = getSubregion (expected, 0u, 0u, arrayLayerNdx, expected.getWidth(), expected.getHeight(), 1u);
6663 const tcu::ConstPixelBufferAccess resultSub = getSubregion (result, 0u, 0u, arrayLayerNdx, result.getWidth(), result.getHeight(), 1u);
6685 const tcu::ConstPixelBufferAccess srcSubRegion = getSubregion (src, srcOffset.x, srcOffset.y, srcOffset.z, extent.width, extent.height, extent.depth);
6687 const tcu::PixelBufferAccess dstWithSrcFormat (srcSubRegion.getFormat(), dst.getSize(), dst.getDataPtr());
6688 const tcu::PixelBufferAccess dstSubRegion = getSubregion (dstWithSrcFormat, dstOffset.x, dstOffset.y, dstOffset.z, extent.width, extent.height, extent.depth);
6695 const auto& vkd = m_context.getDeviceInterface();
6696 const auto device = m_device;
6697 const auto queue = m_queue;
6698 const auto queueIndex = m_context.getUniversalQueueFamilyIndex();
6700 const auto currentLayout = m_params.src.image.operationLayout;
6701 const auto numDstLayers = getArraySize(m_params.dst.image);
6702 const auto numInputAttachments = m_options == COPY_MS_IMAGE_LAYER_TO_MS_IMAGE ? 2u : numDstLayers + 1u; // For the source image.
6704 const auto fbWidth = m_params.src.image.extent.width;
6705 const auto fbHeight = m_params.src.image.extent.height;
6708 const std::array<int, 3> pushConstantData =
6714 const auto pushConstantSize = static_cast<deUint32>(pushConstantData.size() * sizeof(decltype(pushConstantData)::value_type));
6717 const auto vertexModule = createShaderModule(vkd, device, m_context.getBinaryCollection().get("vert"), 0u);
6718 const auto verificationModule = createShaderModule(vkd, device, m_context.getBinaryCollection().get("verify"), 0u);
6724 const auto descriptorPool = poolBuilder.build(vkd, device, VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, numSets);
6728 const auto outputBufferSetLayout = layoutBuilderBuffer.build(vkd, device);
6733 const auto inputAttachmentsSetLayout = layoutBuilderAttachments.build(vkd, device);
6735 const auto descriptorSetBuffer = makeDescriptorSet(vkd, device, descriptorPool.get(), outputBufferSetLayout.get());
6736 const auto descriptorSetAttachments = makeDescriptorSet(vkd, device, descriptorPool.get(), inputAttachmentsSetLayout.get());
6739 const std::array<VkDescriptorSet, numSets> descriptorSets =
6746 const std::array<VkDescriptorSetLayout, numSets> setLayouts =
6752 const VkPushConstantRange pushConstantRange =
6759 const VkPipelineLayoutCreateInfo pipelineLayoutInfo =
6762 nullptr, // const void* pNext;
6765 setLayouts.data(), // const VkDescriptorSetLayout* pSetLayouts;
6767 &pushConstantRange, // const VkPushConstantRange* pPushConstantRanges;
6770 const auto pipelineLayout = createPipelineLayout(vkd, device, &pipelineLayoutInfo);
6773 const VkAttachmentDescription commonAttachmentDescription =
6785 const std::vector<VkAttachmentDescription> attachmentDescriptions(numInputAttachments, commonAttachmentDescription);
6791 const VkAttachmentReference reference = { i, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL };
6795 const VkSubpassDescription subpassDescription =
6800 inputAttachmentReferences.data(), // const VkAttachmentReference* pInputAttachments;
6802 nullptr, // const VkAttachmentReference* pColorAttachments;
6803 nullptr, // const VkAttachmentReference* pResolveAttachments;
6804 nullptr, // const VkAttachmentReference* pDepthStencilAttachment;
6806 nullptr, // const deUint32* pPreserveAttachments;
6809 const VkRenderPassCreateInfo renderPassInfo =
6812 nullptr, // const void* pNext;
6815 attachmentDescriptions.data(), // const VkAttachmentDescription* pAttachments;
6817 &subpassDescription, // const VkSubpassDescription* pSubpasses;
6819 nullptr, // const VkSubpassDependency* pDependencies;
6822 const auto renderPass = createRenderPass(vkd, device, &renderPassInfo);
6839 const auto subresourceRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, i, 1u);
6846 std::transform(begin(imageViews), end(imageViews), std::back_inserter(imageViewsRaw), [](const Move<VkImageView>& ptr) { return ptr.get(); });
6848 const auto framebuffer = makeFramebuffer(vkd, device, renderPass.get(), static_cast<deUint32>(imageViewsRaw.size()), imageViewsRaw.data(), fbWidth, fbHeight);
6851 const auto bufferCount = static_cast<size_t>(fbWidth * fbHeight * m_params.samples);
6852 const auto bufferSize = static_cast<VkDeviceSize>(bufferCount * sizeof(deInt32));
6860 const auto bufferInfo = makeDescriptorBufferInfo(buffer.get(), 0ull, bufferSize);
6877 const tcu::Vec4 topLeft (-1.0f, -1.0f, 0.0f, 1.0f);
6878 const tcu::Vec4 topRight ( 1.0f, -1.0f, 0.0f, 1.0f);
6879 const tcu::Vec4 bottomLeft (-1.0f, 1.0f, 0.0f, 1.0f);
6880 const tcu::Vec4 bottomRight ( 1.0f, 1.0f, 0.0f, 1.0f);
6891 const auto vertexBufferSize = static_cast<VkDeviceSize>(fullScreenQuad.size() * sizeof(decltype(fullScreenQuad)::value_type));
6892 const auto vertexBufferInfo = makeBufferCreateInfo(vertexBufferSize, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT);
6893 const BufferWithMemory vertexBuffer (vkd, device, alloc, vertexBufferInfo, MemoryRequirement::HostVisible);
6894 const auto vertexBufferHandler = vertexBuffer.get();
6897 const VkDeviceSize vertexBufferOffset = 0ull;
6903 const std::vector<VkViewport> viewports (1, makeViewport(m_params.src.image.extent));
6904 const std::vector<VkRect2D> scissors (1, makeRect2D(m_params.src.image.extent));
6906 const VkPipelineMultisampleStateCreateInfo multisampleStateParams =
6909 nullptr, // const void* pNext;
6914 nullptr, // const VkSampleMask* pSampleMask;
6919 const auto graphicsPipeline = makeGraphicsPipeline(
6920 vkd, // const DeviceInterface& vk
6921 device, // const VkDevice device
6922 pipelineLayout.get(), // const VkPipelineLayout pipelineLayout
6923 vertexModule.get(), // const VkShaderModule vertexShaderModule
6924 DE_NULL, // const VkShaderModule tessellationControlModule
6925 DE_NULL, // const VkShaderModule tessellationEvalModule
6926 DE_NULL, // const VkShaderModule geometryShaderModule
6927 verificationModule.get(), // const VkShaderModule fragmentShaderModule
6928 renderPass.get(), // const VkRenderPass renderPass
6929 viewports, // const std::vector<VkViewport>& viewports
6930 scissors, // const std::vector<VkRect2D>& scissors
6931 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, // const VkPrimitiveTopology topology
6932 0u, // const deUint32 subpass
6933 0u, // const deUint32 patchControlPoints
6934 nullptr, // const VkPipelineVertexInputStateCreateInfo* vertexInputStateCreateInfo
6935 nullptr, // const VkPipelineRasterizationStateCreateInfo* rasterizationStateCreateInfo
6936 &multisampleStateParams); // const VkPipelineMultisampleStateCreateInfo* multisampleStateCreateInfo
6939 const auto cmdPool = makeCommandPool(vkd, device, queueIndex);
6940 const auto cmdBufferPtr = allocateCommandBuffer(vkd, device, cmdPool.get(), VK_COMMAND_BUFFER_LEVEL_PRIMARY);
6941 const auto cmdBuffer = cmdBufferPtr.get();
6944 const auto imagesBarrier = makeMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_INPUT_ATTACHMENT_READ_BIT);
6947 const auto bufferBarrier = makeMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT);
6972 const auto sampleCount = static_cast<deUint32>(m_params.samples);
6978 const auto index = (y * fbWidth + x) * sampleCount + s;
6993 const bool useTwoQueues = m_options == COPY_MS_IMAGE_TO_MS_IMAGE_COMPUTE || m_options == COPY_MS_IMAGE_TO_MS_IMAGE_TRANSFER;
6994 const DeviceInterface& vk = m_context.getDeviceInterface();
6995 const VkDevice vkDevice = m_device;
6996 const VkQueue queue = useTwoQueues ? m_alternativeQueue : m_queue;
6997 const VkCommandBuffer commandBuffer = useTwoQueues ? m_alternativeCmdBuffer.get() : m_cmdBuffer.get();
6998 const VkCommandPool commandPool = useTwoQueues ? m_alternativeCmdPool.get() : m_cmdPool.get();
6999 const tcu::TextureFormat srcTcuFormat = mapVkFormat(m_params.src.image.format);
7005 const VkImageSubresourceLayers sourceSubresourceLayers =
7013 const VkImageSubresourceLayers destinationSubresourceLayers =
7021 const VkImageCopy imageCopy =
7048 const VkImageCopy imageCopy =
7072 const VkImageSubresourceLayers sourceSubresourceLayers =
7080 const VkImageSubresourceLayers destinationSubresourceLayers =
7088 const VkImageCopy imageCopy =
7118 const VkImageMemoryBarrier m_multisampledImageBarrier =
7121 DE_NULL, // const void* pNext;
7141 DE_NULL, // const void* pNext;
7153 const VkImageMemoryBarrier m_multisampledCopyNoCabImageBarrier =
7156 DE_NULL, // const void* pNext;
7168 const VkImageMemoryBarrier multisampledCopyImagePostBarrier =
7171 DE_NULL, // const void* pNext;
7183 const VkImageMemoryBarrier betweenCopyImageBarrier =
7186 DE_NULL, // const void* pNext;
7220 vk.cmdPipelineBarrier(m_cmdBuffer.get(), VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, (uint32_t)barriers.size(), barriers.data());
7246 vk.cmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, (uint32_t)barriers.size(), barriers.data());
7269 vk.cmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, (uint32_t)imageBarriers.size(), imageBarriers.data());
7277 vk.cmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1u, &betweenCopyImageBarrier);
7290 const VkCopyImageInfo2KHR copyImageInfo2KHR =
7293 DE_NULL, // const void* pNext;
7299 imageCopies2KHR.data() // const VkImageCopy2KHR* pRegions;
7301 const VkCopyImageInfo2KHR copyImageInfo2KHRCopy =
7304 DE_NULL, // const void* pNext;
7310 imageCopies2KHR.data() // const VkImageCopy2KHR* pRegions;
7314 vk.cmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1u, &betweenCopyImageBarrier);
7320 const VkCopyImageInfo2KHR copyImageInfo2KHR =
7323 DE_NULL, // const void* pNext;
7329 imageCopies2KHR.data() // const VkImageCopy2KHR* pRegions;
7367 vk.cmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, (uint32_t)barriers.size(), barriers.data());
7390 vk.cmdPipelineBarrier(m_cmdBuffer.get(), VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, (uint32_t)barriers.size(), barriers.data());
7398 vk.cmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1u, &multisampledCopyImagePostBarrier);
7409 const std::string& name,
7410 const TestParams params,
7411 const ResolveImageToImageOptions options = NO_OPTIONAL_OPERATION)
7417 virtual void initPrograms (SourceCollections& programCollection) const;
7419 virtual TestInstance* createInstance (Context& context) const
7424 virtual void checkSupport (Context& context) const
7426 const VkSampleCountFlagBits rasterizationSamples = m_params.samples;
7460 const std::vector<VkQueueFamilyProperties> queueFamilies = getPhysicalDeviceQueueFamilyProperties(context.getInstanceInterface(), context.getPhysicalDevice());
7461 for (const auto& queueFamily : queueFamilies)
7477 const std::vector<VkQueueFamilyProperties> queueFamilies = getPhysicalDeviceQueueFamilyProperties(context.getInstanceInterface(), context.getPhysicalDevice());
7478 for (const auto& queueFamily : queueFamilies)
7493 const ResolveImageToImageOptions m_options;
7496 void ResolveImageToImageTestCase::initPrograms (SourceCollections& programCollection) const
7538 const auto dstLayers = getArraySize(m_params.dst.image);
7548 const auto i = layerNdx + 1u;
7572 const auto i = layerNdx + 1u;
7578 const auto i = layerNdx + 1u;
7620 const VkImageAspectFlagBits& aspectToVerify,
7629 for (const auto ®ion : m_regions)
7639 const TestParameters m_params;
7640 const float m_clearValue = 0.0f;
7663 const VkImageSubresourceLayers depthSubresourceLayers =
7671 const VkImageSubresourceLayers stencilSubresourceLayers =
7767 const DeviceInterface& vk = m_context.getDeviceInterface();
7768 const InstanceInterface& vki = m_context.getInstanceInterface();
7769 const VkDevice vkDevice = m_context.getDevice();
7770 const VkPhysicalDevice vkPhysDevice = m_context.getPhysicalDevice();
7771 const VkQueue queue = m_context.getUniversalQueue();
7772 const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex();
7777 const tcu::TextureFormat srcTcuFormat = mapVkFormat(m_srcImage.format);
7778 const tcu::TextureFormat dstTcuFormat = mapVkFormat(m_dstImage.format);
7789 const VkComponentMapping componentMappingRGBA = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A };
7804 DE_NULL, // const void* pNext;
7819 &queueFamilyIndex, // const deUint32* pQueueFamilyIndices;
7839 const VkImageLayout initialLayout = m_params.copyOptions == COPY_ARRAY_TO_ARRAY ? VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL : VK_IMAGE_LAYOUT_UNDEFINED;
7840 const VkAttachmentDescription attachmentDescription =
7853 const VkAttachmentReference attachmentReference =
7859 const VkSubpassDescription subpassDescription =
7864 DE_NULL, // const VkAttachmentReference* pInputAttachments
7866 DE_NULL, // const VkAttachmentReference* pColorAttachments
7867 DE_NULL, // const VkAttachmentReference* pResolveAttachments
7868 &attachmentReference, // const VkAttachmentReference* pDepthStencilAttachment
7870 DE_NULL // const VkAttachmentReference* pPreserveAttachments
7873 const VkRenderPassCreateInfo renderPassParams =
7876 DE_NULL, // const void* pNext;
7879 &attachmentDescription, // const VkAttachmentDescription* pAttachments;
7881 &subpassDescription, // const VkSubpassDescription* pSubpasses;
7883 DE_NULL // const VkSubpassDependency* pDependencies;
7891 const VkPipelineLayoutCreateInfo pipelineLayoutParams =
7894 DE_NULL, // const void* pNext;
7897 DE_NULL, // const VkDescriptorSetLayout* pSetLayouts;
7899 DE_NULL // const VkPushConstantRange* pPushConstantRanges;
7915 const VkDeviceSize vertexDataSize = vertices.size() * sizeof(tcu::Vec4);
7916 const VkBufferCreateInfo vertexBufferParams =
7919 DE_NULL, // const void* pNext;
7925 &queueFamilyIndex // const deUint32* pQueueFamilyIndices;
7943 const uint32_t arrayLayer = m_params.copyOptions == COPY_ARRAY_TO_ARRAY ? 2u : 0u;
7944 const VkImageViewCreateInfo depthStencilAttachmentViewParams =
7947 DE_NULL, // const void* pNext;
7960 const VkFramebufferCreateInfo framebufferParams =
7963 DE_NULL, // const void* pNext;
7967 &sourceAttachmentView.get(), // const VkImageView* pAttachments;
7978 const std::vector<VkViewport> viewports (1, makeViewport(m_srcImage.extent));
7979 const std::vector<VkRect2D> scissors (1, makeRect2D(m_srcImage.extent));
7981 const VkPipelineMultisampleStateCreateInfo multisampleStateParams =
7984 DE_NULL, // const void* pNext;
7989 DE_NULL, // const VkSampleMask* pSampleMask;
7994 const VkStencilOpState stencilOpState =
8005 const VkPipelineDepthStencilStateCreateInfo depthStencilStateCreateInfoDefault =
8008 DE_NULL, // const void* pNext
8021 graphicsPipeline = makeGraphicsPipeline(vk, // const DeviceInterface& vk
8022 vkDevice, // const VkDevice device
8023 *pipelineLayout, // const VkPipelineLayout pipelineLayout
8024 *vertexShaderModule, // const VkShaderModule vertexShaderModule
8025 DE_NULL, // const VkShaderModule tessellationControlModule
8026 DE_NULL, // const VkShaderModule tessellationEvalModule
8027 DE_NULL, // const VkShaderModule geometryShaderModule
8028 *fragmentShaderModule, // const VkShaderModule fragmentShaderModule
8029 *renderPass, // const VkRenderPass renderPass
8030 viewports, // const std::vector<VkViewport>& viewports
8031 scissors, // const std::vector<VkRect2D>& scissors
8032 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, // const VkPrimitiveTopology topology
8033 0u, // const deUint32 subpass
8034 0u, // const deUint32 patchControlPoints
8035 DE_NULL, // const VkPipelineVertexInputStateCreateInfo* vertexInputStateCreateInfo
8036 DE_NULL, // const VkPipelineRasterizationStateCreateInfo* rasterizationStateCreateInfo
8037 &multisampleStateParams, // const VkPipelineMultisampleStateCreateInfo* multisampleStateCreateInfo
8038 &depthStencilStateCreateInfoDefault); // const VkPipelineDepthStencilStateCreateInfo* depthStencilStateCreateInfo
8045 const VkClearValue srcImageClearValue = makeClearValueDepthStencil(0.1f, 0x10);
8048 const VkClearValue copiedImageClearValue = makeClearValueDepthStencil(m_clearValue, (uint32_t)m_clearValue);
8049 const auto subResourceRange = makeImageSubresourceRange( // VkImageSubresourceRange subresourceRange
8056 const VkImageMemoryBarrier preClearBarrier = makeImageMemoryBarrier(
8066 (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 2, preClearBarriers.data());
8072 &srcImageClearValue.depthStencil, // const VkClearDepthStencilValue* pDepthStencil
8074 &subResourceRange); // const VkImageSubresourceRange* pRanges
8080 &copiedImageClearValue.depthStencil, // const VkClearDepthStencilValue* pDepthStencil
8082 &subResourceRange); // const VkImageSubresourceRange* pRanges
8085 const VkImageMemoryBarrier postClearBarrier = makeImageMemoryBarrier(
8094 (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &postClearBarrier);
8098 const VkDeviceSize vertexBufferOffset = 0u;
8118 const VkImageMemoryBarrier imageBarriers[] =
8150 (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 2u, imageBarriers);
8155 for (const auto & region : m_regions)
8175 const VkCopyImageInfo2KHR copyImageInfo2KHR =
8178 DE_NULL, // const void* pNext;
8184 imageCopies2KHR.data() // const VkImageCopy2KHR* pRegions;
8195 const auto usedImageAspects = getUsedImageAspects();
8211 tcu::TestStatus DepthStencilMSAA::checkCopyResults (VkCommandBuffer cmdBuffer, const VkImageAspectFlagBits& aspectToVerify, VkImage srcImage, VkImage dstImage)
8215 const auto& vkd = m_context.getDeviceInterface();
8216 const auto device = m_context.getDevice();
8217 const auto queue = m_context.getUniversalQueue();
8219 const auto layerCount = getArraySize(m_srcImage);
8220 const auto numInputAttachments = layerCount + 1u; // +1 for the source image.
8221 const auto numOutputBuffers = 2u; // 1 for the reference and 1 for the copied values.
8222 const auto numSets = 2u; // 1 for the output buffers, 1 for the input attachments.
8223 const auto fbWidth = m_srcImage.extent.width;
8224 const auto fbHeight = m_srcImage.extent.height;
8225 const auto aspectFlags = getUsedImageAspects();
8228 const auto vertexModule = createShaderModule(vkd, device, m_context.getBinaryCollection().get("vert"), 0u);
8229 const auto verificationModule = createShaderModule(vkd, device, m_context.getBinaryCollection().get(aspectToVerify & VK_IMAGE_ASPECT_DEPTH_BIT ? "verify_depth" : "verify_stencil"), 0u);
8235 const auto descriptorPool = poolBuilder.build(vkd, device, VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, numSets);
8240 const auto outputBufferSetLayout = layoutBuilderBuffer.build(vkd, device);
8245 const auto inputAttachmentsSetLayout = layoutBuilderAttachments.build(vkd, device);
8247 const auto descriptorSetBuffer = makeDescriptorSet(vkd, device, descriptorPool.get(), outputBufferSetLayout.get());
8248 const auto descriptorSetAttachments = makeDescriptorSet(vkd, device, descriptorPool.get(), inputAttachmentsSetLayout.get());
8251 const std::array<VkDescriptorSet, numSets> descriptorSets =
8258 const std::array<VkDescriptorSetLayout, numSets> setLayouts =
8272 const auto pushConstantSize = static_cast<deUint32>(pushConstantData.size() * sizeof(decltype(pushConstantData)::value_type));
8274 const VkPushConstantRange pushConstantRange =
8281 const VkPipelineLayoutCreateInfo pipelineLayoutInfo =
8284 nullptr, // const void* pNext;
8287 setLayouts.data(), // const VkDescriptorSetLayout* pSetLayouts;
8289 &pushConstantRange, // const VkPushConstantRange* pPushConstantRanges;
8292 const auto pipelineLayout = createPipelineLayout(vkd, device, &pipelineLayoutInfo);
8295 const VkAttachmentDescription commonAttachmentDescription =
8316 const VkAttachmentReference reference = { i, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL };
8320 const VkSubpassDescription subpassDescription =
8325 inputAttachmentReferences.data(), // const VkAttachmentReference* pInputAttachments;
8327 nullptr, // const VkAttachmentReference* pColorAttachments;
8328 nullptr, // const VkAttachmentReference* pResolveAttachments;
8329 nullptr, // const VkAttachmentReference* pDepthStencilAttachment;
8331 nullptr, // const deUint32* pPreserveAttachments;
8334 const VkRenderPassCreateInfo renderPassInfo =
8337 nullptr, // const void* pNext;
8340 attachmentDescriptions.data(), // const VkAttachmentDescription* pAttachments;
8342 &subpassDescription, // const VkSubpassDescription* pSubpasses;
8344 nullptr, // const VkSubpassDependency* pDependencies;
8347 const auto renderPass = createRenderPass(vkd, device, &renderPassInfo);
8353 const uint32_t srcArrayLayer = m_params.copyOptions == COPY_ARRAY_TO_ARRAY ? 2u : 0u;
8357 const auto subresourceRange = makeImageSubresourceRange(aspectFlags, 0u, 1u, i, 1u);
8362 std::transform(begin(imageViews), end(imageViews), std::back_inserter(imageViewsRaw), [](const Move<VkImageView>& ptr) { return ptr.get(); });
8364 const auto framebuffer = makeFramebuffer(vkd, device, renderPass.get(), static_cast<deUint32>(imageViewsRaw.size()), imageViewsRaw.data(), fbWidth, fbHeight);
8367 const auto bufferCount = static_cast<size_t>(fbWidth * fbHeight * m_params.samples);
8368 const auto bufferSize = static_cast<VkDeviceSize>(bufferCount * sizeof(float));
8377 const auto bufferOriginalInfo = makeDescriptorBufferInfo(bufferOriginal.get(), 0ull, bufferSize);
8378 const auto bufferCopiedInfo = makeDescriptorBufferInfo(bufferCopied.get(), 0ull, bufferSize);
8396 const tcu::Vec4 topLeft (-1.0f, -1.0f, 0.0f, 1.0f);
8397 const tcu::Vec4 topRight ( 1.0f, -1.0f, 0.0f, 1.0f);
8398 const tcu::Vec4 bottomLeft (-1.0f, 1.0f, 0.0f, 1.0f);
8399 const tcu::Vec4 bottomRight ( 1.0f, 1.0f, 0.0f, 1.0f);
8410 const auto vertexBufferSize = static_cast<VkDeviceSize>(fullScreenQuad.size() * sizeof(decltype(fullScreenQuad)::value_type));
8411 const auto vertexBufferInfo = makeBufferCreateInfo(vertexBufferSize, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT);
8412 const BufferWithMemory vertexBuffer (vkd, device, alloc, vertexBufferInfo, MemoryRequirement::HostVisible);
8413 const VkDeviceSize vertexBufferOffset = 0ull;
8419 const std::vector<VkViewport> viewports (1, makeViewport(m_srcImage.extent));
8420 const std::vector<VkRect2D> scissors (1, makeRect2D(m_srcImage.extent));
8422 const VkPipelineMultisampleStateCreateInfo multisampleStateParams =
8425 nullptr, // const void* pNext;
8430 nullptr, // const VkSampleMask* pSampleMask;
8435 const auto graphicsPipeline = makeGraphicsPipeline(
8436 vkd, // const DeviceInterface& vk
8437 device, // const VkDevice device
8438 pipelineLayout.get(), // const VkPipelineLayout pipelineLayout
8439 vertexModule.get(), // const VkShaderModule vertexShaderModule
8440 DE_NULL, // const VkShaderModule tessellationControlModule
8441 DE_NULL, // const VkShaderModule tessellationEvalModule
8442 DE_NULL, // const VkShaderModule geometryShaderModule
8443 verificationModule.get(), // const VkShaderModule fragmentShaderModule
8444 renderPass.get(), // const VkRenderPass renderPass
8445 viewports, // const std::vector<VkViewport>& viewports
8446 scissors, // const std::vector<VkRect2D>& scissors
8447 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, // const VkPrimitiveTopology topology
8448 0u, // const deUint32 subpass
8449 0u, // const deUint32 patchControlPoints
8450 nullptr, // const VkPipelineVertexInputStateCreateInfo* vertexInputStateCreateInfo
8451 nullptr, // const VkPipelineRasterizationStateCreateInfo* rasterizationStateCreateInfo
8452 &multisampleStateParams); // const VkPipelineMultisampleStateCreateInfo* multisampleStateCreateInfo
8455 const auto imagesBarrier = makeMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_INPUT_ATTACHMENT_READ_BIT);
8471 const auto bufferBarrier = makeMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT);
8487 const auto sampleCount = static_cast<deUint32>(m_params.samples);
8490 for (const auto ®ion : m_regions)
8498 const auto srcIndex = (srcCoord.y() * fbWidth + srcCoord.x()) * sampleCount + s;
8499 const auto dstIndex = (dstCoord.y() * fbWidth + dstCoord.x()) * sampleCount + s;
8518 const auto bufferIndex = (y * fbWidth + x) * sampleCount + s;
8537 const std::string& name,
8538 const DepthStencilMSAA::TestParameters testParams)
8543 virtual void initPrograms (SourceCollections& programCollection) const;
8545 virtual TestInstance* createInstance (Context& context) const
8550 virtual void checkSupport (Context& context) const
8554 const VkSampleCountFlagBits rasterizationSamples = m_params.samples;
8584 uint32_t getArrayLayerCount () const
8589 void createVerificationShader (std::ostringstream& shaderCode, const VkImageAspectFlagBits attachmentAspect) const
8618 const auto layerCount = getArrayLayerCount();
8621 const auto i = layerNdx + 1u;
8639 const auto i = layerNdx + 1u;
8658 const auto i = layerNdx + 1u;
8674 void DepthStencilMSAATestCase::initPrograms (SourceCollections& programCollection) const
8716 void checkZerosAt(const std::vector<deUint8>& bufferData, deUint32 from, deUint32 count)
8721 const auto& val = bufferData[from + i];
8741 const auto& vkd = ctx.getDeviceInterface();
8742 const auto device = ctx.getDevice();
8744 const auto qIndex = ctx.getUniversalQueueFamilyIndex();
8745 const auto queue = ctx.getUniversalQueue();
8747 const auto srcBufferInfo = makeBufferCreateInfo(kBufferSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT);
8748 const auto dstBufferInfo = makeBufferCreateInfo(kBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT);
8772 const auto blockStart = kBlockSize * i;
8773 const auto copySize = i + 1u;
8774 const auto bufferCopy = makeBufferCopy(params.srcOffset + blockStart, params.dstOffset + blockStart, copySize);
8778 const auto cmdPool = makeCommandPool(vkd, device, qIndex);
8779 const auto cmdBufferPtr = allocateCommandBuffer(vkd, device, cmdPool.get(), VK_COMMAND_BUFFER_LEVEL_PRIMARY);
8780 const auto cmdBuffer = cmdBufferPtr.get();
8784 const auto barrier = makeMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT);
8796 const auto blockStart = kBlockSize * blockIdx;
8797 const auto copySize = blockIdx + 1u;
8805 const auto& dstVal = dstData[blockStart + params.dstOffset + i];
8806 const auto& srcVal = srcData[blockStart + params.srcOffset + i];
8877 const VkImageCopy testCopy =
8911 const VkImageCopy testCopy =
8945 const VkImageCopy testCopy =
8962 static const struct
8972 static const struct
8981 static const struct
8991 for (const auto& format : formats)
8993 for (const auto& clear : clears)
8998 for (const auto& extent : extents)
9038 const std::string testCaseName = "partial_image_" + extent.name + "_" + format.name + "_" + clear.name;
9062 const VkImageSubresourceLayers sourceLayer =
9069 const VkImageCopy testCopy =
9103 const VkImageSubresourceLayers sourceLayer =
9110 const VkImageCopy testCopy =
9131 const VkFormat* compatibleFormats;
9136 const VkImageLayout copySrcLayouts[] =
9141 const VkImageLayout copyDstLayouts[] =
9155 const std::string testName = getImageLayoutCaseName(params.src.image.operationLayout) + "_" +
9157 const std::string description = "From layout " + getImageLayoutCaseName(params.src.image.operationLayout) +
9164 bool isAllowedImageToImageAllFormatsColorSrcFormatTests(const CopyColorTestParams& testParams)
9183 const VkFormat srcFormatOnly[2] = { testParams.params.src.image.format, VK_FORMAT_UNDEFINED };
9184 const VkFormat* formatList = (testParams.compatibleFormats ? testParams.compatibleFormats : srcFormatOnly);
9190 const VkFormat srcFormat = testParams.params.src.image.format;
9191 const VkFormat dstFormat = testParams.params.dst.image.format;
9203 const std::string description = "Copy to destination format " + getFormatCaseName(dstFormat);
9208 const VkFormat compatibleFormats8Bit[] =
9222 const VkFormat compatibleFormats8BitA[] =
9230 const VkFormat compatibleFormats16Bit[] =
9261 const VkFormat compatibleFormats24Bit[] =
9280 const VkFormat compatibleFormats32Bit[] =
9328 const VkFormat compatibleFormats48Bit[] =
9340 const VkFormat compatibleFormats64Bit[] =
9373 const VkFormat compatibleFormats96Bit[] =
9381 const VkFormat compatibleFormats128Bit[] =
9438 const VkFormat compatibleFormats192Bit[] =
9446 const VkFormat compatibleFormats256Bit[] =
9455 const VkFormat* colorImageFormatsToTest[] =
9470 const VkFormat compatibleFormatsUInts[] =
9496 const VkFormat compatibleFormatsSInts[] =
9522 const VkFormat compatibleFormatsFloats[] =
9613 const VkFormat compressedFormatsFloats[] =
9651 const VkFormat compatibleFormatsSrgb[] =
9664 const VkFormat compressedFormatsSrgb[] =
9692 const VkFormat dedicatedAllocationImageToImageFormatsToTest[] =
9739 const int numOfDedicatedAllocationImageToImageFormatsToTest = DE_LENGTH_OF_ARRAY(dedicatedAllocationImageToImageFormatsToTest);
9764 const VkImageCopy testCopy =
9779 const int numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTest);
9782 const VkFormat* compatibleFormats = colorImageFormatsToTest[compatibleFormatsIndex];
9793 const std::string testName = getFormatCaseName(params.src.image.format);
9821 const VkImageCopy testCopy =
9836 const int numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTest);
9839 const VkFormat* compatibleFormats = colorImageFormatsToTest[compatibleFormatsIndex];
9850 const std::string testName = getFormatCaseName(params.src.image.format);
9880 const VkImageCopy testCopy =
9896 const int numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTest);
9899 const VkFormat* compatibleFormats = colorImageFormatsToTest[compatibleFormatsIndex];
9910 const std::string testName = getFormatCaseName(params.src.image.format);
9938 const VkImageCopy testCopy =
9953 const int numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTest);
9956 const VkFormat* compatibleFormats = colorImageFormatsToTest[compatibleFormatsIndex];
9967 const std::string testName = getFormatCaseName(params.src.image.format);
9994 const VkImageCopy testCopy =
10009 const int numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTest);
10012 const VkFormat* compatibleFormats = colorImageFormatsToTest[compatibleFormatsIndex];
10023 const std::string testName = getFormatCaseName(params.src.image.format);
10051 const VkImageCopy testCopy =
10066 const int numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTest);
10069 const VkFormat* compatibleFormats = colorImageFormatsToTest[compatibleFormatsIndex];
10080 const std::string testName = getFormatCaseName(params.src.image.format);
10110 const VkImageCopy testCopy =
10126 const int numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTest);
10129 const VkFormat* compatibleFormats = colorImageFormatsToTest[compatibleFormatsIndex];
10140 const std::string testName = getFormatCaseName(params.src.image.format);
10170 const VkImageCopy testCopy =
10186 const int numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTest);
10189 const VkFormat* compatibleFormats = colorImageFormatsToTest[compatibleFormatsIndex];
10200 const std::string testName = getFormatCaseName(params.src.image.format);
10227 const VkImageCopy testCopy =
10242 const int numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTest);
10245 const VkFormat* compatibleFormats = colorImageFormatsToTest[compatibleFormatsIndex];
10256 const std::string testName = getFormatCaseName(params.src.image.format);
10269 const VkFormat testFormats[][2] =
10323 const tcu::UVec2 imageDimensions[] =
10350 const VkImageLayout copySrcLayouts[] =
10356 const VkImageLayout copyDstLayouts[] =
10374 const VkExtent3D extent = { imageDimensions[dimensionNdx].x(), imageDimensions[dimensionNdx].y(), 1 };
10376 const VkImageCopy testCopy =
10400 const std::string dimensionStr = "src" + de::toString(testParams.params.src.image.extent.width) + "x" + de::toString(testParams.params.src.image.extent.height)
10407 const VkFormat* compatibleFormats = testFormats[compatibleFormatsIndex];
10450 const std::string testName = getImageLayoutCaseName(testParams.params.src.image.operationLayout) + "_" + getImageLayoutCaseName(testParams.params.dst.image.operationLayout);
10451 const TestParams params = testParams.params;
10470 const VkImageLayout copySrcLayouts[] =
10475 const VkImageLayout copyDstLayouts[] =
10488 const std::string testName = getImageLayoutCaseName(params.src.image.operationLayout) + "_" +
10497 const VkFormat depthAndStencilFormats[] =
10530 const VkImageSubresourceLayers defaultDepthSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 0u, 1u };
10531 const VkImageSubresourceLayers defaultStencilSourceLayer = { VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
10536 const VkOffset3D srcOffset = { 0, 0, 0 };
10537 const VkOffset3D dstOffset = { i, 0, 0 };
10538 const VkExtent3D extent = { defaultQuarterSize, 1, 1 };
10542 const VkImageCopy testCopy =
10556 const VkImageCopy testCopy =
10570 const std::string testName = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format);
10576 const std::string testName2 = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format) + "_separate_layouts";
10607 const VkImageSubresourceLayers defaultDepthSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 0u, 1u };
10608 const VkImageSubresourceLayers defaultStencilSourceLayer = { VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
10613 const VkOffset3D srcOffset = {static_cast<deInt32>(i * defaultRootSize), 0, 0};
10614 const VkOffset3D dstOffset = {0, static_cast<deInt32>(i), 0};
10615 const VkExtent3D extent = {defaultRootSize, 1, 1};
10619 const VkImageCopy testCopy =
10633 const VkImageCopy testCopy =
10647 const std::string testName = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format);
10653 const std::string testName2 = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format) + "_separate_layouts";
10684 const VkImageSubresourceLayers defaultDepthSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 0u, 1u };
10685 const VkImageSubresourceLayers defaultStencilSourceLayer = { VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
10692 const VkOffset3D srcOffset = {i * defaultQuarterSize + j * defaultSixteenthSize, 0, 0};
10693 const VkOffset3D dstOffset = {0, j, i};
10694 const VkExtent3D extent = {defaultSixteenthSize, 1, 1};
10698 const VkImageCopy testCopy =
10712 const VkImageCopy testCopy =
10727 const std::string testName = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format);
10733 const std::string testName2 = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format) + "_separate_layouts";
10764 const VkImageSubresourceLayers defaultDepthSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 0u, 1u };
10765 const VkImageSubresourceLayers defaultStencilSourceLayer = { VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
10766 const VkImageSubresourceLayers defaultDSSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
10771 const VkOffset3D srcOffset = {0, i, 0 };
10772 const VkOffset3D dstOffset = {i * defaultQuarterSize, 0, 0};
10773 const VkExtent3D extent = {defaultQuarterSize, 1, 1};
10777 const VkImageCopy testCopy =
10791 const VkImageCopy testCopy =
10805 const std::string testName = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format);
10811 const std::string testName2 = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format) + "_separate_layouts";
10823 const VkOffset3D srcOffset = {0, i, 0};
10824 const VkOffset3D dstOffset = {i * defaultQuarterSize, 0, 0};
10825 const VkExtent3D extent = {defaultQuarterSize, 1, 1};
10827 const VkImageCopy testCopy =
10840 const std::string testName3 = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format) + "_depth_stencil_aspects";
10871 const VkImageSubresourceLayers defaultDepthSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 0u, 1u };
10872 const VkImageSubresourceLayers defaultStencilSourceLayer = { VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
10873 const VkImageSubresourceLayers defaultDSSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
10878 const VkOffset3D srcOffset = {0, 0, 0};
10879 const VkOffset3D dstOffset = {i, defaultSize - i - defaultQuarterSize, 0};
10880 const VkExtent3D extent = {defaultQuarterSize, defaultQuarterSize, 1};
10884 const VkImageCopy testCopy =
10898 const VkImageCopy testCopy =
10912 const std::string testName = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format);
10918 const std::string testName2 = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format) + "_separate_layouts";
10930 const VkOffset3D srcOffset = {0, 0, 0};
10931 const VkOffset3D dstOffset = {i, defaultSize - i - defaultQuarterSize, 0};
10932 const VkExtent3D extent = {defaultQuarterSize, defaultQuarterSize, 1};
10934 const VkImageCopy testCopy =
10947 const std::string testName3 = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format) + "_depth_stencil_aspects";
10979 const VkImageSubresourceLayers defaultDepthSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 0u, 1u };
10980 const VkImageSubresourceLayers defaultStencilSourceLayer = { VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
10981 const VkImageSubresourceLayers defaultDSSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
10986 const VkOffset3D srcOffset = {i * defaultSixteenthSize,i % defaultSixteenthSize, 0};
10987 const VkOffset3D dstOffset = {0, 0, i};
10988 const VkExtent3D extent = {defaultSixteenthSize, defaultSixteenthSize, 1};
10992 const VkImageCopy testCopy =
11006 const VkImageCopy testCopy =
11020 const std::string testName = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format);
11026 const std::string testName2 = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format) + "_separate_layouts";
11038 const VkOffset3D srcOffset = {i * defaultSixteenthSize, i % defaultSixteenthSize, 0};
11039 const VkOffset3D dstOffset = {0, 0, i};
11040 const VkExtent3D extent = {defaultSixteenthSize, defaultSixteenthSize, 1};
11042 const VkImageCopy testCopy =
11055 const std::string testName3 = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format) + "_depth_stencil_aspects";
11087 const VkImageSubresourceLayers defaultDepthSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 0u, 1u };
11088 const VkImageSubresourceLayers defaultStencilSourceLayer = { VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
11095 const VkOffset3D srcOffset = {0, j % defaultSixteenthSize, i % defaultSixteenthSize};
11096 const VkOffset3D dstOffset = {j * defaultSixteenthSize + i * defaultQuarterSize, 0, 0};
11097 const VkExtent3D extent = {defaultSixteenthSize, 1, 1};
11101 const VkImageCopy testCopy =
11115 const VkImageCopy testCopy =
11130 const std::string testName = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format);
11136 const std::string testName2 = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format) + "_separate_layouts";
11167 const VkImageSubresourceLayers defaultDepthSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 0u, 1u };
11168 const VkImageSubresourceLayers defaultStencilSourceLayer = { VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
11175 const VkOffset3D srcOffset = {0, 0, i % defaultSixteenthSize + j};
11176 const VkOffset3D dstOffset = {j * defaultQuarterSize, i * defaultQuarterSize, 0};
11177 const VkExtent3D extent = {defaultQuarterSize, defaultQuarterSize, 1};
11181 const VkImageCopy testCopy =
11195 const VkImageCopy testCopy =
11210 const std::string testName = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format);
11216 const std::string testName2 = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format) + "_separate_layouts";
11246 const VkImageSubresourceLayers defaultDepthSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 0u, 1u };
11247 const VkImageSubresourceLayers defaultStencilSourceLayer = { VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
11252 const VkOffset3D srcOffset = {0, 0, 0};
11253 const VkOffset3D dstOffset = {i, defaultQuarterSize - i - defaultSixteenthSize, i};
11254 const VkExtent3D extent = {defaultSixteenthSize, defaultSixteenthSize, defaultSixteenthSize};
11258 const VkImageCopy testCopy =
11272 const VkImageCopy testCopy =
11286 const std::string testName = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format);
11292 const std::string testName2 = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format) + "_separate_layouts";
11314 const deUint32 slicesLayers = 16u;
11333 const VkImageSubresourceLayers sourceLayer =
11341 const VkImageSubresourceLayers destinationLayer =
11349 const VkImageCopy testCopy =
11368 const deUint32 slicesLayers = 16u;
11387 const VkImageSubresourceLayers sourceLayer =
11395 const VkImageSubresourceLayers destinationLayer =
11403 const VkImageCopy testCopy =
11423 const deUint32 slicesLayers = 16u;
11441 const VkImageSubresourceLayers sourceLayer =
11449 const VkImageSubresourceLayers destinationLayer =
11457 const VkImageCopy testCopy =
11476 const deUint32 slicesLayers = 16u;
11494 const VkImageSubresourceLayers sourceLayer =
11502 const VkImageSubresourceLayers destinationLayer =
11510 const VkImageCopy testCopy =
11530 const deUint32 slicesLayers = 16u;
11547 const deUint32 regionWidth = defaultHalfExtent.width / slicesLayers -1;
11548 const deUint32 regionHeight = defaultHalfExtent.height / slicesLayers -1 ;
11552 const VkImageSubresourceLayers sourceLayer =
11560 const VkImageSubresourceLayers destinationLayer =
11569 const VkImageCopy testCopy =
11591 const deUint32 slicesLayers = 16u;
11608 const deUint32 regionWidth = defaultHalfExtent.width / slicesLayers -1;
11609 const deUint32 regionHeight = defaultHalfExtent.height / slicesLayers -1 ;
11613 const VkImageSubresourceLayers sourceLayer =
11621 const VkImageSubresourceLayers destinationLayer =
11629 const VkImageCopy testCopy =
11658 const deUint32 arrayLayers = 6u;
11680 const VkImageSubresourceLayers sourceLayer =
11688 const VkImageSubresourceLayers destinationLayer =
11696 const VkImageCopy testCopy =
11716 const deUint32 arrayLayers = 6u;
11737 const VkImageSubresourceLayers sourceLayer =
11745 const VkImageSubresourceLayers destinationLayer =
11753 const VkImageCopy testCopy =
11773 const deUint32 arrayLayers = 6u;
11795 const VkImageSubresourceLayers sourceLayer =
11803 const VkImageSubresourceLayers destinationLayer =
11811 const VkImageCopy testCopy =
11831 const deUint32 arrayLayers = 6u;
11852 const VkImageSubresourceLayers sourceLayer =
11860 const VkImageSubresourceLayers destinationLayer =
11868 const VkImageCopy testCopy =
11888 const deUint32 arrayLayers = 6u;
11910 const VkImageSubresourceLayers sourceLayer =
11918 const VkImageSubresourceLayers destinationLayer =
11926 const VkImageCopy testCopy =
11946 const deUint32 arrayLayers = 6u;
11967 const VkImageSubresourceLayers sourceLayer =
11975 const VkImageSubresourceLayers destinationLayer =
11983 const VkImageCopy testCopy =
12008 const deUint32 arrayLayers = 16u;
12028 const VkImageSubresourceLayers sourceLayer =
12036 const VkImageSubresourceLayers destinationLayer =
12044 const VkImageCopy testCopy =
12064 const deUint32 arrayLayers = 16u;
12083 const VkImageSubresourceLayers sourceLayer =
12091 const VkImageSubresourceLayers destinationLayer =
12099 const VkImageCopy testCopy =
12120 const deUint32 arrayLayers = 16u;
12140 const VkImageSubresourceLayers sourceLayer =
12148 const VkImageSubresourceLayers destinationLayer =
12156 const VkImageCopy testCopy =
12176 const deUint32 arrayLayers = 16u;
12196 const VkImageSubresourceLayers sourceLayer =
12204 const VkImageSubresourceLayers destinationLayer =
12212 const VkImageCopy testCopy =
12232 const deUint32 arrayLayers = 16u;
12251 const VkImageSubresourceLayers sourceLayer =
12259 const VkImageSubresourceLayers destinationLayer =
12267 const VkExtent3D extent =
12274 const VkImageCopy testCopy =
12301 const std::string formatName = getFormatName(imageFormats[imageFormatsNdx]);
12334 const VkBufferImageCopy bufferImageCopy =
12364 const VkBufferImageCopy bufferImageCopy =
12395 const int pixelSize = tcu::getPixelSize(mapVkFormat(params.src.image.format));
12398 const VkDeviceSize offset = defaultSize * pixelSize * arrayLayerNdx;
12399 const VkBufferImageCopy bufferImageCopy =
12437 const int pixelSize = tcu::getPixelSize(mapVkFormat(params.src.image.format));
12440 const VkDeviceSize offset = bufferImageHeight * pixelSize * arrayLayerNdx;
12441 const VkBufferImageCopy bufferImageCopy =
12466 const deUint32 baseLayer = 0u;
12467 const deUint32 layerCount = 16u;
12482 const VkImageSubresourceLayers defaultLayer =
12490 const VkBufferImageCopy bufferImageCopy =
12510 const deUint32 baseLayer = 2u;
12511 const deUint32 layerCount = 16u;
12526 const VkImageSubresourceLayers defaultLayer =
12534 const VkBufferImageCopy bufferImageCopy =
12569 const VkBufferImageCopy bufferImageCopy =
12598 const VkBufferImageCopy bufferImageCopy =
12628 const VkBufferImageCopy bufferImageCopy =
12657 const int pixelSize = tcu::getPixelSize(mapVkFormat(params.src.image.format));
12658 const VkDeviceSize bufferSize = pixelSize * params.dst.buffer.size;
12659 const VkDeviceSize offsetSize = pixelSize * defaultQuarterSize * defaultQuarterSize;
12663 const deUint32 bufferRowLength = defaultQuarterSize;
12664 const deUint32 bufferImageHeight = defaultQuarterSize;
12665 const VkExtent3D imageExtent = {defaultQuarterSize / divisor, defaultQuarterSize, 1};
12671 const VkBufferImageCopy bufferImageCopy =
12699 const VkBufferImageCopy bufferImageCopy =
12729 const VkBufferImageCopy bufferImageCopy =
12758 const VkBufferImageCopy bufferImageCopy =
12789 const int pixelSize = tcu::getPixelSize(mapVkFormat(params.src.image.format));
12792 const VkDeviceSize offset = defaultHalfSize * defaultHalfSize * pixelSize * arrayLayerNdx;
12793 const VkBufferImageCopy bufferImageCopy =
12830 const int pixelSize = tcu::getPixelSize(mapVkFormat(params.src.image.format));
12833 const VkDeviceSize offset = defaultHalfSize * imageBufferHeight * pixelSize * arrayLayerNdx;
12834 const VkBufferImageCopy bufferImageCopy =
12870 const int pixelSize = tcu::getPixelSize(mapVkFormat(params.src.image.format));
12873 const VkDeviceSize offset = defaultHalfSize * defaultHalfSize * pixelSize * arrayLayerNdx;
12874 const VkBufferImageCopy bufferImageCopy =
12898 const deUint32 baseLayer = 0u;
12899 const deUint32 layerCount = 16u;
12914 const VkImageSubresourceLayers defaultLayer =
12922 const VkBufferImageCopy bufferImageCopy =
12942 const deUint32 baseLayer = 2u;
12943 const deUint32 layerCount = 16u;
12958 const VkImageSubresourceLayers defaultLayer =
12966 const VkBufferImageCopy bufferImageCopy =
13005 for (const auto& extent : extents)
13006 for (const auto numLayers : arrayLayers)
13018 for (const VkFormat *format = compressedFormatsFloats; *format != VK_FORMAT_UNDEFINED; format++)
13038 const struct
13040 const char* name;
13041 const VkFormat format;
13052 const VkImageSubresourceLayers depthSourceLayer =
13060 const VkBufferImageCopy bufferDepthCopy =
13070 const VkBufferImageCopy bufferDepthCopyOffset =
13080 const VkImageSubresourceLayers stencilSourceLayer =
13088 const VkBufferImageCopy bufferStencilCopy =
13098 const VkBufferImageCopy bufferStencilCopyOffset =
13108 const bool useOffset[] = {false, true};
13117 for (const auto config : depthAndStencilFormats)
13118 for (const auto offset : useOffset)
13126 const tcu::TextureFormat format = mapVkFormat(config.format);
13127 const bool hasDepth = tcu::hasDepthComponent(format.order);
13128 const bool hasStencil = tcu::hasStencilComponent(format.order);
13210 const VkBufferImageCopy bufferImageCopy =
13240 const VkBufferImageCopy bufferImageCopy =
13271 const int pixelSize = tcu::getPixelSize(mapVkFormat(params.dst.image.format));
13274 const VkDeviceSize offset = defaultSize * pixelSize * arrayLayerNdx;
13275 const VkBufferImageCopy bufferImageCopy =
13300 const deUint32 baseLayer = 0u;
13301 const deUint32 layerCount = 16u;
13316 const VkImageSubresourceLayers defaultLayer =
13324 const VkBufferImageCopy bufferImageCopy =
13344 const deUint32 baseLayer = 2u;
13345 const deUint32 layerCount = 16u;
13360 const VkImageSubresourceLayers defaultLayer =
13368 const VkBufferImageCopy bufferImageCopy =
13401 const int pixelSize = tcu::getPixelSize(mapVkFormat(params.dst.image.format));
13404 const VkDeviceSize offset = defaultSize * pixelSize * arrayLayerNdx;
13405 const VkBufferImageCopy bufferImageCopy =
13445 const VkBufferImageCopy bufferImageCopy =
13478 const VkBufferImageCopy bufferImageCopy =
13506 const VkBufferImageCopy bufferImageCopy =
13536 const VkBufferImageCopy bufferImageCopy =
13565 const VkBufferImageCopy bufferImageCopy =
13595 const VkBufferImageCopy bufferImageCopy =
13624 const VkBufferImageCopy bufferImageCopy =
13655 const int pixelSize = tcu::getPixelSize(mapVkFormat(params.dst.image.format));
13658 const VkDeviceSize offset = defaultHalfSize * defaultHalfSize * pixelSize * arrayLayerNdx;
13659 const VkBufferImageCopy bufferImageCopy =
13696 const int pixelSize = tcu::getPixelSize(mapVkFormat(params.dst.image.format));
13699 const VkDeviceSize offset = defaultHalfSize * bufferImageHeight * pixelSize * arrayLayerNdx;
13700 const VkBufferImageCopy bufferImageCopy =
13736 const int pixelSize = tcu::getPixelSize(mapVkFormat(params.dst.image.format));
13739 const VkDeviceSize offset = defaultHalfSize * defaultHalfSize * pixelSize * arrayLayerNdx;
13740 const VkBufferImageCopy bufferImageCopy =
13764 const deUint32 baseLayer = 0u;
13765 const deUint32 layerCount = 16u;
13780 const VkImageSubresourceLayers defaultLayer =
13788 const VkBufferImageCopy bufferImageCopy =
13808 const deUint32 baseLayer = 2u;
13809 const deUint32 layerCount = 16u;
13824 const VkImageSubresourceLayers defaultLayer =
13832 const VkBufferImageCopy bufferImageCopy =
13863 const VkBufferCopy bufferCopy =
13886 const VkBufferCopy bufferCopy =
13901 const deUint32 size = 16;
13912 const VkBufferCopy bufferCopy =
13938 const VkBufferCopy bufferCopy
14006 const deInt32 imageDepth = params.src.image.imageType == VK_IMAGE_TYPE_3D ? defaultSize : 1;
14013 const VkImageBlit imageBlit =
14043 const deUint32 baseLayer = 0u;
14044 const deUint32 layerCount = 16u;
14055 const VkImageSubresourceLayers defaultLayer =
14063 const VkImageBlit imageBlit =
14089 const deUint32 baseLayer = 2u;
14090 const deUint32 layerCount = 16u;
14099 const VkImageSubresourceLayers defaultLayer =
14107 const VkImageBlit imageBlit =
14134 const deInt32 imageDepth = params.src.image.imageType == VK_IMAGE_TYPE_3D ? defaultSize : 1;
14141 const VkImageBlit imageBlit =
14167 const deInt32 imageDepth = params.src.image.imageType == VK_IMAGE_TYPE_3D ? defaultSize : 1;
14174 const VkImageBlit imageBlit =
14200 const deInt32 imageDepth = params.src.image.imageType == VK_IMAGE_TYPE_3D ? defaultSize : 1;
14207 const VkImageBlit imageBlit =
14240 const VkImageBlit imageBlit =
14266 const deInt32 imageDepth = params.src.image.imageType == VK_IMAGE_TYPE_3D ? defaultSize : 1;
14274 const VkImageBlit imageBlit =
14296 const VkImageBlit imageBlit =
14317 const VkImageBlit imageBlit =
14339 const VkImageBlit imageBlit =
14365 const deInt32 imageDepth = params.src.image.imageType == VK_IMAGE_TYPE_3D ? defaultSize : 1;
14366 const deInt32 halfImageDepth = params.src.image.imageType == VK_IMAGE_TYPE_3D ? defaultHalfSize : 1;
14373 const VkImageBlit imageBlit =
14399 const deInt32 imageDepth = params.src.image.imageType == VK_IMAGE_TYPE_3D ? defaultSize : 1;
14400 const deInt32 halfImageDepth = params.src.image.imageType == VK_IMAGE_TYPE_3D ? defaultHalfSize : 1;
14407 const VkImageBlit imageBlit =
14433 const deInt32 imageDepth = params.src.image.imageType == VK_IMAGE_TYPE_3D ? defaultSize : 1;
14434 const deInt32 srcDepthOffset = params.src.image.imageType == VK_IMAGE_TYPE_3D ? defaultQuarterSize : 0;
14435 const deInt32 srcDepthSize = params.src.image.imageType == VK_IMAGE_TYPE_3D ? defaultQuarterSize * 3 : 1;
14442 const VkImageBlit imageBlit =
14468 const bool is3dBlit = params.src.image.imageType == VK_IMAGE_TYPE_3D;
14482 const VkImageBlit imageBlit =
14567 const VkFormat* compatibleFormats;
14571 bool isAllowedBlittingAllFormatsColorSrcFormatTests(const BlitColorTestParams& testParams)
14587 const VkFormat linearOtherImageFormatsToTest[] =
14649 const int numOfOtherImageFormatsToTestFilter = DE_LENGTH_OF_ARRAY(linearOtherImageFormatsToTest);
14653 const VkImageTiling blitSrcTilings[] =
14658 const VkImageLayout blitSrcLayouts[] =
14663 const VkImageTiling blitDstTilings[] =
14668 const VkImageLayout blitDstLayouts[] =
14703 const std::string testName = getBlitImageTilingLayoutCaseName(testParams.params.src.image.tiling, testParams.params.src.image.operationLayout) + "_" +
14721 const struct
14724 const char* name;
14782 const VkFormat dedicatedAllocationBlittingFormatsToTest[] =
14802 const FormatSet onlyNearestAndLinearFormatsToTest =
14819 const std::map<VkFormat, AstcImageSizeType> astcSizes
14924 const struct {
14925 const VkFormat* sourceFormats;
14926 const VkFormat* destinationFormats;
14927 const bool onlyNearest;
14938 const int numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTestBlit);
14942 const int numOfColorImageFormatsToTestFilter = DE_LENGTH_OF_ARRAY(dedicatedAllocationBlittingFormatsToTest);
14962 const std::map<AstcImageSizeType, std::vector<CopyRegion> > imageRegions
14972 const VkFormat* sourceFormats = colorImageFormatsToTestBlit[compatibleFormatsIndex].sourceFormats;
14973 const VkFormat* destinationFormats = colorImageFormatsToTestBlit[compatibleFormatsIndex].destinationFormats;
14974 const bool onlyNearest = colorImageFormatsToTestBlit[compatibleFormatsIndex].onlyNearest;
14980 const bool onlyNearestAndLinear = de::contains(onlyNearestAndLinearFormatsToTest, params.src.image.format);
14989 const VkOffset3D& srcImageSize = params.regions[0].imageBlit.srcOffsets[1];
15028 const VkImageBlit imageBlit =
15047 const VkImageBlit imageBlit =
15067 const VkFormat* sourceFormats = colorImageFormatsToTestBlit[compatibleFormatsIndex].sourceFormats;
15068 const bool onlyNearest = colorImageFormatsToTestBlit[compatibleFormatsIndex].onlyNearest;
15076 const bool onlyNearestAndLinear = true;
15109 const VkImageBlit imageBlit =
15128 const VkImageBlit imageBlit =
15148 const VkFormat* sourceFormats = colorImageFormatsToTestBlit[compatibleFormatsIndex].sourceFormats;
15149 const bool onlyNearest = colorImageFormatsToTestBlit[compatibleFormatsIndex].onlyNearest;
15157 const bool onlyNearestAndLinear = true;
15176 const VkImageLayout blitSrcLayouts[] =
15181 const VkImageLayout blitDstLayouts[] =
15196 const std::string testName = getImageLayoutCaseName(params.src.image.operationLayout) + "_" +
15206 const VkFormat depthAndStencilFormats[] =
15217 const VkImageSubresourceLayers defaultDepthSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 0u, 1u };
15218 const VkImageSubresourceLayers defaultStencilSourceLayer = { VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
15219 const VkImageSubresourceLayers defaultDSSourceLayer = { VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u };
15245 const VkOffset3D srcOffset0 = {0, 0, 0};
15246 const VkOffset3D srcOffset1 = {defaultSize, defaultSize, 1};
15247 const VkOffset3D dstOffset0 = {i, 0, 0};
15248 const VkOffset3D dstOffset1 = {i + defaultQuarterSize / j, defaultQuarterSize / j, 1};
15252 const VkImageBlit imageBlit =
15264 const VkImageBlit imageBlit =
15277 const VkOffset3D srcOffset0 = {i, i, 0};
15278 const VkOffset3D srcOffset1 = {i + defaultQuarterSize, i + defaultQuarterSize, 1};
15279 const VkOffset3D dstOffset0 = {i, defaultSize / 2, 0};
15280 const VkOffset3D dstOffset1 = {i + defaultQuarterSize, defaultSize / 2 + defaultQuarterSize, 1};
15284 const VkImageBlit imageBlit =
15296 const VkImageBlit imageBlit =
15308 const VkOffset3D dstDSOffset0 = {i, 3 * defaultQuarterSize, 0};
15309 const VkOffset3D dstDSOffset1 = {i + defaultQuarterSize, defaultSize, 1};
15310 const VkImageBlit imageBlit =
15322 const std::string testName = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format);
15328 const std::string testName2 = getFormatCaseName(params.src.image.format) + "_" +
15361 const VkOffset3D srcOffset0 = {0, 0, 0};
15362 const VkOffset3D srcOffset1 = {defaultSize, 1, 1};
15363 const VkOffset3D dstOffset0 = {i, 0, 0};
15364 const VkOffset3D dstOffset1 = {i + defaultQuarterSize, 1, 1};
15368 const VkImageBlit imageBlit =
15380 const VkImageBlit imageBlit =
15393 const VkOffset3D srcOffset0 = {0, 0, 0};
15394 const VkOffset3D srcOffset1 = {defaultQuarterSize, 1, 1};
15395 const VkOffset3D dstOffset0 = {defaultQuarterSize, 0, 0};
15396 const VkOffset3D dstOffset1 = {2 * defaultQuarterSize, 1, 1};
15400 const VkImageBlit imageBlit =
15412 const VkImageBlit imageBlit =
15424 const VkOffset3D dstDSOffset0 = {3 * defaultQuarterSize, 0, 0};
15425 const VkOffset3D dstDSOffset1 = {3 * defaultQuarterSize + defaultQuarterSize / 2, 1, 1};
15426 const VkImageBlit imageBlit =
15438 const std::string testName = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format);
15444 const std::string testName2 = getFormatCaseName(params.src.image.format) + "_" +
15477 const VkOffset3D srcOffset0 = {0, 0, 0};
15478 const VkOffset3D srcOffset1 = {defaultQuarterSize, defaultQuarterSize, defaultQuarterSize};
15479 const VkOffset3D dstOffset0 = {i, 0, i};
15480 const VkOffset3D dstOffset1 = {i + defaultSixteenthSize / j, defaultSixteenthSize / j, i + defaultSixteenthSize / j};
15484 const VkImageBlit imageBlit =
15496 const VkImageBlit imageBlit =
15509 const VkOffset3D srcOffset0 = {i, i, i};
15510 const VkOffset3D srcOffset1 = {i + defaultSixteenthSize, i + defaultSixteenthSize, i + defaultSixteenthSize};
15511 const VkOffset3D dstOffset0 = {i, defaultQuarterSize / 2, i};
15512 const VkOffset3D dstOffset1 = {i + defaultSixteenthSize, defaultQuarterSize / 2 + defaultSixteenthSize, i + defaultSixteenthSize};
15516 const VkImageBlit imageBlit =
15528 const VkImageBlit imageBlit =
15540 const VkOffset3D dstDSOffset0 = {i, 3 * defaultSixteenthSize, i};
15541 const VkOffset3D dstDSOffset1 = {i + defaultSixteenthSize, defaultQuarterSize, i + defaultSixteenthSize};
15542 const VkImageBlit imageBlit =
15554 const std::string testName = getFormatCaseName(params.src.image.format) + "_" + getFormatCaseName(params.dst.image.format);
15560 const std::string testName2 = getFormatCaseName(params.src.image.format) + "_" +
15574 const VkImageLayout blitSrcLayouts[] =
15579 const VkImageLayout blitDstLayouts[] =
15593 const std::string testName = getImageLayoutCaseName(testParams.params.src.image.operationLayout) + "_" +
15614 const struct
15616 const VkFormat* const compatibleFormats;
15617 const bool onlyNearest;
15626 const int numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTestBlit);
15628 const int layerCountsToTest[] =
15652 const VkImageBlit imageBlit =
15672 const int numOfColorImageFormatsToTestFilter = DE_LENGTH_OF_ARRAY(dedicatedAllocationBlittingFormatsToTest);
15679 const int layerCount = layerCountsToTest[layerCountIndex];
15680 const std::string layerGroupName = "layercount_" + de::toString(layerCount);
15681 const std::string layerGroupDesc = "Blit mipmaps with layerCount = " + de::toString(layerCount);
15687 const VkFormat* compatibleFormats = colorImageFormatsToTestBlit[compatibleFormatsIndex].compatibleFormats;
15688 const bool onlyNearest = colorImageFormatsToTestBlit[compatibleFormatsIndex].onlyNearest;
15698 const bool onlyNearestAndLinear = de::contains(onlyNearestAndLinearFormatsToTest, params.src.image.format);
15723 const struct
15725 const VkFormat* const compatibleFormats;
15726 const bool onlyNearest;
15735 const int numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTestBlit);
15737 const int layerCountsToTest[] =
15764 const VkImageBlit imageBlit =
15784 const int numOfColorImageFormatsToTestFilter = DE_LENGTH_OF_ARRAY(dedicatedAllocationBlittingFormatsToTest);
15791 const int layerCount = layerCountsToTest[layerCountIndex];
15792 const std::string layerGroupName = "layercount_" + de::toString(layerCount);
15793 const std::string layerGroupDesc = "Blit mipmaps with layerCount = " + de::toString(layerCount);
15799 const VkFormat* compatibleFormats = colorImageFormatsToTestBlit[compatibleFormatsIndex].compatibleFormats;
15800 const bool onlyNearest = colorImageFormatsToTestBlit[compatibleFormatsIndex].onlyNearest;
15810 const bool onlyNearestAndLinear = de::contains(onlyNearestAndLinearFormatsToTest, params.src.image.format);
15834 const int layerCount = multiLayer ? 6 : 1;
15840 const std::string barrierGroupName = (multiLayer ? "layerbarriercount_" : "mipbarriercount_") + de::toString(barrierCount);
15841 const std::string barrierGroupDesc = "Use " + de::toString(barrierCount) + " image barriers";
15897 const VkSampleCountFlagBits samples[] =
15906 const VkExtent3D resolveExtent = {256u, 256u, 1};
15925 const VkImageSubresourceLayers sourceLayer =
15932 const VkImageResolve testResolve =
15975 const VkImageSubresourceLayers sourceLayer =
15982 const VkImageResolve testResolve =
16026 const VkImageSubresourceLayers sourceLayer =
16036 const VkImageResolve testResolve =
16075 const VkImageSubresourceLayers sourceLayer =
16083 const VkImageResolve testResolve =
16129 const VkImageSubresourceLayers sourceLayer =
16137 const VkImageResolve testResolve =
16151 for (const auto& sample : samples)
16179 const VkImageSubresourceLayers sourceLayer =
16187 const VkImageResolve testResolve =
16230 const VkImageSubresourceLayers sourceLayer =
16238 const VkImageResolve testResolve =
16252 const struct
16303 const VkImageSubresourceLayers sourceLayer =
16311 const VkImageResolve testResolve =
16359 const VkImageSubresourceLayers sourceLayer =
16367 const VkImageResolve testResolve =
16383 const VkImageSubresourceLayers sourceLayer =
16391 const VkImageResolve testResolve =
16436 const VkImageSubresourceLayers sourceLayer =
16444 const VkImageResolve testResolve =
16474 const deUint32 layerCount = 5u;
16487 const VkImageSubresourceLayers sourceLayer =
16495 const VkImageResolve testResolve =
16522 const deUint32 baseLayer = 0u;
16523 const deUint32 layerCount = 5u;
16537 const VkImageSubresourceLayers sourceLayer =
16545 const VkImageResolve testResolve =
16572 const deUint32 baseLayer = 2u;
16573 const deUint32 layerCount = 5u;
16587 const VkImageSubresourceLayers sourceLayer =
16595 const VkImageResolve testResolve =
16637 const VkImageSubresourceLayers sourceLayer =
16644 const VkImageResolve testResolve =
16657 const VkExtent3D imageExtents[] =
16666 const VkExtent3D& srcImageSize = imageExtents[srcImageExtentIndex];
16680 const VkExtent3D& dstImageSize = imageExtents[dstImageExtentIndex];
16702 const struct
16704 const std::string name;
16705 const VkFormat vkFormat;
16715 const VkImageLayout srcImageLayouts[] =
16720 const VkImageLayout dstImageLayouts[] =
16726 for (const auto &srcLayout : srcImageLayouts)
16728 for (const auto &dstLayout : dstImageLayouts)
16732 for (const auto &format : depthAndStencilFormats)
16735 const auto textureFormat = mapVkFormat(format.vkFormat);