Leaving it compiling at least, CL seems to have broken at some point on my thinkpad
This commit is contained in:
@@ -26,6 +26,7 @@ bool Application::init_clcaster() {
|
||||
|
||||
// Start up the raycaster
|
||||
raycaster = std::make_shared<CLCaster>();
|
||||
raycaster->setDefine("OCTDIM", std::to_string(MAP_X));
|
||||
if (!raycaster->init())
|
||||
abort();
|
||||
|
||||
@@ -41,6 +42,9 @@ bool Application::init_clcaster() {
|
||||
raycaster->assign_octree(map);
|
||||
raycaster->assign_map(map);
|
||||
|
||||
|
||||
|
||||
|
||||
camera = std::make_shared<Camera>(
|
||||
sf::Vector3f(3.5f, 3.5f, 3.5f), // Starting position
|
||||
sf::Vector2f(1.57f, 0.0f), // Direction
|
||||
@@ -52,6 +56,7 @@ bool Application::init_clcaster() {
|
||||
raycaster->create_viewport(WINDOW_X, WINDOW_Y, 0.625f * 90.0f, 90.0f);
|
||||
|
||||
// Initialize the light controller and link it to the GPU
|
||||
// TODO: Bad behaviour when raycaster has errors!!!!
|
||||
light_controller = std::make_shared<LightController>(raycaster);
|
||||
|
||||
// Create a light prototype, send it to the controller, and get the handle back
|
||||
|
||||
@@ -723,11 +723,11 @@ bool CLCaster::compile_kernel(std::string kernel_source, bool is_path, std::stri
|
||||
std::stringstream build_string_stream;
|
||||
|
||||
// walk the settings index's and add them to the defines
|
||||
for (auto i: settings_index_map){
|
||||
build_string_stream << " -D" << i.first << "=" << std::to_string(i.second);
|
||||
for (auto const& define : defines_map){
|
||||
build_string_stream << " -D" << define.first << "=" << define.second;
|
||||
}
|
||||
|
||||
build_string_stream << "-DOCTDIM=" << std::to_string(Application::MAP_X);
|
||||
//build_string_stream << "-DOCTDIM=" << std::to_string(Application::MAP_X);
|
||||
build_string_stream << " -cl-finite-math-only -cl-fast-relaxed-math -cl-unsafe-math-optimizations";
|
||||
|
||||
std::string build_string = build_string_stream.str();
|
||||
@@ -745,8 +745,8 @@ bool CLCaster::compile_kernel(std::string kernel_source, bool is_path, std::stri
|
||||
// Grab the log
|
||||
clGetProgramBuildInfo(program, device_id, CL_PROGRAM_BUILD_LOG, log_size, log, NULL);
|
||||
|
||||
Logger::log("Failed at clBuildProgram() : " + cl_err_lookup(error), Logger::LogLevel::ERROR, __LINE__, __FILE__);
|
||||
Logger::log(log, Logger::LogLevel::ERROR, __LINE__, __FILE__);
|
||||
Logger::log("Failed at clBuildProgram() with " + cl_err_lookup(error), Logger::LogLevel::ERROR, __LINE__, __FILE__);
|
||||
Logger::log("CL_ERROR -->" + std::string(log), Logger::LogLevel::ERROR, __LINE__, __FILE__);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1177,6 +1177,14 @@ std::string CLCaster::cl_err_lookup(int error_code) {
|
||||
|
||||
}
|
||||
|
||||
void CLCaster::setDefine(std::string name, std::string value) {
|
||||
defines_map[name] = value;
|
||||
}
|
||||
|
||||
void CLCaster::removeDefine(std::string name) {
|
||||
defines_map.erase(name);
|
||||
}
|
||||
|
||||
|
||||
CLCaster::device::device(cl_device_id device_id, cl_platform_id platform_id) {
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ VrEventPublisher::~VrEventPublisher() {
|
||||
|
||||
// And one by one remove the
|
||||
for (auto subscriber: subscriber_bucket.second){
|
||||
subscriber.
|
||||
//subscriber.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user