mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 15:20:17 +01:00
vulkan/util: Add a vk_format_srgb_to_linear() helper
Reviewed-by: Mel Henning <mhenning@darkrefraction.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38094>
This commit is contained in:
parent
3955787ab2
commit
127de27015
1 changed files with 10 additions and 0 deletions
|
|
@ -196,6 +196,16 @@ vk_format_is_srgb(VkFormat format)
|
|||
return util_format_is_srgb(vk_format_to_pipe_format(format));
|
||||
}
|
||||
|
||||
static inline VkFormat
|
||||
vk_format_srgb_to_linear(VkFormat format)
|
||||
{
|
||||
if (!vk_format_is_srgb(format))
|
||||
return format;
|
||||
|
||||
return vk_format_from_pipe_format(
|
||||
util_format_linear(vk_format_to_pipe_format(format)));
|
||||
}
|
||||
|
||||
static inline bool vk_format_is_alpha(VkFormat format)
|
||||
{
|
||||
return util_format_is_alpha(vk_format_to_pipe_format(format));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue