radv: inline radv_can_enable_dual_src()

this is unexpectedly heavy

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23601>
This commit is contained in:
Mike Blumenkrantz 2023-06-08 15:05:46 -04:00 committed by Marge Bot
parent 8b73109a93
commit df6749ed56
2 changed files with 19 additions and 21 deletions

View file

@ -260,25 +260,6 @@ radv_format_meta_fs_key(struct radv_device *device, VkFormat format)
}
}
bool
radv_can_enable_dual_src(const struct vk_color_blend_attachment_state *att)
{
VkBlendOp eqRGB = att->color_blend_op;
VkBlendFactor srcRGB = att->src_color_blend_factor;
VkBlendFactor dstRGB = att->dst_color_blend_factor;
VkBlendOp eqA = att->alpha_blend_op;
VkBlendFactor srcA = att->src_alpha_blend_factor;
VkBlendFactor dstA = att->dst_alpha_blend_factor;
bool eqRGB_minmax = eqRGB == VK_BLEND_OP_MIN || eqRGB == VK_BLEND_OP_MAX;
bool eqA_minmax = eqA == VK_BLEND_OP_MIN || eqA == VK_BLEND_OP_MAX;
if (!eqRGB_minmax && (radv_is_dual_src(srcRGB) || radv_is_dual_src(dstRGB)))
return true;
if (!eqA_minmax && (radv_is_dual_src(srcA) || radv_is_dual_src(dstA)))
return true;
return false;
}
static bool
radv_pipeline_needs_dynamic_ps_epilog(const struct radv_graphics_pipeline *pipeline)
{

View file

@ -3499,6 +3499,25 @@ radv_is_dual_src(VkBlendFactor factor)
}
}
static ALWAYS_INLINE bool
radv_can_enable_dual_src(const struct vk_color_blend_attachment_state *att)
{
VkBlendOp eqRGB = att->color_blend_op;
VkBlendFactor srcRGB = att->src_color_blend_factor;
VkBlendFactor dstRGB = att->dst_color_blend_factor;
VkBlendOp eqA = att->alpha_blend_op;
VkBlendFactor srcA = att->src_alpha_blend_factor;
VkBlendFactor dstA = att->dst_alpha_blend_factor;
bool eqRGB_minmax = eqRGB == VK_BLEND_OP_MIN || eqRGB == VK_BLEND_OP_MAX;
bool eqA_minmax = eqA == VK_BLEND_OP_MIN || eqA == VK_BLEND_OP_MAX;
if (!eqRGB_minmax && (radv_is_dual_src(srcRGB) || radv_is_dual_src(dstRGB)))
return true;
if (!eqA_minmax && (radv_is_dual_src(srcA) || radv_is_dual_src(dstA)))
return true;
return false;
}
static inline void
radv_normalize_blend_factor(VkBlendOp op, VkBlendFactor *src_factor, VkBlendFactor *dst_factor)
{
@ -3511,8 +3530,6 @@ radv_normalize_blend_factor(VkBlendOp op, VkBlendFactor *src_factor, VkBlendFact
void si_blend_remove_dst(VkBlendOp *func, VkBlendFactor *src_factor, VkBlendFactor *dst_factor,
VkBlendFactor expected_dst, VkBlendFactor replacement_src);
bool radv_can_enable_dual_src(const struct vk_color_blend_attachment_state *att);
uint32_t radv_get_tess_output_topology(const struct radv_graphics_pipeline *pipeline,
VkTessellationDomainOrigin domain_origin);