gallium/util: add set_frontend_noop into driver_noop and u_threaded_context
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7031>
diff --git a/src/gallium/auxiliary/driver_noop/noop_pipe.c b/src/gallium/auxiliary/driver_noop/noop_pipe.c
index dc6454c..d31f613 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_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 @@
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 1689f7b..9d519bd 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/src/gallium/auxiliary/util/u_threaded_context.c
@@ -1993,6 +1993,20 @@
}
}
+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 @@
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 29e436f..a2621d4 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.h
+++ b/src/gallium/auxiliary/util/u_threaded_context.h
@@ -311,6 +311,7 @@
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 e6ea1b5..c7a12df 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(delete_image_handle)
CALL(make_image_handle_resident)
CALL(set_context_param)
+CALL(set_frontend_noop)
CALL(bind_blend_state)
CALL(bind_rasterizer_state)