From ffe0526064309bda2b24c1503e1b43316b33e6d7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 3 Aug 2017 16:08:18 +0200 Subject: vo_opengl: simplify/fix user shader textures This broke float textures, which were actually used by some shaders. There were probably some other bugs as well. Lots of code can be avoided by using ra_tex_params directly, so do that. The main change is that COMPONENT/FORMAT are replaced by a single FORMAT directive, which takes different parameters now. Due to the mess with 16/32 bit float textures, and because we want to support other APIs than just GL in the future, it's not really clear how this should be handled, and the nice component/type separation makes things actually harder. So just jump the gun and use the ra_format.name names, which were originally meant mostly for debugging. (This is probably something that will be regretted later.) Still only superficially tested, but seems to work. Fixes #4708. --- DOCS/man/options.rst | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'DOCS') diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 814f6fe2d9..02cb4d826d 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -4249,20 +4249,22 @@ The following video options are currently all specific to ``--vo=opengl`` and The name of this texture. Hooks can then bind the texture under this name using BIND. This must be the first option of the texture block. - SIZE [] [] + SIZE [] [] (required) The dimensions of the texture. The height and depth are optional. The type of texture (1D, 2D or 3D) depends on the number of components specified. - COMPONENTS - The number of components per texel contained in the texture. Defaults - to 1. - - FORMAT - The texture format for the samples. A valid texture specification is - the number of bits followed by a single letter which is either ``f`` - (for float), ``i`` (for uint) or ``u`` (for unorm), for example - ``32f``. Defaults to ``8i``. + FORMAT (required) + The texture format for the samples. Supported texture formats are listed + in debug logging when the ``opengl`` VO is initialized (look for + ``Texture formats:``). Usually, this follows OpenGL naming conventions. + For example, ``rgb16`` provides 3 channels with normalized 16 bit + components. One oddity are float formats: for example, ``rgba16f`` has + 16 bit internal precision, but the texture data is provided as 32 bit + floats, and the driver converts the data on texture upload. + + Although format names follow a common naming convention, not all of them + are available on all hardware, drivers, GL versions, and so on. FILTER The min/magnification filter used when sampling from this texture. -- cgit v1.2.3