From d5575ca7a14f50079782cbc5ed6d018dae108ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 21 Sep 2020 02:22:25 -0400 Subject: [PATCH] gallium/util: add set_frontend_noop into driver_noop and u_threaded_context Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/auxiliary/driver_noop/noop_pipe.c | 5 +++++ src/gallium/auxiliary/util/u_threaded_context.c | 15 +++++++++++++++ src/gallium/auxiliary/util/u_threaded_context.h | 1 + .../auxiliary/util/u_threaded_context_calls.h | 1 + 4 files changed, 22 insertions(+) diff --git a/src/gallium/auxiliary/driver_noop/noop_pipe.c b/src/gallium/auxiliary/driver_noop/noop_pipe.c index dc6454c9165..d31f6134f80 100644 --- a/src/gallium/auxiliary/driver_noop/noop_pipe.c +++ b/src/gallium/auxiliary/driver_noop/noop_pipe.c @@ -343,6 +343,10 @@ static void noop_set_context_param(struct pipe_context *ctx, { } +static void noop_set_frontend_noop(struct pipe_context *ctx, bool enable) +{ +} + static struct pipe_context *noop_create_context(struct pipe_screen *screen, void *priv, unsigned flags) { @@ -383,6 +387,7 @@ static struct pipe_context *noop_create_context(struct pipe_screen *screen, ctx->texture_subdata = noop_texture_subdata; ctx->invalidate_resource = noop_invalidate_resource; ctx->set_context_param = noop_set_context_param; + ctx->set_frontend_noop = noop_set_frontend_noop; noop_init_state_functions(ctx); return ctx; diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 1689f7b9d98..9d519bd89e6 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -1993,6 +1993,20 @@ tc_set_context_param(struct pipe_context *_pipe, } } +static void +tc_call_set_frontend_noop(struct pipe_context *pipe, union tc_payload *payload) +{ + pipe->set_frontend_noop(pipe, payload->boolean); +} + +static void +tc_set_frontend_noop(struct pipe_context *_pipe, bool enable) +{ + struct threaded_context *tc = threaded_context(_pipe); + + tc_add_small_call(tc, TC_CALL_set_frontend_noop)->boolean = enable; +} + /******************************************************************** * draw, launch, clear, blit, copy, flush @@ -2793,6 +2807,7 @@ threaded_context_create(struct pipe_context *pipe, CTX_INIT(create_image_handle); CTX_INIT(delete_image_handle); CTX_INIT(make_image_handle_resident); + CTX_INIT(set_frontend_noop); #undef CTX_INIT if (out) diff --git a/src/gallium/auxiliary/util/u_threaded_context.h b/src/gallium/auxiliary/util/u_threaded_context.h index 29e436fd992..a2621d48b37 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.h +++ b/src/gallium/auxiliary/util/u_threaded_context.h @@ -311,6 +311,7 @@ union tc_payload { struct pipe_transfer *transfer; struct pipe_fence_handle *fence; uint64_t handle; + bool boolean; }; #ifdef _MSC_VER diff --git a/src/gallium/auxiliary/util/u_threaded_context_calls.h b/src/gallium/auxiliary/util/u_threaded_context_calls.h index e6ea1b5747c..c7a12df2c37 100644 --- a/src/gallium/auxiliary/util/u_threaded_context_calls.h +++ b/src/gallium/auxiliary/util/u_threaded_context_calls.h @@ -50,6 +50,7 @@ CALL(make_texture_handle_resident) CALL(delete_image_handle) CALL(make_image_handle_resident) CALL(set_context_param) +CALL(set_frontend_noop) CALL(bind_blend_state) CALL(bind_rasterizer_state)