From: Gert Wollny <gert.wol...@collabora.com> Add a new cap that indicates whether the drivers supports enabling/disabling the conversion from linear space to sRGB for a framebuffer attachment. In Driver terms that this CAP indicates whether the driver can switch between a linear and and a sRGB surface format for draw destinations without changing the surface itself.
v2: rename CAP to DEST_SURFACE_SRGB_CONTROL to reflect its purpouse better (pointed out by Ilia Mirkin) Signed-off-by: Gert Wollny <gert.wol...@collabora.com> --- src/gallium/auxiliary/util/u_screen.c | 3 +++ src/gallium/docs/source/screen.rst | 3 +++ src/gallium/include/pipe/p_defines.h | 1 + 3 files changed, 7 insertions(+) diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c index 73dbbee94a..b737375ee0 100644 --- a/src/gallium/auxiliary/util/u_screen.c +++ b/src/gallium/auxiliary/util/u_screen.c @@ -326,6 +326,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen, case PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET: return 2047; + case PIPE_CAP_DEST_SURFACE_SRGB_CONTROL: + return 1; + default: unreachable("bad PIPE_CAP_*"); } diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index 0abd164494..dbdf9e94d1 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -477,6 +477,9 @@ subpixel precision bias in bits during conservative rasterization. 0 means no limit. * ``PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET``: The maximum supported value for of pipe_vertex_element::src_offset. +* ``PIPE_CAP_DEST_SURFACE_SRGB_CONTROL``: Indicates whether the drivers + supports switching the format between sRGB and linear for a surface that is + used as destination in draw and blit calls. .. _pipe_capf: diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 693f041b1d..c8eaad0104 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -826,6 +826,7 @@ enum pipe_cap PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS, PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET, PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET, + PIPE_CAP_DEST_SURFACE_SRGB_CONTROL, }; /** -- 2.18.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev