summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_jit.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2013-02-06 13:09:46 -0800
committerRoland Scheidegger <[email protected]>2013-02-08 16:32:30 -0800
commit8e44f4117a9c73ea336063f7c2fbf4d6a592eeae (patch)
treebb5858ca7853a10037a0395f85702135e0ac1789 /src/gallium/drivers/llvmpipe/lp_jit.c
parent3310acdf4756feb82bf043e7663b6dd8d6e3f7c9 (diff)
llvmpipe: refactoring of visibility counter handling
There can be other per-thread data than just vis_counter, so pass a struct around instead (some of our non-public code uses this already and this difference is a major cause of merge pain). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_jit.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_jit.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c
index d0a791671e6..f517b67fff6 100644
--- a/src/gallium/drivers/llvmpipe/lp_jit.c
+++ b/src/gallium/drivers/llvmpipe/lp_jit.c
@@ -190,6 +190,25 @@ lp_jit_create_types(struct lp_fragment_shader_variant *lp)
lp->jit_context_ptr_type = LLVMPointerType(context_type, 0);
}
+ /* struct lp_jit_thread_data */
+ {
+ LLVMTypeRef elem_types[LP_JIT_THREAD_DATA_COUNT];
+ LLVMTypeRef thread_data_type;
+
+ elem_types[LP_JIT_THREAD_DATA_COUNTER] = LLVMInt32TypeInContext(lc);
+
+ thread_data_type = LLVMStructTypeInContext(lc, elem_types,
+ Elements(elem_types), 0);
+
+#if HAVE_LLVM < 0x0300
+ LLVMInvalidateStructLayout(gallivm->target, thread_data_type);
+
+ LLVMAddTypeName(gallivm->module, "thread_data", thread_data_type);
+#endif
+
+ lp->jit_thread_data_ptr_type = LLVMPointerType(thread_data_type, 0);
+ }
+
if (gallivm_debug & GALLIVM_DEBUG_IR) {
LLVMDumpModule(gallivm->module);
}