summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2016-05-17 16:03:07 +0200
committerFrancisco Jerez <[email protected]>2016-07-11 20:34:34 -0700
commitba613636e8a0f16e0386dc7dc88529f7027eecea (patch)
tree1711a6fdf2405676608e46a36889c602e3b0c6aa /src/gallium/state_trackers
parentfb3eeb1314c3269818e58e64b460d045ea5b466d (diff)
clover/tgsi: Move compiler entry point declaration into tgsi directory and namespace.
Reviewed-by: Serge Martin <[email protected]> Tested-by: Jan Vesely <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/clover/Makefile.sources3
-rw-r--r--src/gallium/state_trackers/clover/core/compiler.hpp3
-rw-r--r--src/gallium/state_trackers/clover/core/program.cpp3
-rw-r--r--src/gallium/state_trackers/clover/tgsi/compiler.cpp5
-rw-r--r--src/gallium/state_trackers/clover/tgsi/invocation.hpp35
5 files changed, 42 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/clover/Makefile.sources b/src/gallium/state_trackers/clover/Makefile.sources
index bbfb2de6245..a474130322c 100644
--- a/src/gallium/state_trackers/clover/Makefile.sources
+++ b/src/gallium/state_trackers/clover/Makefile.sources
@@ -65,4 +65,5 @@ LLVM_SOURCES := \
llvm/util.hpp
TGSI_SOURCES := \
- tgsi/compiler.cpp
+ tgsi/compiler.cpp \
+ tgsi/invocation.hpp
diff --git a/src/gallium/state_trackers/clover/core/compiler.hpp b/src/gallium/state_trackers/clover/core/compiler.hpp
index 207641785ca..0ed81fb3510 100644
--- a/src/gallium/state_trackers/clover/core/compiler.hpp
+++ b/src/gallium/state_trackers/clover/core/compiler.hpp
@@ -36,9 +36,6 @@ namespace clover {
const std::string &target,
const std::string &opts,
std::string &r_log);
-
- module compile_program_tgsi(const std::string &source,
- std::string &r_log);
}
#endif
diff --git a/src/gallium/state_trackers/clover/core/program.cpp b/src/gallium/state_trackers/clover/core/program.cpp
index 6eebd9c5cda..d8637876cd4 100644
--- a/src/gallium/state_trackers/clover/core/program.cpp
+++ b/src/gallium/state_trackers/clover/core/program.cpp
@@ -21,6 +21,7 @@
//
#include "core/program.hpp"
+#include "tgsi/invocation.hpp"
using namespace clover;
@@ -56,7 +57,7 @@ program::build(const ref_vector<device> &devs, const char *opts,
try {
auto module = (dev.ir_format() == PIPE_SHADER_IR_TGSI ?
- compile_program_tgsi(_source, log) :
+ tgsi::compile_program(_source, log) :
compile_program_llvm(_source, headers,
dev.ir_format(),
dev.ir_target(), build_opts(dev),
diff --git a/src/gallium/state_trackers/clover/tgsi/compiler.cpp b/src/gallium/state_trackers/clover/tgsi/compiler.cpp
index dc5ae1a9c76..d96f7e1046c 100644
--- a/src/gallium/state_trackers/clover/tgsi/compiler.cpp
+++ b/src/gallium/state_trackers/clover/tgsi/compiler.cpp
@@ -22,7 +22,8 @@
#include <sstream>
-#include "core/compiler.hpp"
+#include "tgsi/invocation.hpp"
+#include "core/error.hpp"
#include "tgsi/tgsi_parse.h"
#include "tgsi/tgsi_text.h"
@@ -95,7 +96,7 @@ namespace {
}
module
-clover::compile_program_tgsi(const std::string &source, std::string &r_log) {
+clover::tgsi::compile_program(const std::string &source, std::string &r_log) {
const size_t body_pos = source.find("COMP\n");
if (body_pos == std::string::npos) {
r_log = "invalid source";
diff --git a/src/gallium/state_trackers/clover/tgsi/invocation.hpp b/src/gallium/state_trackers/clover/tgsi/invocation.hpp
new file mode 100644
index 00000000000..0fa20c4bb19
--- /dev/null
+++ b/src/gallium/state_trackers/clover/tgsi/invocation.hpp
@@ -0,0 +1,35 @@
+//
+// Copyright 2016 Francisco Jerez
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#ifndef CLOVER_TGSI_INVOCATION_HPP
+#define CLOVER_TGSI_INVOCATION_HPP
+
+#include "core/module.hpp"
+
+namespace clover {
+ namespace tgsi {
+ module compile_program(const std::string &source,
+ std::string &r_log);
+ }
+}
+
+#endif