mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
pan: fix pan_blend_reads_dest to consider special min/max funcs
The min/max funcs are designed to operate solely on the source and destination colors directly, without any scaling or multiplication by a factor. Test: dEQP-GLES3.functional.fragment_ops.blend.* pass with enabled FPK Cc: mesa-stable Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38824>
This commit is contained in:
parent
ea77f60c0e
commit
d5bf0b0df7
1 changed files with 8 additions and 1 deletions
|
|
@ -408,6 +408,12 @@ is_dest_factor(enum pipe_blendfactor factor, bool alpha)
|
|||
(factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE && !alpha);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
is_min_max(enum pipe_blend_func func)
|
||||
{
|
||||
return func == PIPE_BLEND_MIN || func == PIPE_BLEND_MAX;
|
||||
}
|
||||
|
||||
/* Determines if a blend equation reads back the destination. This can occur by
|
||||
* explicitly referencing the destination in the blend equation, or by using a
|
||||
* partial writemask. */
|
||||
|
|
@ -421,7 +427,8 @@ pan_blend_reads_dest(const struct pan_blend_equation equation)
|
|||
if (!equation.blend_enable)
|
||||
return false;
|
||||
|
||||
return is_dest_factor(equation.rgb_src_factor, false) ||
|
||||
return is_min_max(equation.rgb_func) || is_min_max(equation.alpha_func) ||
|
||||
is_dest_factor(equation.rgb_src_factor, false) ||
|
||||
is_dest_factor(equation.alpha_src_factor, true) ||
|
||||
equation.rgb_dst_factor != PIPE_BLENDFACTOR_ZERO ||
|
||||
equation.alpha_dst_factor != PIPE_BLENDFACTOR_ZERO;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue