- const VkFormat compatibleFormats8Bit[] =
- {
- VK_FORMAT_R4G4_UNORM_PACK8,
- VK_FORMAT_R8_UNORM,
- VK_FORMAT_R8_SNORM,
- VK_FORMAT_R8_USCALED,
- VK_FORMAT_R8_SSCALED,
- VK_FORMAT_R8_UINT,
- VK_FORMAT_R8_SINT,
- VK_FORMAT_R8_SRGB,
-
- VK_FORMAT_UNDEFINED
- };
- const VkFormat compatibleFormats16Bit[] =
- {
- VK_FORMAT_R4G4B4A4_UNORM_PACK16,
- VK_FORMAT_B4G4R4A4_UNORM_PACK16,
- VK_FORMAT_R5G6B5_UNORM_PACK16,
- VK_FORMAT_B5G6R5_UNORM_PACK16,
- VK_FORMAT_R5G5B5A1_UNORM_PACK16,
- VK_FORMAT_B5G5R5A1_UNORM_PACK16,
- VK_FORMAT_A1R5G5B5_UNORM_PACK16,
- VK_FORMAT_R8G8_UNORM,
- VK_FORMAT_R8G8_SNORM,
- VK_FORMAT_R8G8_USCALED,
- VK_FORMAT_R8G8_SSCALED,
- VK_FORMAT_R8G8_UINT,
- VK_FORMAT_R8G8_SINT,
- VK_FORMAT_R8G8_SRGB,
- VK_FORMAT_R16_UNORM,
- VK_FORMAT_R16_SNORM,
- VK_FORMAT_R16_USCALED,
- VK_FORMAT_R16_SSCALED,
- VK_FORMAT_R16_UINT,
- VK_FORMAT_R16_SINT,
- VK_FORMAT_R16_SFLOAT,
-
- VK_FORMAT_UNDEFINED
- };
- const VkFormat compatibleFormats24Bit[] =
- {
- VK_FORMAT_R8G8B8_UNORM,
- VK_FORMAT_R8G8B8_SNORM,
- VK_FORMAT_R8G8B8_USCALED,
- VK_FORMAT_R8G8B8_SSCALED,
- VK_FORMAT_R8G8B8_UINT,
- VK_FORMAT_R8G8B8_SINT,
- VK_FORMAT_R8G8B8_SRGB,
- VK_FORMAT_B8G8R8_UNORM,
- VK_FORMAT_B8G8R8_SNORM,
- VK_FORMAT_B8G8R8_USCALED,
- VK_FORMAT_B8G8R8_SSCALED,
- VK_FORMAT_B8G8R8_UINT,
- VK_FORMAT_B8G8R8_SINT,
- VK_FORMAT_B8G8R8_SRGB,
-
- VK_FORMAT_UNDEFINED
- };
- const VkFormat compatibleFormats32Bit[] =
- {
- VK_FORMAT_R8G8B8A8_UNORM,
- VK_FORMAT_R8G8B8A8_SNORM,
- VK_FORMAT_R8G8B8A8_USCALED,
- VK_FORMAT_R8G8B8A8_SSCALED,
- VK_FORMAT_R8G8B8A8_UINT,
- VK_FORMAT_R8G8B8A8_SINT,
- VK_FORMAT_R8G8B8A8_SRGB,
- VK_FORMAT_B8G8R8A8_UNORM,
- VK_FORMAT_B8G8R8A8_SNORM,
- VK_FORMAT_B8G8R8A8_USCALED,
- VK_FORMAT_B8G8R8A8_SSCALED,
- VK_FORMAT_B8G8R8A8_UINT,
- VK_FORMAT_B8G8R8A8_SINT,
- VK_FORMAT_B8G8R8A8_SRGB,
- VK_FORMAT_A8B8G8R8_UNORM_PACK32,
- VK_FORMAT_A8B8G8R8_SNORM_PACK32,
- VK_FORMAT_A8B8G8R8_USCALED_PACK32,
- VK_FORMAT_A8B8G8R8_SSCALED_PACK32,
- VK_FORMAT_A8B8G8R8_UINT_PACK32,
- VK_FORMAT_A8B8G8R8_SINT_PACK32,
- VK_FORMAT_A8B8G8R8_SRGB_PACK32,
- VK_FORMAT_A2R10G10B10_UNORM_PACK32,
- VK_FORMAT_A2R10G10B10_SNORM_PACK32,
- VK_FORMAT_A2R10G10B10_USCALED_PACK32,
- VK_FORMAT_A2R10G10B10_SSCALED_PACK32,
- VK_FORMAT_A2R10G10B10_UINT_PACK32,
- VK_FORMAT_A2R10G10B10_SINT_PACK32,
- VK_FORMAT_A2B10G10R10_UNORM_PACK32,
- VK_FORMAT_A2B10G10R10_SNORM_PACK32,
- VK_FORMAT_A2B10G10R10_USCALED_PACK32,
- VK_FORMAT_A2B10G10R10_SSCALED_PACK32,
- VK_FORMAT_A2B10G10R10_UINT_PACK32,
- VK_FORMAT_A2B10G10R10_SINT_PACK32,
- VK_FORMAT_R16G16_UNORM,
- VK_FORMAT_R16G16_SNORM,
- VK_FORMAT_R16G16_USCALED,
- VK_FORMAT_R16G16_SSCALED,
- VK_FORMAT_R16G16_UINT,
- VK_FORMAT_R16G16_SINT,
- VK_FORMAT_R16G16_SFLOAT,
- VK_FORMAT_R32_UINT,
- VK_FORMAT_R32_SINT,
- VK_FORMAT_R32_SFLOAT,
-
- VK_FORMAT_UNDEFINED
- };
- const VkFormat compatibleFormats48Bit[] =
- {
- VK_FORMAT_R16G16B16_UNORM,
- VK_FORMAT_R16G16B16_SNORM,
- VK_FORMAT_R16G16B16_USCALED,
- VK_FORMAT_R16G16B16_SSCALED,
- VK_FORMAT_R16G16B16_UINT,
- VK_FORMAT_R16G16B16_SINT,
- VK_FORMAT_R16G16B16_SFLOAT,
-
- VK_FORMAT_UNDEFINED
- };
- const VkFormat compatibleFormats64Bit[] =
- {
- VK_FORMAT_R16G16B16A16_UNORM,
- VK_FORMAT_R16G16B16A16_SNORM,
- VK_FORMAT_R16G16B16A16_USCALED,
- VK_FORMAT_R16G16B16A16_SSCALED,
- VK_FORMAT_R16G16B16A16_UINT,
- VK_FORMAT_R16G16B16A16_SINT,
- VK_FORMAT_R16G16B16A16_SFLOAT,
- VK_FORMAT_R32G32_UINT,
- VK_FORMAT_R32G32_SINT,
- VK_FORMAT_R32G32_SFLOAT,
- VK_FORMAT_R64_UINT,
- VK_FORMAT_R64_SINT,
- VK_FORMAT_R64_SFLOAT,
-
- VK_FORMAT_UNDEFINED
- };
- const VkFormat compatibleFormats96Bit[] =
- {
- VK_FORMAT_R32G32B32_UINT,
- VK_FORMAT_R32G32B32_SINT,
- VK_FORMAT_R32G32B32_SFLOAT,
-
- VK_FORMAT_UNDEFINED
- };
- const VkFormat compatibleFormats128Bit[] =
- {
- VK_FORMAT_R32G32B32A32_UINT,
- VK_FORMAT_R32G32B32A32_SINT,
- VK_FORMAT_R32G32B32A32_SFLOAT,
- VK_FORMAT_R64G64_UINT,
- VK_FORMAT_R64G64_SINT,
- VK_FORMAT_R64G64_SFLOAT,
-
- VK_FORMAT_UNDEFINED
- };
- const VkFormat compatibleFormats192Bit[] =
- {
- VK_FORMAT_R64G64B64_UINT,
- VK_FORMAT_R64G64B64_SINT,
- VK_FORMAT_R64G64B64_SFLOAT,
-
- VK_FORMAT_UNDEFINED
- };
- const VkFormat compatibleFormats256Bit[] =
- {
- VK_FORMAT_R64G64B64A64_UINT,
- VK_FORMAT_R64G64B64A64_SINT,
- VK_FORMAT_R64G64B64A64_SFLOAT,
-
- VK_FORMAT_UNDEFINED
- };
-
- const VkFormat* colorImageFormatsToTest[] =
- {
- compatibleFormats8Bit,
- compatibleFormats16Bit,
- compatibleFormats24Bit,
- compatibleFormats32Bit,
- compatibleFormats48Bit,
- compatibleFormats64Bit,
- compatibleFormats96Bit,
- compatibleFormats128Bit,
- compatibleFormats192Bit,
- compatibleFormats256Bit,
- };
- const size_t numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTest);
-
- for (size_t compatibleFormatsIndex = 0; compatibleFormatsIndex < numOfColorImageFormatsToTest; ++compatibleFormatsIndex)
- {
- const VkFormat* compatibleFormats = colorImageFormatsToTest[compatibleFormatsIndex];
- for (size_t srcFormatIndex = 0; compatibleFormats[srcFormatIndex] != VK_FORMAT_UNDEFINED; ++srcFormatIndex)
- {
- params.src.image.format = compatibleFormats[srcFormatIndex];
- for (size_t dstFormatIndex = 0; compatibleFormats[dstFormatIndex] != VK_FORMAT_UNDEFINED; ++dstFormatIndex)
- {
- params.dst.image.format = compatibleFormats[dstFormatIndex];
-
- if (!isSupportedByFramework(params.src.image.format) || !isSupportedByFramework(params.dst.image.format))
- continue;
-
- std::ostringstream testName;
- testName << getFormatCaseName(params.src.image.format) << "_" << getFormatCaseName(params.dst.image.format);
- std::ostringstream description;
- description << "Copy from src " << params.src.image.format << " to dst " << params.dst.image.format;
-
- testCaseGroup->addChild(new CopyImageToImageTestCase(testCtx, testName.str(), description.str(), params));
- }
- }
- }
-}
-
-void addBlittingTestsAllFormats (tcu::TestCaseGroup* testCaseGroup,
- tcu::TestContext& testCtx,
- TestParams& params)
-{
- // Test Image formats.
- const VkFormat compatibleFormatsUInts[] =
- {
- VK_FORMAT_R8_UINT,
- VK_FORMAT_R8G8_UINT,
- VK_FORMAT_R8G8B8_UINT,
- VK_FORMAT_B8G8R8_UINT,
- VK_FORMAT_R8G8B8A8_UINT,
- VK_FORMAT_B8G8R8A8_UINT,
- VK_FORMAT_A8B8G8R8_UINT_PACK32,
- VK_FORMAT_A2R10G10B10_UINT_PACK32,
- VK_FORMAT_A2B10G10R10_UINT_PACK32,
- VK_FORMAT_R16_UINT,
- VK_FORMAT_R16G16_UINT,
- VK_FORMAT_R16G16B16_UINT,
- VK_FORMAT_R16G16B16A16_UINT,
- VK_FORMAT_R32_UINT,
- VK_FORMAT_R32G32_UINT,
- VK_FORMAT_R32G32B32_UINT,
- VK_FORMAT_R32G32B32A32_UINT,
- VK_FORMAT_R64_UINT,
- VK_FORMAT_R64G64_UINT,
- VK_FORMAT_R64G64B64_UINT,
- VK_FORMAT_R64G64B64A64_UINT,
-
- VK_FORMAT_UNDEFINED
- };
- const VkFormat compatibleFormatsSInts[] =
- {
- VK_FORMAT_R8_SINT,
- VK_FORMAT_R8G8_SINT,
- VK_FORMAT_R8G8B8_SINT,
- VK_FORMAT_B8G8R8_SINT,
- VK_FORMAT_R8G8B8A8_SINT,
- VK_FORMAT_B8G8R8A8_SINT,
- VK_FORMAT_A8B8G8R8_SINT_PACK32,
- VK_FORMAT_A2R10G10B10_SINT_PACK32,
- VK_FORMAT_A2B10G10R10_SINT_PACK32,
- VK_FORMAT_R16_SINT,
- VK_FORMAT_R16G16_SINT,
- VK_FORMAT_R16G16B16_SINT,
- VK_FORMAT_R16G16B16A16_SINT,
- VK_FORMAT_R32_SINT,
- VK_FORMAT_R32G32_SINT,
- VK_FORMAT_R32G32B32_SINT,
- VK_FORMAT_R32G32B32A32_SINT,
- VK_FORMAT_R64_SINT,
- VK_FORMAT_R64G64_SINT,
- VK_FORMAT_R64G64B64_SINT,
- VK_FORMAT_R64G64B64A64_SINT,
-
- VK_FORMAT_UNDEFINED
- };
- const VkFormat compatibleFormatsFloats[] =
- {
- VK_FORMAT_R4G4_UNORM_PACK8,
- VK_FORMAT_R4G4B4A4_UNORM_PACK16,
- VK_FORMAT_B4G4R4A4_UNORM_PACK16,
- VK_FORMAT_R5G6B5_UNORM_PACK16,
- VK_FORMAT_B5G6R5_UNORM_PACK16,
- VK_FORMAT_R5G5B5A1_UNORM_PACK16,
- VK_FORMAT_B5G5R5A1_UNORM_PACK16,
- VK_FORMAT_A1R5G5B5_UNORM_PACK16,
- VK_FORMAT_R8_UNORM,
- VK_FORMAT_R8_SNORM,
- VK_FORMAT_R8_USCALED,
- VK_FORMAT_R8_SSCALED,
- VK_FORMAT_R8G8_UNORM,
- VK_FORMAT_R8G8_SNORM,
- VK_FORMAT_R8G8_USCALED,
- VK_FORMAT_R8G8_SSCALED,
- VK_FORMAT_R8G8B8_UNORM,
- VK_FORMAT_R8G8B8_SNORM,
- VK_FORMAT_R8G8B8_USCALED,
- VK_FORMAT_R8G8B8_SSCALED,
- VK_FORMAT_B8G8R8_UNORM,
- VK_FORMAT_B8G8R8_SNORM,
- VK_FORMAT_B8G8R8_USCALED,
- VK_FORMAT_B8G8R8_SSCALED,
- VK_FORMAT_R8G8B8A8_UNORM,
- VK_FORMAT_R8G8B8A8_SNORM,
- VK_FORMAT_R8G8B8A8_USCALED,
- VK_FORMAT_R8G8B8A8_SSCALED,
- VK_FORMAT_B8G8R8A8_UNORM,
- VK_FORMAT_B8G8R8A8_SNORM,
- VK_FORMAT_B8G8R8A8_USCALED,
- VK_FORMAT_B8G8R8A8_SSCALED,
- VK_FORMAT_A8B8G8R8_UNORM_PACK32,
- VK_FORMAT_A8B8G8R8_SNORM_PACK32,
- VK_FORMAT_A8B8G8R8_USCALED_PACK32,
- VK_FORMAT_A8B8G8R8_SSCALED_PACK32,
- VK_FORMAT_A2R10G10B10_UNORM_PACK32,
- VK_FORMAT_A2R10G10B10_SNORM_PACK32,
- VK_FORMAT_A2R10G10B10_USCALED_PACK32,
- VK_FORMAT_A2R10G10B10_SSCALED_PACK32,
- VK_FORMAT_A2B10G10R10_UNORM_PACK32,
- VK_FORMAT_A2B10G10R10_SNORM_PACK32,
- VK_FORMAT_A2B10G10R10_USCALED_PACK32,
- VK_FORMAT_A2B10G10R10_SSCALED_PACK32,
- VK_FORMAT_R16_UNORM,
- VK_FORMAT_R16_SNORM,
- VK_FORMAT_R16_USCALED,
- VK_FORMAT_R16_SSCALED,
- VK_FORMAT_R16_SFLOAT,
- VK_FORMAT_R16G16_UNORM,
- VK_FORMAT_R16G16_SNORM,
- VK_FORMAT_R16G16_USCALED,
- VK_FORMAT_R16G16_SSCALED,
- VK_FORMAT_R16G16_SFLOAT,
- VK_FORMAT_R16G16B16_UNORM,
- VK_FORMAT_R16G16B16_SNORM,
- VK_FORMAT_R16G16B16_USCALED,
- VK_FORMAT_R16G16B16_SSCALED,
- VK_FORMAT_R16G16B16_SFLOAT,
- VK_FORMAT_R16G16B16A16_UNORM,
- VK_FORMAT_R16G16B16A16_SNORM,
- VK_FORMAT_R16G16B16A16_USCALED,
- VK_FORMAT_R16G16B16A16_SSCALED,
- VK_FORMAT_R16G16B16A16_SFLOAT,
- VK_FORMAT_R32_SFLOAT,
- VK_FORMAT_R32G32_SFLOAT,
- VK_FORMAT_R32G32B32_SFLOAT,
- VK_FORMAT_R32G32B32A32_SFLOAT,
- VK_FORMAT_R64_SFLOAT,
- VK_FORMAT_R64G64_SFLOAT,
- VK_FORMAT_R64G64B64_SFLOAT,
- VK_FORMAT_R64G64B64A64_SFLOAT,
-// VK_FORMAT_B10G11R11_UFLOAT_PACK32,
-// VK_FORMAT_E5B9G9R9_UFLOAT_PACK32,
-// VK_FORMAT_BC1_RGB_UNORM_BLOCK,
-// VK_FORMAT_BC1_RGBA_UNORM_BLOCK,
-// VK_FORMAT_BC2_UNORM_BLOCK,
-// VK_FORMAT_BC3_UNORM_BLOCK,
-// VK_FORMAT_BC4_UNORM_BLOCK,
-// VK_FORMAT_BC4_SNORM_BLOCK,
-// VK_FORMAT_BC5_UNORM_BLOCK,
-// VK_FORMAT_BC5_SNORM_BLOCK,
-// VK_FORMAT_BC6H_UFLOAT_BLOCK,
-// VK_FORMAT_BC6H_SFLOAT_BLOCK,
-// VK_FORMAT_BC7_UNORM_BLOCK,
-// VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK,
-// VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK,
-// VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK,
-// VK_FORMAT_EAC_R11_UNORM_BLOCK,
-// VK_FORMAT_EAC_R11_SNORM_BLOCK,
-// VK_FORMAT_EAC_R11G11_UNORM_BLOCK,
-// VK_FORMAT_EAC_R11G11_SNORM_BLOCK,
-// VK_FORMAT_ASTC_4x4_UNORM_BLOCK,
-// VK_FORMAT_ASTC_5x4_UNORM_BLOCK,
-// VK_FORMAT_ASTC_5x5_UNORM_BLOCK,
-// VK_FORMAT_ASTC_6x5_UNORM_BLOCK,
-// VK_FORMAT_ASTC_6x6_UNORM_BLOCK,
-// VK_FORMAT_ASTC_8x5_UNORM_BLOCK,
-// VK_FORMAT_ASTC_8x6_UNORM_BLOCK,
-// VK_FORMAT_ASTC_8x8_UNORM_BLOCK,
-// VK_FORMAT_ASTC_10x5_UNORM_BLOCK,
-// VK_FORMAT_ASTC_10x6_UNORM_BLOCK,
-// VK_FORMAT_ASTC_10x8_UNORM_BLOCK,
-// VK_FORMAT_ASTC_10x10_UNORM_BLOCK,
-// VK_FORMAT_ASTC_12x10_UNORM_BLOCK,
-// VK_FORMAT_ASTC_12x12_UNORM_BLOCK,
-
- VK_FORMAT_UNDEFINED
- };
- const VkFormat compatibleFormatsSrgb[] =
- {
- VK_FORMAT_R8_SRGB,
- VK_FORMAT_R8G8_SRGB,
- VK_FORMAT_R8G8B8_SRGB,
- VK_FORMAT_B8G8R8_SRGB,
- VK_FORMAT_R8G8B8A8_SRGB,
- VK_FORMAT_B8G8R8A8_SRGB,
- VK_FORMAT_A8B8G8R8_SRGB_PACK32,
-// VK_FORMAT_BC1_RGB_SRGB_BLOCK,
-// VK_FORMAT_BC1_RGBA_SRGB_BLOCK,
-// VK_FORMAT_BC2_SRGB_BLOCK,
-// VK_FORMAT_BC3_SRGB_BLOCK,
-// VK_FORMAT_BC7_SRGB_BLOCK,
-// VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK,
-// VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK,
-// VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK,
-// VK_FORMAT_ASTC_4x4_SRGB_BLOCK,
-// VK_FORMAT_ASTC_5x4_SRGB_BLOCK,
-// VK_FORMAT_ASTC_5x5_SRGB_BLOCK,
-// VK_FORMAT_ASTC_6x5_SRGB_BLOCK,
-// VK_FORMAT_ASTC_6x6_SRGB_BLOCK,
-// VK_FORMAT_ASTC_8x5_SRGB_BLOCK,
-// VK_FORMAT_ASTC_8x6_SRGB_BLOCK,
-// VK_FORMAT_ASTC_8x8_SRGB_BLOCK,
-// VK_FORMAT_ASTC_10x5_SRGB_BLOCK,
-// VK_FORMAT_ASTC_10x6_SRGB_BLOCK,
-// VK_FORMAT_ASTC_10x8_SRGB_BLOCK,
-// VK_FORMAT_ASTC_10x10_SRGB_BLOCK,
-// VK_FORMAT_ASTC_12x10_SRGB_BLOCK,
-// VK_FORMAT_ASTC_12x12_SRGB_BLOCK,
-
- VK_FORMAT_UNDEFINED
- };
-
- const struct {
- const VkFormat* compatibleFormats;
- const bool onlyNearest;
- } colorImageFormatsToTest[] =
- {
- { compatibleFormatsUInts, true },
- { compatibleFormatsSInts, true },
- { compatibleFormatsFloats, false },
- { compatibleFormatsSrgb, false },
- };
- const size_t numOfColorImageFormatsToTest = DE_LENGTH_OF_ARRAY(colorImageFormatsToTest);
-
- for (size_t compatibleFormatsIndex = 0; compatibleFormatsIndex < numOfColorImageFormatsToTest; ++compatibleFormatsIndex)