dEQP-VK.renderpass: Set IMAGE_USAGE_TRANSFER_SRC_BIT when needed
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / framework / vulkan / vkImageUtil.hpp
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  * 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:
18  *
19  * The above copyright notice(s) and this permission notice shall be
20  * included in all copies or substantial portions of the Materials.
21  *
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.
25  *
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.
33  *
34  *//*!
35  * \file
36  * \brief Utilities for images.
37  *//*--------------------------------------------------------------------*/
38
39 #include "vkDefs.hpp"
40 #include "tcuTexture.hpp"
41 #include "tcuCompressedTexture.hpp"
42
43 namespace vk
44 {
45
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);
53
54 tcu::TextureFormat                      mapVkFormat                                     (VkFormat format);
55 tcu::CompressedTexFormat        mapVkCompressedFormat           (VkFormat format);
56 tcu::TextureFormat                      getDepthCopyFormat                      (VkFormat combinedFormat);
57 tcu::TextureFormat                      getStencilCopyFormat            (VkFormat combinedFormat);
58
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);
66
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
74 void                                            imageUtilSelfTest                       (void);
75
76 } // vk
77
78 #endif // _VKIMAGEUTIL_HPP