From 51eb3cc5636d6adcde3d921ad5eb52d5bfd2a0ee Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 17 May 2023 11:57:25 +1000 Subject: [PATCH] gallivm/cs: add payload ptr to the cs thread data. This fits best at a thread level beside shared. Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/drivers/llvmpipe/lp_jit.c | 2 ++ src/gallium/drivers/llvmpipe/lp_jit.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c index f501c50acfd..68a68016bd3 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.c +++ b/src/gallium/drivers/llvmpipe/lp_jit.c @@ -254,6 +254,8 @@ lp_jit_create_cs_types(struct lp_compute_shader_variant *lp) LLVMPointerType(lp_build_format_cache_type(gallivm), 0); elem_types[LP_JIT_CS_THREAD_DATA_SHARED] = LLVMPointerType(LLVMInt32TypeInContext(lc), 0); + + elem_types[LP_JIT_CS_THREAD_DATA_PAYLOAD] = LLVMPointerType(LLVMInt8TypeInContext(lc), 0); thread_data_type = LLVMStructTypeInContext(lc, elem_types, ARRAY_SIZE(elem_types), 0); diff --git a/src/gallium/drivers/llvmpipe/lp_jit.h b/src/gallium/drivers/llvmpipe/lp_jit.h index 343e6768bf6..c1e006ad8b2 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.h +++ b/src/gallium/drivers/llvmpipe/lp_jit.h @@ -298,12 +298,14 @@ struct lp_jit_cs_thread_data { struct lp_build_format_cache *cache; void *shared; + void *payload; }; enum { LP_JIT_CS_THREAD_DATA_CACHE = 0, LP_JIT_CS_THREAD_DATA_SHARED = 1, + LP_JIT_CS_THREAD_DATA_PAYLOAD = 2, LP_JIT_CS_THREAD_DATA_COUNT }; @@ -314,6 +316,9 @@ enum { #define lp_jit_cs_thread_data_shared(_gallivm, _type, _ptr) \ lp_build_struct_get2(_gallivm, _type, _ptr, LP_JIT_CS_THREAD_DATA_SHARED, "shared") +#define lp_jit_cs_thread_data_payload(_gallivm, _type, _ptr) \ + lp_build_struct_get2(_gallivm, _type, _ptr, LP_JIT_CS_THREAD_DATA_PAYLOAD, "payload") + struct lp_jit_cs_context {