Mesa (master): st: add support for INTEL_blackhole_render

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 13 17:24:04 UTC 2020


Module: Mesa
Branch: master
Commit: 6d35610bd57aacb494e49da692b5331b0e4d11b6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6d35610bd57aacb494e49da692b5331b0e4d11b6

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Thu Dec  5 14:46:51 2019 +0200

st: add support for INTEL_blackhole_render

Adding a new CSO proved to be fairly difficult especially because this
extension affect draw/dispatch/blit alike.

Instead this change passes the state of the noop into the entry points
emitting the operations affected.

v2: Fix assert in default pipe caps

v3: Drop whitespace changes (Ken)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2964>

---

 src/gallium/auxiliary/util/u_screen.c  |  4 ++++
 src/gallium/include/pipe/p_context.h   | 11 +++++++++++
 src/gallium/include/pipe/p_defines.h   |  2 ++
 src/mesa/state_tracker/st_context.c    |  3 +++
 src/mesa/state_tracker/st_extensions.c |  1 +
 5 files changed, 21 insertions(+)

diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c
index 785d1bd3e24..821bb16d539 100644
--- a/src/gallium/auxiliary/util/u_screen.c
+++ b/src/gallium/auxiliary/util/u_screen.c
@@ -408,6 +408,10 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
    case PIPE_CAP_INTEGER_MULTIPLY_32X16:
       return 0;
 
+   case PIPE_CAP_FRONTEND_NOOP:
+      /* Enables INTEL_blackhole_render */
+      return 0;
+
    default:
       unreachable("bad PIPE_CAP_*");
    }
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index b8051df57fe..3a8b9eba462 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -468,6 +468,17 @@ struct pipe_context {
    /*@}*/
 
 
+   /**
+    * INTEL_blackhole_render
+    */
+   /*@{*/
+
+   void (*set_frontend_noop)(struct pipe_context *,
+                             bool enable);
+
+   /*@}*/
+
+
    /**
     * Resource functions for blit-like functionality
     *
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 4a7edd4e084..ca6d27e9700 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -912,6 +912,8 @@ enum pipe_cap
    PIPE_CAP_MAX_VERTEX_BUFFERS,
    PIPE_CAP_OPENCL_INTEGER_FUNCTIONS,
    PIPE_CAP_INTEGER_MULTIPLY_32X16,
+   /* Turn draw, dispatch, blit into NOOP */
+   PIPE_CAP_FRONTEND_NOOP,
 };
 
 /**
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 2ec0532ce57..b67850e1f04 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -105,6 +105,9 @@ st_Enable(struct gl_context *ctx, GLenum cap, GLboolean state)
    case GL_DEBUG_OUTPUT_SYNCHRONOUS:
       st_update_debug_callback(st);
       break;
+   case GL_BLACKHOLE_RENDER_INTEL:
+      st->pipe->set_frontend_noop(st->pipe, ctx->IntelBlackholeRender);
+      break;
    default:
       break;
    }
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 3c598fef2bd..f3d13d7ad8c 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -793,6 +793,7 @@ void st_init_extensions(struct pipe_screen *screen,
       { o(OES_texture_float_linear),         PIPE_CAP_TEXTURE_FLOAT_LINEAR             },
       { o(OES_texture_half_float_linear),    PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR        },
       { o(OES_texture_view),                 PIPE_CAP_SAMPLER_VIEW_TARGET              },
+      { o(INTEL_blackhole_render),           PIPE_CAP_FRONTEND_NOOP,                   },
    };
 
    /* Required: render target and sampler support */



More information about the mesa-commit mailing list