[Mesa-dev] [RFC PATCH 13/17] clover: Handle the case when linking SPIR-V binaries together
Pierre Moreau
pierre.morrow at free.fr
Wed May 3 21:57:01 UTC 2017
Signed-off-by: Pierre Moreau <pierre.morrow at free.fr>
---
src/gallium/state_trackers/clover/core/program.cpp | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/gallium/state_trackers/clover/core/program.cpp b/src/gallium/state_trackers/clover/core/program.cpp
index 15d559cd93..6a54500247 100644
--- a/src/gallium/state_trackers/clover/core/program.cpp
+++ b/src/gallium/state_trackers/clover/core/program.cpp
@@ -80,11 +80,20 @@ program::link(const ref_vector<device> &devs, const std::string &opts,
std::string log = _builds[&dev].log;
try {
- const module m = (dev.ir_format() == PIPE_SHADER_IR_TGSI ?
- tgsi::link_program(ms) :
- llvm::link_program(ms, dev.ir_format(),
- dev.ir_target(), opts, log));
- _builds[&dev] = { m, opts, log };
+ switch (dev.ir_format()) {
+ case PIPE_SHADER_IR_TGSI:
+ _builds[&dev] = { tgsi::link_program(ms), opts, log };
+ break;
+ case PIPE_SHADER_IR_LLVM:
+ case PIPE_SHADER_IR_NATIVE:
+ case PIPE_SHADER_IR_NIR:
+ _builds[&dev] = { llvm::link_program(ms, dev.ir_format(),
+ dev.ir_target(), opts, log), opts, log };
+ break;
+ case PIPE_SHADER_IR_SPIRV:
+ _builds[&dev] = { clover::spirv::link_program(ms, opts, log), opts, log };
+ break;
+ }
} catch (...) {
_builds[&dev] = { module(), opts, log };
throw;
--
2.12.2
More information about the mesa-dev
mailing list