Skip to content

Commit

Permalink
Apply review remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
dtarakanov1 committed Sep 17, 2018
1 parent 2ff80c3 commit 7104360
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
5 changes: 5 additions & 0 deletions BaikalDataGenerator/Source/data_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ THE SOFTWARE.
DataGeneratorResult GenerateDataset(DataGeneratorParams const* params)
try
{
if (params == nullptr)
{
return kDataGeneratorBadParams;
}

std::filesystem::path output_dir = params->output_dir;

if (!exists(output_dir))
Expand Down
5 changes: 3 additions & 2 deletions BaikalDataGenerator/Source/data_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern "C" {

struct DataGeneratorParams
{
const char* output_dir;
char const* output_dir;

rpr_scene scene;
char const* scene_name;
Expand All @@ -54,12 +54,13 @@ struct DataGeneratorParams

unsigned gamma_correction;

void (*progress_callback)(int);
void (*progress_callback)(int /* camera_idx */);
};

enum DataGeneratorResult
{
kDataGeneratorSuccess = 0,
kDataGeneratorBadParams,
kDataGeneratorBadOutputDir,
kDataGeneratorBadScene,
kDataGeneratorBadLight,
Expand Down
4 changes: 2 additions & 2 deletions BaikalDataGenerator/Source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ THE SOFTWARE.

void Run(const AppConfig& config)
{
ObjectLoader config_loader(config);
auto params = config_loader.GetDataGeneratorParams();
ObjectLoader object_loader(config);
auto params = object_loader.GetDataGeneratorParams();
GenerateDataset(&params);
}

Expand Down
12 changes: 5 additions & 7 deletions BaikalDataGenerator/Source/object_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
********************************************************************/

#include "object_loader.h"
#include "ObjectLoader.h"

#include "Rpr/RadeonProRender.h"
#include "Rpr/WrapObject/Materials/MaterialObject.h"
Expand Down Expand Up @@ -120,7 +120,7 @@ std::pair<std::size_t, std::size_t> GetSplitByIdx(std::size_t total_num,
}
else
{
begin = remain * (length + 1) + (subrange_idx - remain) * length;
begin = subrange_idx * length + remain;
end = begin + length;
}
return {begin, end};
Expand Down Expand Up @@ -177,14 +177,12 @@ void ObjectLoader::LoadScene()
// workaround to avoid issues with tiny_object_loader
auto scene_dir = m_app_config.scene_file.parent_path().string();

if (scene_dir.back() != '/' || scene_dir.back() != '\\')
{
// Baikal::SceneIO requires a trailing delimiter
#ifdef WIN32
scene_dir.append("\\");
scene_dir.append("\\");
#else
scene_dir.append("/");
scene_dir.append("/");
#endif
}

m_scene.SetScene(Baikal::SceneIo::LoadScene(m_app_config.scene_file.string(), scene_dir));

Expand Down
7 changes: 4 additions & 3 deletions BaikalStandalone/Application/cl_render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ namespace Baikal

for (std::size_t i = 0; i < m_cfgs.size(); ++i)
{
std::cout << i << ". name: " << m_cfgs[i].context.GetDevice(0).GetName()
<< ", vendor: " << m_cfgs[i].context.GetDevice(0).GetVendor()
<< ", version: " << m_cfgs[i].context.GetDevice(0).GetVersion()
const auto& device = m_cfgs[i].context.GetDevice(0);
std::cout << i << ". name: " << device.GetName()
<< ", vendor: " << device.GetVendor()
<< ", version: " << device.GetVersion()
<< "\n";
}

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ option(BAIKAL_ENABLE_DATAGENERATOR "Enable data generator application build" ON)
option(BAIKAL_ENABLE_IO "Enable IO library build" ON)
option(BAIKAL_ENABLE_FBX "Enable FBX import in BaikalIO. Requires BaikalIO to be turned ON" OFF)
option(BAIKAL_ENABLE_MATERIAL_CONVERTER "Enable materials.xml converter from old to uberv2 version" OFF)
option(BAIKAL_EMBED_KERNELS "Embed CL kernels into binary module" ON)
option(BAIKAL_EMBED_KERNELS "Embed CL kernels into binary module" OFF)

#Sanity checks
if (BAIKAL_ENABLE_GLTF AND NOT BAIKAL_ENABLE_RPR)
Expand Down

0 comments on commit 7104360

Please sign in to comment.