Chia-I Wu | ac6ba13 | 2014-08-07 14:21:43 +0800 | [diff] [blame] | 1 | /* |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 2 | * Vulkan |
Chia-I Wu | ac6ba13 | 2014-08-07 14:21:43 +0800 | [diff] [blame] | 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 Wu | 44e4236 | 2014-09-02 08:32:09 +0800 | [diff] [blame] | 23 | * |
| 24 | * Authors: |
| 25 | * Chia-I Wu <olv@lunarg.com> |
Chia-I Wu | ac6ba13 | 2014-08-07 14:21:43 +0800 | [diff] [blame] | 26 | */ |
| 27 | |
| 28 | #ifndef FORMAT_H |
| 29 | #define FORMAT_H |
| 30 | |
| 31 | #include "intel.h" |
| 32 | |
Chia-I Wu | fb24026 | 2014-08-16 13:26:06 +0800 | [diff] [blame] | 33 | struct intel_gpu; |
| 34 | |
Chia-I Wu | 9ec7e70 | 2015-02-19 13:18:42 -0700 | [diff] [blame] | 35 | static inline bool intel_format_has_depth(const struct intel_gpu *gpu, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 36 | VkFormat format) |
Chia-I Wu | 1bf06df | 2014-08-16 12:33:13 +0800 | [diff] [blame] | 37 | { |
Chia-I Wu | 9ec7e70 | 2015-02-19 13:18:42 -0700 | [diff] [blame] | 38 | bool has_depth = false; |
Jeremy Hayes | 2b7e88a | 2015-01-23 08:51:43 -0700 | [diff] [blame] | 39 | |
| 40 | switch (format) { |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 41 | case VK_FORMAT_D16_UNORM: |
Courtney Goeltzenleuchter | 7ed1059 | 2015-09-10 17:17:43 -0600 | [diff] [blame] | 42 | case VK_FORMAT_D24_UNORM_X8: |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 43 | 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 Wu | 9ec7e70 | 2015-02-19 13:18:42 -0700 | [diff] [blame] | 47 | has_depth = true; |
Jeremy Hayes | 2b7e88a | 2015-01-23 08:51:43 -0700 | [diff] [blame] | 48 | break; |
| 49 | default: |
| 50 | break; |
| 51 | } |
| 52 | |
Chia-I Wu | 9ec7e70 | 2015-02-19 13:18:42 -0700 | [diff] [blame] | 53 | return has_depth; |
Chia-I Wu | 1bf06df | 2014-08-16 12:33:13 +0800 | [diff] [blame] | 54 | } |
| 55 | |
Chia-I Wu | fb24026 | 2014-08-16 13:26:06 +0800 | [diff] [blame] | 56 | int intel_format_translate_color(const struct intel_gpu *gpu, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 57 | VkFormat format); |
Chia-I Wu | 1bf06df | 2014-08-16 12:33:13 +0800 | [diff] [blame] | 58 | |
Chia-I Wu | ac6ba13 | 2014-08-07 14:21:43 +0800 | [diff] [blame] | 59 | #endif /* FORMAT_H */ |