From 54c48bd80120a3085e6d23f7cf6124b0657436e7 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Wed, 8 Jun 2016 15:05:28 +0200 Subject: vo_opengl: make user hook passes optional User hooks can now use an extra WHEN expression to specify when the shader should be run. For example, this can be used to only run a chroma scaling shader `WHEN CHROMA.w LUMA.w <`. There's a slight semantics change to user shaders: When trying to bind a texture that does not exist, a shader will now be silently skipped (similar to when the condition is false) instead of generating an error. This allows shader stages to depend on an optional earlier stage without having to copy/paste the same condition everywhere. (In other words: there's an implicit condition on all of the bound textures existing) --- DOCS/man/vo.rst | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'DOCS/man/vo.rst') diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst index f8c9c342f8..7eaf2d6636 100644 --- a/DOCS/man/vo.rst +++ b/DOCS/man/vo.rst @@ -746,10 +746,17 @@ Available video output drivers are: WIDTH , HEIGHT Specifies the size of the resulting texture for this pass. ``szexpr`` refers to an expression in RPN (reverse polish - notation), using the operators + - * /, floating point literals, - and references to existing texture sizes such as MAIN.width or - CHROMA.height. By default, these are set to HOOKED.w and HOOKED.h, - respectively. + notation), using the operators + - * / > < !, floating point + literals, and references to existing texture sizes such as + MAIN.width or CHROMA.height. By default, these are set to HOOKED.w + and HOOKED.h, respectively. + + WHEN + Specifies a condition that needs to be true (non-zero) for the + shader stage to be evaluated. If it fails, it will silently be + omitted. (Note that a shader stage like this which has a dependency + on an optional hook point can still cause that hook point to be + saved, which has some minor overhead) OFFSET ox oy Indicates a pixel shift (offset) introduced by this pass. These -- cgit v1.2.3