Path: blob/21.2-virgl/src/broadcom/vulkan/vk_format_info.h
4560 views
/*1* Copyright © 2016 Intel Corporation2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS20* IN THE SOFTWARE.21*/2223#ifndef VK_FORMAT_INFO_H24#define VK_FORMAT_INFO_H2526#include <stdbool.h>27#include <vulkan/vulkan.h>2829#include "util/format/u_format.h"30#include "vulkan/util/vk_format.h"3132/* FIXME: from freedreno vk_format.h, common place?*/33static inline bool34vk_format_is_int(VkFormat format)35{36return util_format_is_pure_integer(vk_format_to_pipe_format(format));37}3839static inline bool40vk_format_is_sint(VkFormat format)41{42return util_format_is_pure_sint(vk_format_to_pipe_format(format));43}4445static inline bool46vk_format_is_uint(VkFormat format)47{48return util_format_is_pure_uint(vk_format_to_pipe_format(format));49}5051static inline bool52vk_format_is_srgb(VkFormat format)53{54return util_format_is_srgb(vk_format_to_pipe_format(format));55}5657static inline unsigned58vk_format_get_blocksize(VkFormat format)59{60return util_format_get_blocksize(vk_format_to_pipe_format(format));61}6263static inline unsigned64vk_format_get_blockwidth(VkFormat format)65{66return util_format_get_blockwidth(vk_format_to_pipe_format(format));67}6869static inline unsigned70vk_format_get_blockheight(VkFormat format)71{72return util_format_get_blockheight(vk_format_to_pipe_format(format));73}7475static inline bool76vk_format_is_compressed(VkFormat format)77{78return util_format_is_compressed(vk_format_to_pipe_format(format));79}8081static inline const struct util_format_description *82vk_format_description(VkFormat format)83{84return util_format_description(vk_format_to_pipe_format(format));85}8687#endif /* VK_FORMAT_INFO_H */888990