blob: 1991394c7a858ef4bc773411682fa68ed264cc08 [file] [log] [blame]
Chia-I Wuac6ba132014-08-07 14:21:43 +08001/*
2 * XGL
3 *
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,
36 XGL_FORMAT 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) {
41 case XGL_FMT_D16_UNORM:
42 case XGL_FMT_D24_UNORM:
43 case XGL_FMT_D32_SFLOAT:
Chia-I Wu9ec7e702015-02-19 13:18:42 -070044 /* XGL_FMT_D16_UNORM_S8_UINT is unsupported */
45 case XGL_FMT_D24_UNORM_S8_UINT:
46 case XGL_FMT_D32_SFLOAT_S8_UINT:
47 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,
57 XGL_FORMAT format);
Chia-I Wu1bf06df2014-08-16 12:33:13 +080058
Chia-I Wuac6ba132014-08-07 14:21:43 +080059#endif /* FORMAT_H */