blob: f9626914a9cf0f8bbe535a00aa91e5c6e7e2293e [file] [log] [blame]
/*
* Vulkan
*
* Copyright (C) 2014 LunarG, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Chia-I Wu <olv@lunarg.com>
*/
#ifndef FORMAT_H
#define FORMAT_H
#include "intel.h"
struct intel_gpu;
static inline bool intel_format_has_depth(const struct intel_gpu *gpu,
VkFormat format)
{
bool has_depth = false;
switch (format) {
case VK_FORMAT_D16_UNORM:
case VK_FORMAT_D24_UNORM_X8:
case VK_FORMAT_D32_SFLOAT:
/* VK_FORMAT_D16_UNORM_S8_UINT is unsupported */
case VK_FORMAT_D24_UNORM_S8_UINT:
case VK_FORMAT_D32_SFLOAT_S8_UINT:
has_depth = true;
break;
default:
break;
}
return has_depth;
}
int intel_format_translate_color(const struct intel_gpu *gpu,
VkFormat format);
#endif /* FORMAT_H */