diff options
author | José Fonseca <jfonseca@vmware.com> | 2009-08-23 07:55:29 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-08-29 09:21:41 +0100 |
commit | 03180dca7a3b5d57100158eb06d00419e55d9dc8 (patch) | |
tree | 957a2c3756b3801b90aef867fa8cfff5f79d8923 /src/gallium/drivers/llvmpipe/lp_jit.c | |
parent | 635c37e118bbf51fc8c93a2c999281ee817a93e1 (diff) |
llvmpipe: Pre-declare fetch_texel.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_jit.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_jit.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c index 0a32c41a6f..39c4df8363 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.c +++ b/src/gallium/drivers/llvmpipe/lp_jit.c @@ -37,11 +37,13 @@ #include "util/u_memory.h" #include "lp_screen.h" +#include "lp_bld_intr.h" +#include "lp_bld_tgsi.h" /* for lp_build_tgsi_fetch_texel_soa */ #include "lp_jit.h" static void -lp_jit_init_types(struct llvmpipe_screen *screen) +lp_jit_init_globals(struct llvmpipe_screen *screen) { /* struct lp_jit_context */ { @@ -71,6 +73,24 @@ lp_jit_init_types(struct llvmpipe_screen *screen) screen->context_ptr_type = LLVMPointerType(context_type, 0); } + /* fetch_texel + */ + { + LLVMTypeRef ret_type; + LLVMTypeRef arg_types[3]; + LLVMValueRef fetch_texel; + + ret_type = LLVMVoidType(); + arg_types[0] = LLVMPointerType(LLVMInt8Type(), 0); /* samplers */ + arg_types[1] = LLVMInt32Type(); /* unit */ + arg_types[2] = LLVMPointerType(LLVMVectorType(LLVMFloatType(), 4), 0); /* store */ + + fetch_texel = lp_declare_intrinsic(screen->module, "fetch_texel", + ret_type, arg_types, Elements(arg_types)); + + LLVMAddGlobalMapping(screen->engine, fetch_texel, lp_build_tgsi_fetch_texel_soa); + } + #ifdef DEBUG LLVMDumpModule(screen->module); #endif @@ -115,5 +135,5 @@ lp_jit_screen_init(struct llvmpipe_screen *screen) LLVMAddGVNPass(screen->pass); LLVMAddCFGSimplificationPass(screen->pass); - lp_jit_init_types(screen); + lp_jit_init_globals(screen); } |