mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-19 07:08:05 +02:00
frontends/va: Enable shader-based alpha blending
Signed-off-by: Thong Thai <thong.thai@amd.com> Reviewed-by: David Rosca <david.rosca@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41090>
This commit is contained in:
parent
c96c7e77f7
commit
06c84cc773
1 changed files with 14 additions and 5 deletions
|
|
@ -126,8 +126,10 @@ vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context,
|
|||
PIPE_VIDEO_CAP_VPP_BLEND_MODES);
|
||||
|
||||
pipeline_cap->blend_flags = 0;
|
||||
if (pipe_blend_modes & PIPE_VIDEO_VPP_BLEND_MODE_GLOBAL_ALPHA)
|
||||
if (!media_only || pipe_blend_modes & PIPE_VIDEO_VPP_BLEND_MODE_GLOBAL_ALPHA)
|
||||
pipeline_cap->blend_flags |= VA_BLEND_GLOBAL_ALPHA;
|
||||
if (!media_only || pipe_blend_modes & PIPE_VIDEO_VPP_BLEND_MODE_PREMULTIPLIED_ALPHA)
|
||||
pipeline_cap->blend_flags |= VA_BLEND_PREMULTIPLIED_ALPHA;
|
||||
|
||||
vlVaDriver *drv = VL_VA_DRIVER(ctx);
|
||||
|
||||
|
|
@ -379,9 +381,14 @@ vlVaPostProcCompositor(vlVaDriver *drv,
|
|||
mirror = VL_COMPOSITOR_MIRROR_NONE;
|
||||
|
||||
vl_compositor_clear_layers(&drv->cstate);
|
||||
|
||||
vl_compositor_set_layer_rotation(&drv->cstate, 0, rotation);
|
||||
vl_compositor_set_layer_mirror(&drv->cstate, 0, mirror);
|
||||
|
||||
drv->cstate.layers[0].blend_enabled = param->blend.enabled;
|
||||
drv->cstate.layers[0].blend_mode = param->blend.mode;
|
||||
drv->cstate.layers[0].blend_alpha = param->blend.global_alpha;
|
||||
|
||||
if (dst_yuv) {
|
||||
if (src_yuv) {
|
||||
/* YUV -> YUV */
|
||||
|
|
@ -647,10 +654,12 @@ vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *contex
|
|||
}
|
||||
|
||||
if (param->blend_state) {
|
||||
if (param->blend_state->flags & VA_BLEND_GLOBAL_ALPHA) {
|
||||
vpp.blend.mode = PIPE_VIDEO_VPP_BLEND_MODE_GLOBAL_ALPHA;
|
||||
vpp.blend.global_alpha = param->blend_state->global_alpha;
|
||||
}
|
||||
vpp.blend.enabled = true;
|
||||
vpp.blend.global_alpha = param->blend_state->global_alpha;
|
||||
if (param->blend_state->flags & VA_BLEND_GLOBAL_ALPHA)
|
||||
vpp.blend.mode |= PIPE_VIDEO_VPP_BLEND_MODE_GLOBAL_ALPHA;
|
||||
if (param->blend_state->flags & VA_BLEND_PREMULTIPLIED_ALPHA)
|
||||
vpp.blend.mode |= PIPE_VIDEO_VPP_BLEND_MODE_PREMULTIPLIED_ALPHA;
|
||||
}
|
||||
|
||||
/* Output background color */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue