Skip to content

Commit

Permalink
renderer: allow blending final output
Browse files Browse the repository at this point in the history
This is pretty trivial to support, and moves things further in
consideration of haasn#118.
  • Loading branch information
haasn committed Dec 4, 2020
1 parent 0d6b370 commit 5e809d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project('libplacebo', ['c', 'cpp'],
license: 'LGPL2.1+',
default_options: ['c_std=c99', 'cpp_std=c++11', 'warning_level=2'],
meson_version: '>=0.51',
version: '2.103.0',
version: '2.104.0',
)

# Version number
Expand Down
5 changes: 5 additions & 0 deletions src/include/libplacebo/renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ struct pl_render_params {
// If NULL, this feature is disabled.
const struct pl_cone_params *cone_params;

// Configures output blending. When rendering to the final target, the
// framebuffer contents will be blended using this blend mode. Requires
// that the target format has PL_FMT_CAP_BLENDABLE. NULL disables blending.
const struct pl_blend_params *blend_params;

// List of custom user shaders / hooks.
// See <libplacebo/shaders/custom.h> for more information.
const struct pl_hook * const *hooks;
Expand Down
1 change: 1 addition & 0 deletions src/renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1572,6 +1572,7 @@ static bool pass_output_target(struct pl_renderer *rr, struct pass_state *pass,
bool ok = pl_dispatch_finish(rr->dp, &(struct pl_dispatch_params) {
.shader = &sh,
.target = plane->texture,
.blend_params = params->blend_params,
.rect = {
.x0 = flipped_x ? rx1 : rx0,
.y0 = flipped_y ? ry1 : ry0,
Expand Down

0 comments on commit 5e809d8

Please sign in to comment.