gallium/u_threaded: make the execute function table private

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33087>
This commit is contained in:
Marek Olšák
2025-01-16 03:02:27 -05:00
parent 8f4173cadf
commit 1776a12949
2 changed files with 16 additions and 17 deletions
@@ -68,6 +68,13 @@ static const char *tc_call_names[] = {
# define TC_TRACE_SCOPE(call_id)
#endif
enum tc_call_id {
#define CALL(name) TC_CALL_##name,
#include "u_threaded_context_calls.h"
#undef CALL
TC_NUM_CALLS,
};
static void
tc_batch_execute(void *job, UNUSED void *gdata, int thread_index);
@@ -5019,6 +5026,15 @@ tc_callback(struct pipe_context *_pipe, void (*fn)(void *), void *data,
* batch execution in the driver thread
*/
typedef uint16_t (*tc_execute)(struct pipe_context *pipe, void *call);
/* Callbacks that call pipe_context functions. */
static const tc_execute execute_func[TC_NUM_CALLS] = {
#define CALL(name) tc_call_##name,
#include "u_threaded_context_calls.h"
#undef CALL
};
ALWAYS_INLINE static void
batch_execute(struct tc_batch *batch, struct pipe_context *pipe, uint64_t *last, bool parsing)
{
@@ -5026,7 +5042,6 @@ batch_execute(struct tc_batch *batch, struct pipe_context *pipe, uint64_t *last,
* begin incrementing renderpass info on the first set_framebuffer_state call
*/
bool first = !batch->first_set_fb;
const tc_execute *execute_func = batch->tc->execute_func;
for (uint64_t *iter = batch->slots; iter != last;) {
struct tc_call_base *call = (struct tc_call_base *)iter;
@@ -5428,10 +5443,6 @@ threaded_context_create(struct pipe_context *pipe,
CTX_INIT(get_intel_perf_query_data);
#undef CTX_INIT
#define CALL(name) tc->execute_func[TC_CALL_##name] = tc_call_##name;
#include "u_threaded_context_calls.h"
#undef CALL
if (out)
*out = tc;
@@ -275,13 +275,6 @@ struct tc_unflushed_batch_token;
*/
#define TC_MAX_SUBDATA_BYTES 320
enum tc_call_id {
#define CALL(name) TC_CALL_##name,
#include "u_threaded_context_calls.h"
#undef CALL
TC_NUM_CALLS,
};
enum tc_binding_type {
TC_BINDING_VERTEX_BUFFER,
TC_BINDING_STREAMOUT_BUFFER,
@@ -311,8 +304,6 @@ enum tc_binding_type {
TC_BINDING_IMAGE_CS,
};
typedef uint16_t (*tc_execute)(struct pipe_context *pipe, void *call);
typedef void (*tc_replace_buffer_storage_func)(struct pipe_context *ctx,
struct pipe_resource *dst,
struct pipe_resource *src,
@@ -675,9 +666,6 @@ struct threaded_context {
struct tc_renderpass_info *renderpass_info_recording;
/* accessed by driver thread */
struct tc_renderpass_info *renderpass_info;
/* Callbacks that call pipe_context functions. */
tc_execute execute_func[TC_NUM_CALLS];
};