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
32namespace vk
33{
34
35bool						isFloatFormat				(VkFormat format);
36bool						isUnormFormat				(VkFormat format);
37bool						isSnormFormat				(VkFormat format);
38bool						isIntFormat					(VkFormat format);
39bool						isUintFormat				(VkFormat format);
40bool						isDepthStencilFormat		(VkFormat format);
41bool						isCompressedFormat			(VkFormat format);
42
43tcu::TextureFormat			mapVkFormat					(VkFormat format);
44tcu::CompressedTexFormat	mapVkCompressedFormat		(VkFormat format);
45tcu::TextureFormat			getDepthCopyFormat			(VkFormat combinedFormat);
46tcu::TextureFormat			getStencilCopyFormat		(VkFormat combinedFormat);
47
48tcu::Sampler				mapVkSampler				(const VkSamplerCreateInfo& samplerCreateInfo);
49tcu::Sampler::CompareMode	mapVkSamplerCompareOp		(VkCompareOp compareOp);
50tcu::Sampler::WrapMode		mapVkSamplerAddressMode		(VkSamplerAddressMode addressMode);
51tcu::Sampler::FilterMode	mapVkMinTexFilter			(VkFilter filter, VkSamplerMipmapMode mipMode);
52tcu::Sampler::FilterMode	mapVkMagTexFilter			(VkFilter filter);
53int							mapVkComponentSwizzle		(const VkComponentSwizzle& channelSwizzle);
54tcu::UVec4					mapVkComponentMapping		(const vk::VkComponentMapping& mapping);
55
56VkComponentMapping			getFormatComponentMapping	(VkFormat format);
57VkFilter					mapFilterMode				(tcu::Sampler::FilterMode filterMode);
58VkSamplerMipmapMode			mapMipmapMode				(tcu::Sampler::FilterMode filterMode);
59VkSamplerAddressMode		mapWrapMode					(tcu::Sampler::WrapMode wrapMode);
60VkCompareOp					mapCompareMode				(tcu::Sampler::CompareMode mode);
61VkFormat					mapTextureFormat			(const tcu::TextureFormat& format);
62VkSamplerCreateInfo			mapSampler					(const tcu::Sampler& sampler, const tcu::TextureFormat& format);
63
64void						imageUtilSelfTest			(void);
65
66} // vk
67
68#endif // _VKIMAGEUTIL_HPP
69