//
#include "core/program.hpp"
+#include "tgsi/invocation.hpp"
using namespace clover;
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),
#include <sstream>
-#include "core/compiler.hpp"
+#include "tgsi/invocation.hpp"
+#include "core/error.hpp"
#include "tgsi/tgsi_parse.h"
#include "tgsi/tgsi_text.h"
}
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";
--- /dev/null
+//
+// 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