1 #ifndef _VKIMAGEUTIL_HPP
2 #define _VKIMAGEUTIL_HPP
3 /*-------------------------------------------------------------------------
7 * Copyright (c) 2015 The Khronos Group Inc.
8 * Copyright (c) 2015 Imagination Technologies Ltd.
9 * Copyright (c) 2015 Google Inc.
11 * Permission is hereby granted, free of charge, to any person obtaining a
12 * copy of this software and/or associated documentation files (the
13 * "Materials"), to deal in the Materials without restriction, including
14 * without limitation the rights to use, copy, modify, merge, publish,
15 * distribute, sublicense, and/or sell copies of the Materials, and to
16 * permit persons to whom the Materials are furnished to do so, subject to
17 * the following conditions:
19 * The above copyright notice(s) and this permission notice shall be
20 * included in all copies or substantial portions of the Materials.
22 * The Materials are Confidential Information as defined by the
23 * Khronos Membership Agreement until designated non-confidential by
24 * Khronos, at which point this condition clause shall be removed.
26 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
29 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
30 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
31 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
32 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
36 * \brief Utilities for images.
37 *//*--------------------------------------------------------------------*/
40 #include "tcuTexture.hpp"
41 #include "tcuCompressedTexture.hpp"
46 bool isFloatFormat (VkFormat format);
47 bool isUnormFormat (VkFormat format);
48 bool isSnormFormat (VkFormat format);
49 bool isIntFormat (VkFormat format);
50 bool isUintFormat (VkFormat format);
51 bool isDepthStencilFormat (VkFormat format);
52 bool isCompressedFormat (VkFormat format);
54 tcu::TextureFormat mapVkFormat (VkFormat format);
55 tcu::CompressedTexFormat mapVkCompressedFormat (VkFormat format);
56 tcu::TextureFormat getDepthCopyFormat (VkFormat combinedFormat);
57 tcu::TextureFormat getStencilCopyFormat (VkFormat combinedFormat);
59 tcu::Sampler mapVkSampler (const VkSamplerCreateInfo& samplerCreateInfo);
60 tcu::Sampler::CompareMode mapVkSamplerCompareOp (VkCompareOp compareOp);
61 tcu::Sampler::WrapMode mapVkSamplerAddressMode (VkSamplerAddressMode addressMode);
62 tcu::Sampler::FilterMode mapVkMinTexFilter (VkFilter filter, VkSamplerMipmapMode mipMode);
63 tcu::Sampler::FilterMode mapVkMagTexFilter (VkFilter filter);
64 int mapVkComponentSwizzle (const VkComponentSwizzle& channelSwizzle);
65 tcu::UVec4 mapVkComponentMapping (const vk::VkComponentMapping& mapping);
67 VkComponentMapping getFormatComponentMapping (VkFormat format);
68 VkFilter mapFilterMode (tcu::Sampler::FilterMode filterMode);
69 VkSamplerMipmapMode mapMipmapMode (tcu::Sampler::FilterMode filterMode);
70 VkSamplerAddressMode mapWrapMode (tcu::Sampler::WrapMode wrapMode);
71 VkCompareOp mapCompareMode (tcu::Sampler::CompareMode mode);
72 VkFormat mapTextureFormat (const tcu::TextureFormat& format);
73 VkSamplerCreateInfo mapSampler (const tcu::Sampler& sampler, const tcu::TextureFormat& format);
75 void imageUtilSelfTest (void);
79 #endif // _VKIMAGEUTIL_HPP