Skip to content

Commit 188ef51

Browse files
committed
Fix OSX kernel compilation issue
1 parent b75dbc2 commit 188ef51

File tree

5 files changed

+12
-18
lines changed

5 files changed

+12
-18
lines changed

App/PT/ptrenderer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,6 @@ namespace Baikal
111111
, m_scene_tracker(context, devidx)
112112
, m_num_bounces(num_bounces)
113113
{
114-
115-
// Create parallel primitives
116-
m_render_data->pp = CLWParallelPrimitives(m_context);
117-
118114
std::string buildopts;
119115

120116
buildopts.append(" -cl-mad-enable -cl-fast-relaxed-math -cl-std=CL1.2 -I . ");
@@ -130,6 +126,9 @@ namespace Baikal
130126
""
131127
#endif
132128
);
129+
130+
// Create parallel primitives
131+
m_render_data->pp = CLWParallelPrimitives(m_context, buildopts.c_str());
133132

134133
// Load kernels
135134
#ifndef RR_EMBED_KERNELS

App/Scene/scene.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ Scene* Scene::LoadFromObj(std::string const& filename, std::string const& basepa
919919
matmap[i] = scene->materials_.size() - 1;
920920
continue;
921921
}
922-
else if (objmaterials[i].name == "light1" || objmaterials[i].name == "Emit1" || objmaterials[i].name == "Light3" || objmaterials[i].name == "dayLight_portal")
922+
else if (objmaterials[i].name == "light" || objmaterials[i].name == "Emit1" || objmaterials[i].name == "Light3" || objmaterials[i].name == "dayLight_portal")
923923
{
924924
Material emissive;
925925
emissive.kx = 10.f * float3(0.8f, 0.8f, 0.8f);

App/config_manager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ void ConfigManager::CreateConfigs(Mode mode, bool interop, std::vector<Config>&
5959
for (int i = 0; i < platforms.size(); ++i)
6060
{
6161
std::vector<CLWDevice> devices;
62-
int startidx = (int)configs.size();
6362

6463
for (int d = 0; d < (int)platforms[i].GetDeviceCount(); ++d)
6564
{
@@ -217,4 +216,4 @@ void ConfigManager::CreateConfigs(Mode mode, bool interop, std::vector<Config>&
217216
configs[i].renderer = new Baikal::PtRenderer(configs[i].context, configs[i].devidx, initial_num_bounces);
218217
}
219218
}
220-
#endif //APP_BENCHMARK
219+
#endif //APP_BENCHMARK

App/main.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ using namespace RadeonRays;
7777
char const* kHelpMessage =
7878
"App [-p path_to_models][-f model_name][-b][-r][-ns number_of_shadow_rays][-ao ao_radius][-w window_width][-h window_height][-nb number_of_indirect_bounces]";
7979
char const* g_path =
80-
"../Resources/bmw";
81-
char const* g_modelname = "i8.obj";
80+
"../Resources/CornellBox";
81+
char const* g_modelname = "orig.objm";
8282
char const* g_envmapname = "../Resources/Textures/studio015.hdr";
8383

8484
std::unique_ptr<ShaderManager> g_shader_manager;
@@ -364,6 +364,7 @@ void InitData()
364364
std::cout << "Sensor size: " << g_camera_sensor_size.x * 1000.f << "x" << g_camera_sensor_size.y * 1000.f << "mm\n";
365365

366366
//g_scene->SetEnvironment(g_envmapname, "", g_envmapmul);
367+
g_scene->AddDirectionalLight(RadeonRays::float3(-0.3f, -1.f, -0.4f), RadeonRays::float3(1.f, 1.f, 1.f));
367368

368369
#pragma omp parallel for
369370
for (int i = 0; i < g_cfgs.size(); ++i)
@@ -516,10 +517,6 @@ void OnKeyUp(int key, int x, int y)
516517
void Update()
517518
{
518519
static auto prevtime = std::chrono::high_resolution_clock::now();
519-
static auto updatetime = std::chrono::high_resolution_clock::now();
520-
521-
static int numbnc = 1;
522-
static int framesperbnc = 2;
523520
auto time = std::chrono::high_resolution_clock::now();
524521
auto dt = std::chrono::duration_cast<std::chrono::duration<double>>(time - prevtime);
525522
prevtime = time;
@@ -535,16 +532,16 @@ void Update()
535532

536533
if (std::abs(camroty) > 0.001f)
537534
{
538-
g_scene->camera_->Tilt(camroty);
539-
//g_scene->camera_->ArcballRotateVertically(float3(0, 0, 0), camroty);
535+
//g_scene->camera_->Tilt(camroty);
536+
g_scene->camera_->ArcballRotateVertically(float3(0, 0, 0), camroty);
540537
update = true;
541538
}
542539

543540
if (std::abs(camrotx) > 0.001f)
544541
{
545542

546-
g_scene->camera_->Rotate(camrotx);
547-
//g_scene->camera_->ArcballRotateHorizontally(float3(0, 0, 0), camrotx);
543+
//g_scene->camera_->Rotate(camrotx);
544+
g_scene->camera_->ArcballRotateHorizontally(float3(0, 0, 0), camrotx);
548545
update = true;
549546
}
550547

RadeonRays/src/intersection/radeon_rays.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ namespace RadeonRays
219219
{
220220

221221
auto* calc = GetCalc();
222-
std::uint32_t result = 0;
223222

224223
if (IsDeviceIndexEmbree(devidx))
225224
{

0 commit comments

Comments
 (0)