mesa/src/vulkan/runtime/vk_blend.h
Alyssa Rosenzweig 31001c6184 vulkan: Add helpers for blend enum translation
Vulkan drivers that use nir_lower_blend need to translate Vulkan enums to the
common (non-Vulkan) versions used in nir_lower_blend. We don't need to duplicate
that boilerplate in every VK driver that uses nir_lower_blend, move panvk's
versions to common code so we can use them in agxv. I suspect powervr wants this
too.

It might be useful to also share the logic to translate vk_color_blend_state
to nir_lower_blend_options wholesale, but panvk wouldn't use it and agxv is
downstream so it wouldn't have any in-tree users. So I'll keep that part
vendored (for now). For now, let's share the easy win of the enum translation.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076>
2023-07-13 21:03:32 +00:00

25 lines
444 B
C

/*
* Copyright 2023 Valve Corporation
* SPDX-License-Identifier: MIT
*/
#ifndef VK_BLEND_H
#define VK_BLEND_H
#include <stdbool.h>
#include "util/blend.h"
#include "vulkan/vulkan_core.h"
#ifdef __cplusplus
extern "C" {
#endif
enum pipe_logicop vk_logic_op_to_pipe(VkLogicOp in);
enum pipe_blend_func vk_blend_op_to_pipe(VkBlendOp in);
enum pipe_blendfactor vk_blend_factor_to_pipe(VkBlendFactor in);
#ifdef __cplusplus
}
#endif
#endif