Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add system and libraries information to render log #328

Merged
merged 3 commits into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/appleseed-max-impl/appleseedrenderer/appleseedrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
// appleseed.foundation headers.
#include "foundation/image/canvasproperties.h"
#include "foundation/image/image.h"
#include "foundation/platform/system.h"
#include "foundation/platform/thread.h"
#include "foundation/platform/types.h"
#include "foundation/utility/autoreleaseptr.h"
Expand Down Expand Up @@ -1072,9 +1073,6 @@ void AppleseedRendererPBlockAccessor::Set(

AppleseedRendererClassDesc g_appleseed_renderer_classdesc;
asf::auto_release_ptr<DialogLogTarget> g_dialog_log_target;
#if MAX_RELEASE < 19000
AppleseedRECompatible g_appleseed_renderelement_compatible;
#endif
AppleseedRendererPBlockAccessor g_pblock_accessor;

ParamBlockDesc2 g_param_block_desc(
Expand Down Expand Up @@ -2157,7 +2155,13 @@ int AppleseedRenderer::Render(
}

if (!m_rend_params.inMtlEdit || m_settings.m_log_material_editor_messages)
{
create_log_window();
print_appleseed_library_information();
print_appleseed_library_features();
print_third_party_libraries_information();
asf::System::print_information(asr::global_logger());
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep a single blank line.

if (renderer_settings.m_enable_noise_seed)
{
Expand Down Expand Up @@ -2238,6 +2242,7 @@ int AppleseedRenderer::Render(

if (progress_cb)
progress_cb->SetTitle(L"Rendering...");

if (m_settings.m_low_priority_mode)
{
asf::ProcessPriorityContext background_context(
Expand Down
84 changes: 84 additions & 0 deletions src/appleseed-max-impl/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#include "renderer/api/texture.h"

// appleseed.foundation headers.
#include "foundation/core/appleseed.h"
#include "foundation/core/thirdparties.h"
#include "foundation/image/canvasproperties.h"
#include "foundation/image/tile.h"
#include "foundation/utility/searchpaths.h"
Expand Down Expand Up @@ -68,6 +70,88 @@
namespace asf = foundation;
namespace asr = renderer;

const char* to_enabled_disabled(const bool value)
{
return value ? "enabled" : "disabled";
}

void print_appleseed_library_information()
{
RENDERER_LOG_INFO(
"appleseed for Autodesk 3ds Max using %s version %s, %s configuration\n"
"compiled on %s at %s using %s version %s\n"
"copyright (c) 2010-2013 Francois Beaune, Jupiter Jazz Limited\n"
"copyright (c) 2014-2019 The appleseedhq Organization\n"
"this software is released under the MIT license (https://opensource.org/licenses/MIT).\n"
"visit https://appleseedhq.net/ for additional information and resources.",
asf::Appleseed::get_lib_name(),
asf::Appleseed::get_lib_version(),
asf::Appleseed::get_lib_configuration(),
asf::Appleseed::get_lib_compilation_date(),
asf::Appleseed::get_lib_compilation_time(),
asf::Compiler::get_compiler_name(),
asf::Compiler::get_compiler_version());
}

void print_appleseed_library_features()
{
const bool WithDisneyMaterial =
#ifdef APPLESEED_WITH_DISNEY_MATERIAL
true;
#else
false;
#endif

const bool WithEmbree =
#ifdef APPLESEED_WITH_EMBREE
true;
#else
false;
#endif

const bool WithSpectralSupport =
#ifdef APPLESEED_WITH_SPECTRAL_SUPPORT
true;
#else
false;
#endif

const bool WithGPUSupport =
#ifdef APPLESEED_WITH_GPU
true;
#else
false;
#endif

RENDERER_LOG_INFO(
"library features:\n"
" Instruction sets %s\n"
" Disney material with SeExpr %s\n"
" Embree %s\n"
" Spectral support %s\n"
" GPU support %s",
asf::Appleseed::get_lib_cpu_features(),
to_enabled_disabled(WithDisneyMaterial),
to_enabled_disabled(WithEmbree),
to_enabled_disabled(WithSpectralSupport),
to_enabled_disabled(WithGPUSupport));
}

void print_third_party_libraries_information()
{
const asf::LibraryVersionArray versions = asf::ThirdParties::get_versions();
RENDERER_LOG_INFO("third party libraries:\n");
for (size_t i = 0, e = versions.size(); i < e; ++i)
{
const asf::APIStringPair& version = versions[i];
const char* lib_name = version.m_first.c_str();
const char* lib_version = version.m_second.c_str();
const size_t lib_name_length = std::strlen(lib_name);
const std::string spacing(30 - lib_name_length, ' ');
RENDERER_LOG_INFO(" %s%s%s", lib_name, spacing.c_str(), lib_version);
}
}

void update_map_buttons(IParamMap2* param_map)
{
if (param_map == nullptr)
Expand Down
13 changes: 13 additions & 0 deletions src/appleseed-max-impl/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,19 @@ std::string insert_procedural_texture_and_instance(
renderer::ParamArray texture_instance_params = renderer::ParamArray());

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add additional blank line.


//
// Version information functions.
//

void print_appleseed_library_information();

void print_appleseed_library_features();

const char* to_enabled_disabled(const bool value);

void print_third_party_libraries_information();


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add additional blank line.

//
// Implementation.
//
Expand Down