1 #ifndef _VKIMAGEUTIL_HPP
2 #define _VKIMAGEUTIL_HPP
3 /*-------------------------------------------------------------------------
4  * Vulkan CTS Framework
5  * --------------------
6  *
7  * Copyright (c) 2015 The Khronos Group Inc.
8  * Copyright (c) 2015 Imagination Technologies Ltd.
9  * Copyright (c) 2015 Google Inc.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  *      http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  *
23  *//*!
24  * \file
25  * \brief Utilities for images.
26  *//*--------------------------------------------------------------------*/
27 
28 #include "vkDefs.hpp"
29 #include "tcuTexture.hpp"
30 #include "tcuCompressedTexture.hpp"
31 
32 namespace vk
33 {
34 
35 bool						isFloatFormat				(VkFormat format);
36 bool						isUnormFormat				(VkFormat format);
37 bool						isSnormFormat				(VkFormat format);
38 bool						isIntFormat					(VkFormat format);
39 bool						isUintFormat				(VkFormat format);
40 bool						isDepthStencilFormat		(VkFormat format);
41 bool						isCompressedFormat			(VkFormat format);
42 bool						isSrgbFormat				(VkFormat format);
43 
44 bool						isSupportedByFramework		(VkFormat format);
45 
46 tcu::TextureFormat			mapVkFormat					(VkFormat format);
47 tcu::CompressedTexFormat	mapVkCompressedFormat		(VkFormat format);
48 tcu::TextureFormat			getDepthCopyFormat			(VkFormat combinedFormat);
49 tcu::TextureFormat			getStencilCopyFormat		(VkFormat combinedFormat);
50 
51 tcu::Sampler				mapVkSampler				(const VkSamplerCreateInfo& samplerCreateInfo);
52 tcu::Sampler::CompareMode	mapVkSamplerCompareOp		(VkCompareOp compareOp);
53 tcu::Sampler::WrapMode		mapVkSamplerAddressMode		(VkSamplerAddressMode addressMode);
54 tcu::Sampler::FilterMode	mapVkMinTexFilter			(VkFilter filter, VkSamplerMipmapMode mipMode);
55 tcu::Sampler::FilterMode	mapVkMagTexFilter			(VkFilter filter);
56 
57 VkFilter					mapFilterMode				(tcu::Sampler::FilterMode filterMode);
58 VkSamplerMipmapMode			mapMipmapMode				(tcu::Sampler::FilterMode filterMode);
59 VkSamplerAddressMode		mapWrapMode					(tcu::Sampler::WrapMode wrapMode);
60 VkCompareOp					mapCompareMode				(tcu::Sampler::CompareMode mode);
61 VkFormat					mapTextureFormat			(const tcu::TextureFormat& format);
62 VkSamplerCreateInfo			mapSampler					(const tcu::Sampler& sampler, const tcu::TextureFormat& format, float minLod = 0.0f, float maxLod = 1000.0f);
63 
64 void						imageUtilSelfTest			(void);
65 
66 } // vk
67 
68 #endif // _VKIMAGEUTIL_HPP
69