gallium: Add PIPE_CAP_FBFETCH_COHERENT and expose extensions
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 24 Apr 2019 20:17:54 +0000 (13:17 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 23 May 2019 15:13:09 +0000 (08:13 -0700)
st/mesa now exposes KHR_blend_equation_advanced_coherent and
EXT_shader_framebuffer_fetch if the new capability is supported.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/util/u_screen.c
src/gallium/docs/source/screen.rst
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_extensions.c

index 05ac9be94511ea5df7546775a9fd3601ea6ca989..6457bcffda125d55f3caa05deac5a76e72290ca1 100644 (file)
@@ -271,6 +271,7 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
       return 0;
 
    case PIPE_CAP_FBFETCH:
+   case PIPE_CAP_FBFETCH_COHERENT:
    case PIPE_CAP_TGSI_MUL_ZERO_WINS:
    case PIPE_CAP_DOUBLES:
    case PIPE_CAP_INT64:
index 054939f68879dccc03fb541bb12f9ca5d35eaf9f..70810418f8a8690a22a0afd4917bcb6a1b49f0e6 100644 (file)
@@ -382,6 +382,8 @@ The integer capabilities:
   current framebuffer can be read in the shader.  0 means framebuffer fetch
   is not supported.  1 means that only the first render target can be read,
   and a larger value would mean that multiple render targets are supported.
+* ``PIPE_CAP_FBFETCH_COHERENT``: Whether framebuffer fetches from the fragment
+  shader can be guaranteed to be coherent with framebuffer writes.
 * ``PIPE_CAP_TGSI_MUL_ZERO_WINS``: Whether TGSI shaders support the
   ``TGSI_PROPERTY_MUL_ZERO_WINS`` shader property.
 * ``PIPE_CAP_DOUBLES``: Whether double precision floating-point operations
index 6232547850fb78357168772b428af141edc1423f..d3c951279d9bd2835f1ecfd2fd51a3dc57fe4fe2 100644 (file)
@@ -884,6 +884,7 @@ enum pipe_cap
    PIPE_CAP_DMABUF,
    PIPE_CAP_PREFER_COMPUTE_BLIT_FOR_MULTIMEDIA,
    PIPE_CAP_FRAGMENT_SHADER_INTERLOCK,
+   PIPE_CAP_FBFETCH_COHERENT,
 };
 
 /**
index f442c08293bda8f183369e32d328ff6412c72a8b..3d5b0fa58368e506e1273e639e295721a2c50774 100644 (file)
@@ -1395,13 +1395,17 @@ void st_init_extensions(struct pipe_screen *screen,
    }
 
    unsigned max_fb_fetch_rts = screen->get_param(screen, PIPE_CAP_FBFETCH);
+   bool coherent_fb_fetch =
+      screen->get_param(screen, PIPE_CAP_FBFETCH_COHERENT);
 
    if (max_fb_fetch_rts > 0) {
       extensions->KHR_blend_equation_advanced = true;
+      extensions->KHR_blend_equation_advanced_coherent = coherent_fb_fetch;
 
       if (max_fb_fetch_rts >=
           screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS)) {
          extensions->EXT_shader_framebuffer_fetch_non_coherent = true;
+         extensions->EXT_shader_framebuffer_fetch = coherent_fb_fetch;
       }
    }