summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Kyriazis <george.kyriazis@intel.com>2018-03-28 14:31:20 -0500
committerGeorge Kyriazis <george.kyriazis@intel.com>2018-04-18 10:51:38 -0500
commitc5d7b37fe7eb9c0b35b71a42f2bb5d408715108e (patch)
tree2ffb667aced207185a0129d3663dd2aa415acfe2 /src
parent9161c40d147079a1c6b36b357000096b926898ad (diff)
swr: add x86 lowering pass to fragment shader
Needed because some FP paths (namely stipple) use gather intrinsics that now need to be lowered to x86. v2: fix typo in commit message Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/swr/swr_shader.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/swr/swr_shader.cpp b/src/gallium/drivers/swr/swr_shader.cpp
index 477fa7f2db..6ea021a987 100644
--- a/src/gallium/drivers/swr/swr_shader.cpp
+++ b/src/gallium/drivers/swr/swr_shader.cpp
@@ -27,11 +27,13 @@
#include "JitManager.h"
#include "llvm-c/Core.h"
#include "llvm/Support/CBindingWrapping.h"
+#include "llvm/IR/LegacyPassManager.h"
#pragma pop_macro("DEBUG")
#include "state.h"
#include "gen_state_llvm.h"
#include "builder.h"
+#include "functionpasses/passes.h"
#include "tgsi/tgsi_strings.h"
#include "util/u_format.h"
@@ -1389,6 +1391,11 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
gallivm_compile_module(gallivm);
+ // after the gallivm passes, we have to lower the core's intrinsics
+ llvm::legacy::FunctionPassManager lowerPass(JM()->mpCurrentModule);
+ lowerPass.add(createLowerX86Pass(mpJitMgr, this));
+ lowerPass.run(*pFunction);
+
PFN_PIXEL_KERNEL kernel =
(PFN_PIXEL_KERNEL)gallivm_jit_function(gallivm, wrap(pFunction));
debug_printf("frag shader %p\n", kernel);