From 3038e8984df2be35a7164043ec6d385e32e26238 Mon Sep 17 00:00:00 2001 From: Charmaine Lee Date: Thu, 14 Jan 2016 10:22:17 -0700 Subject: gallium/st: add pipe_context::generate_mipmap() This patch adds a new interface to support hardware mipmap generation. PIPE_CAP_GENERATE_MIPMAP is added to allow a driver to specify if this new interface is supported; if not supported, the state tracker will fallback to mipmap generation by rendering/texturing. v2: add PIPE_CAP_GENERATE_MIPMAP to the disabled section for all drivers v3: add format to the generate_mipmap interface to allow mipmap generation using a format other than the resource format v4: fix return type of trace_context_generate_mipmap() Reviewed-by: Brian Paul Reviewed-by: Roland Scheidegger Reviewed-by: Jose Fonseca --- src/gallium/docs/source/context.rst | 11 +++++++++++ src/gallium/docs/source/screen.rst | 2 ++ 2 files changed, 13 insertions(+) (limited to 'src/gallium/docs') diff --git a/src/gallium/docs/source/context.rst b/src/gallium/docs/source/context.rst index 9a32716..4c03e00 100644 --- a/src/gallium/docs/source/context.rst +++ b/src/gallium/docs/source/context.rst @@ -648,3 +648,14 @@ In addition, normal texture sampling is allowed from the compute program: ``bind_sampler_states`` may be used to set up texture samplers for the compute stage and ``set_sampler_views`` may be used to bind a number of sampler views to it. + +Mipmap generation +^^^^^^^^^^^^^^^^^ + +If PIPE_CAP_GENERATE_MIPMAP is true, ``generate_mipmap`` can be used +to generate mipmaps for the specified texture resource. +It replaces texel image levels base_level+1 through +last_level for layers range from first_layer through last_layer. +It returns TRUE if mipmap generation succeeds, otherwise it +returns FALSE. Mipmap generation may fail when it is not supported +for particular texture types or formats. diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index 81de7f8..d7ea123 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -303,6 +303,8 @@ The integer capabilities: shader buffers are not supported. * ``PIPE_CAP_INVALIDATE_BUFFER``: Whether the use of ``invalidate_resource`` for buffers is supported. +* ``PIPE_CAP_GENERATE_MIPMAP``: Indicates whether pipe_context::generate_mipmap + is supported. .. _pipe_capf: -- cgit v1.1