blob: f9626914a9cf0f8bbe535a00aa91e5c6e7e2293e [file] [log] [blame]
Chia-I Wuac6ba132014-08-07 14:21:43 +08001/*
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002 * Vulkan
Chia-I Wuac6ba132014-08-07 14:21:43 +08003 *
4 * Copyright (C) 2014 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
Chia-I Wu44e42362014-09-02 08:32:09 +080023 *
24 * Authors:
25 * Chia-I Wu <olv@lunarg.com>
Chia-I Wuac6ba132014-08-07 14:21:43 +080026 */
27
28#ifndef FORMAT_H
29#define FORMAT_H
30
31#include "intel.h"
32
Chia-I Wufb240262014-08-16 13:26:06 +080033struct intel_gpu;
34
Chia-I Wu9ec7e702015-02-19 13:18:42 -070035static inline bool intel_format_has_depth(const struct intel_gpu *gpu,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060036 VkFormat format)
Chia-I Wu1bf06df2014-08-16 12:33:13 +080037{
Chia-I Wu9ec7e702015-02-19 13:18:42 -070038 bool has_depth = false;
Jeremy Hayes2b7e88a2015-01-23 08:51:43 -070039
40 switch (format) {
Tony Barbour8205d902015-04-16 15:59:00 -060041 case VK_FORMAT_D16_UNORM:
Courtney Goeltzenleuchter7ed10592015-09-10 17:17:43 -060042 case VK_FORMAT_D24_UNORM_X8:
Tony Barbour8205d902015-04-16 15:59:00 -060043 case VK_FORMAT_D32_SFLOAT:
44 /* VK_FORMAT_D16_UNORM_S8_UINT is unsupported */
45 case VK_FORMAT_D24_UNORM_S8_UINT:
46 case VK_FORMAT_D32_SFLOAT_S8_UINT:
Chia-I Wu9ec7e702015-02-19 13:18:42 -070047 has_depth = true;
Jeremy Hayes2b7e88a2015-01-23 08:51:43 -070048 break;
49 default:
50 break;
51 }
52
Chia-I Wu9ec7e702015-02-19 13:18:42 -070053 return has_depth;
Chia-I Wu1bf06df2014-08-16 12:33:13 +080054}
55
Chia-I Wufb240262014-08-16 13:26:06 +080056int intel_format_translate_color(const struct intel_gpu *gpu,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060057 VkFormat format);
Chia-I Wu1bf06df2014-08-16 12:33:13 +080058
Chia-I Wuac6ba132014-08-07 14:21:43 +080059#endif /* FORMAT_H */