Skip to content

Commit 5c48fb0

Browse files
author
FlorentGuinier
authored
Merge pull request #1 from GPUOpen-LibrariesAndSDKs/master
update from main repo
2 parents 6075499 + 27a54a8 commit 5c48fb0

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

RadeonRays/RadeonRays.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ project "RadeonRays"
1111

1212
if _OPTIONS["shared_calc"] then
1313
defines {"CALC_IMPORT_API"};
14-
links {"dl"}
14+
if os.is("windows") then
15+
characterset ("MBCS")
16+
else
17+
links {"dl"}
18+
end
1519
else
16-
defines {"CALC_STATIC_LIBRARY"}
20+
defines {"CALC_STATIC_LIBRARY"}
1721
links {"Calc"}
18-
if _OPTIONS["use_opencl"] then
22+
if _OPTIONS["use_opencl"] then
1923
links {"CLW"}
20-
end
24+
end
2125
end
2226

2327
if _OPTIONS["enable_raymask"] then

RadeonRays/include/math/matrix.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,13 @@ namespace RadeonRays
179179
return res*=c;
180180
}
181181

182-
inline float3 operator * (matrix const& m, float3 const& v)
182+
inline float4 operator * (matrix const& m, float4 const& v)
183183
{
184-
float3 res;
184+
float4 res {0, 0, 0, 0};
185185

186-
for (int i=0;i<3;++i)
187-
{
188-
res[i] = 0.f;
189-
for (int j=0;j<3;++j)
186+
for (int i = 0; i < 4; ++i) {
187+
//res[i] = 0.f;
188+
for (int j = 0; j < 4; ++j)
190189
res[i] += m.m[i][j] * v[j];
191190
}
192191

RadeonRays/src/device/embree_intersection_device.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ namespace RadeonRays
116116
if (result != RTC_NO_ERROR)
117117
std::cout << "Failed to create embree rtcDevice: " << result << std::endl;
118118

119-
m_scene = rtcDeviceNewScene(m_device, RTC_SCENE_STATIC, RTC_INTERSECT1 | RTC_INTERSECT4 | RTC_INTERSECT8 | RTC_INTERSECT16 | RTC_INTERSECTN);
119+
m_scene = rtcDeviceNewScene(m_device, RTC_SCENE_STATIC, RTC_INTERSECT1 | RTC_INTERSECT4 | RTC_INTERSECT8 | RTC_INTERSECT16 | RTC_INTERSECT_STREAM);
120120
result = rtcDeviceGetError(m_device);
121121
if (result != RTC_NO_ERROR)
122122
std::cout << "Failed to create embree scene: " << result << std::endl;
@@ -171,7 +171,7 @@ namespace RadeonRays
171171
}
172172
m_instances.clear();
173173
rtcDeleteScene(m_scene); CheckEmbreeError();
174-
m_scene = rtcDeviceNewScene(m_device, RTC_SCENE_STATIC, RTC_INTERSECT1 | RTC_INTERSECT4 | RTC_INTERSECT8 | RTC_INTERSECT16 | RTC_INTERSECTN); CheckEmbreeError();
174+
m_scene = rtcDeviceNewScene(m_device, RTC_SCENE_STATIC, RTC_INTERSECT1 | RTC_INTERSECT4 | RTC_INTERSECT8 | RTC_INTERSECT16 | RTC_INTERSECT_STREAM); CheckEmbreeError();
175175

176176
for (auto i : world.shapes_)
177177
{
@@ -500,7 +500,7 @@ namespace RadeonRays
500500
{
501501
if (m_meshes.count(mesh))
502502
return m_meshes[mesh].scene;
503-
RTCScene result = rtcDeviceNewScene(m_device, RTC_SCENE_STATIC, RTC_INTERSECT1 | RTC_INTERSECT4 | RTC_INTERSECT8 | RTC_INTERSECT16 | RTC_INTERSECTN);
503+
RTCScene result = rtcDeviceNewScene(m_device, RTC_SCENE_STATIC, RTC_INTERSECT1 | RTC_INTERSECT4 | RTC_INTERSECT8 | RTC_INTERSECT16 | RTC_INTERSECT_STREAM);
504504
CheckEmbreeError();
505505
ThrowIf(!mesh->puretriangle(), "Only triangle meshes supported by now.");
506506

RadeonRays/src/intersector/intersector_short_stack.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,11 @@ namespace RadeonRays
397397
m_gpudata->bvh = m_device->CreateBuffer(translator.nodes_.size() * sizeof(FatNodeBvhTranslator::Node), Calc::BufferType::kRead, &translator.nodes_[0]);
398398

399399
// Stack
400+
if (m_gpudata->stack)
401+
{
402+
m_device->DeleteBuffer(m_gpudata->stack);
403+
m_gpudata->stack = nullptr;
404+
}
400405
m_gpudata->stack = m_device->CreateBuffer(kMaxBatchSize*kMaxStackSize, Calc::BufferType::kWrite);
401406

402407
// Make sure everything is commited

0 commit comments

Comments
 (0)