From fb4e3c816729fcefce68068ed27a184600bd288b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 12 Jun 2025 02:19:58 +0200 Subject: [PATCH] Refactor: Cycles: Remove distinction between severity and verbosity Only use LOG() and LOG_IS_ON() macros, no more VLOG_. Pull Request: https://projects.blender.org/blender/blender/pulls/140244 --- intern/cycles/blender/camera.cpp | 2 +- intern/cycles/blender/curves.cpp | 4 +- intern/cycles/blender/display_driver.cpp | 4 +- intern/cycles/blender/mesh.cpp | 8 +-- intern/cycles/blender/object.cpp | 2 +- intern/cycles/blender/session.cpp | 4 +- intern/cycles/blender/sync.cpp | 4 +- intern/cycles/bvh/build.cpp | 6 +- intern/cycles/bvh/embree.cpp | 2 +- intern/cycles/device/cpu/device_impl.cpp | 8 +-- intern/cycles/device/cuda/device.cpp | 22 +++--- intern/cycles/device/cuda/device_impl.cpp | 30 ++++---- intern/cycles/device/cuda/queue.cpp | 6 +- intern/cycles/device/device.cpp | 12 ++-- intern/cycles/device/hip/device.cpp | 24 +++---- intern/cycles/device/hip/device_impl.cpp | 20 +++--- intern/cycles/device/hip/queue.cpp | 6 +- intern/cycles/device/hip/util.cpp | 4 +- intern/cycles/device/hiprt/device_impl.cpp | 4 +- intern/cycles/device/metal/device.mm | 4 +- intern/cycles/device/metal/device_impl.mm | 8 +-- intern/cycles/device/metal/queue.mm | 4 +- intern/cycles/device/metal/util.h | 2 +- intern/cycles/device/oneapi/device.cpp | 4 +- intern/cycles/device/oneapi/device_impl.cpp | 38 +++++------ intern/cycles/device/oneapi/queue.cpp | 4 +- intern/cycles/device/optix/device.cpp | 4 +- intern/cycles/device/optix/device_impl.cpp | 10 +-- intern/cycles/device/queue.cpp | 27 ++++---- intern/cycles/hydra/field.cpp | 4 +- intern/cycles/integrator/denoiser.cpp | 2 +- intern/cycles/integrator/denoiser_gpu.cpp | 2 +- intern/cycles/integrator/denoiser_oidn.cpp | 2 +- .../cycles/integrator/denoiser_oidn_gpu.cpp | 22 +++--- intern/cycles/integrator/path_trace.cpp | 68 +++++++++---------- .../cycles/integrator/path_trace_work_cpu.cpp | 8 +-- .../cycles/integrator/path_trace_work_gpu.cpp | 10 +-- intern/cycles/integrator/render_scheduler.cpp | 18 ++--- intern/cycles/integrator/shader_eval.cpp | 2 +- .../cycles/integrator/work_tile_scheduler.cpp | 6 +- intern/cycles/kernel/osl/services.cpp | 2 +- intern/cycles/scene/alembic.cpp | 2 +- intern/cycles/scene/camera.cpp | 4 +- intern/cycles/scene/colorspace.cpp | 20 +++--- intern/cycles/scene/constant_fold.cpp | 10 +-- intern/cycles/scene/film.cpp | 6 +- intern/cycles/scene/geometry.cpp | 4 +- intern/cycles/scene/geometry_bvh.cpp | 2 +- intern/cycles/scene/image.cpp | 2 +- intern/cycles/scene/image_oiio.cpp | 4 +- intern/cycles/scene/image_vdb.cpp | 4 +- intern/cycles/scene/integrator.cpp | 4 +- intern/cycles/scene/light.cpp | 19 +++--- intern/cycles/scene/object.cpp | 2 +- intern/cycles/scene/osl.cpp | 4 +- intern/cycles/scene/particles.cpp | 2 +- intern/cycles/scene/scene.cpp | 50 ++++++-------- intern/cycles/scene/shader.cpp | 2 +- intern/cycles/scene/shader_graph.cpp | 4 +- intern/cycles/scene/svm.cpp | 6 +- intern/cycles/scene/tables.cpp | 2 +- intern/cycles/scene/volume.cpp | 2 +- intern/cycles/session/session.cpp | 6 +- intern/cycles/session/tile.cpp | 14 ++-- intern/cycles/subd/osd.cpp | 2 +- intern/cycles/util/debug.cpp | 2 +- intern/cycles/util/log.h | 41 +++-------- intern/cycles/util/task.cpp | 2 +- 68 files changed, 308 insertions(+), 337 deletions(-) diff --git a/intern/cycles/blender/camera.cpp b/intern/cycles/blender/camera.cpp index 9da5b929081..b6c1977c9f4 100644 --- a/intern/cycles/blender/camera.cpp +++ b/intern/cycles/blender/camera.cpp @@ -764,7 +764,7 @@ void BlenderSync::sync_camera_motion(BL::RenderSettings &b_render, /* TODO(sergey): De-duplicate calculation with camera sync. */ const float fov = 2.0f * atanf((0.5f * sensor_size) / bcam.lens / aspectratio); if (fov != cam->get_fov()) { - VLOG_WORK << "Camera " << b_ob.name() << " FOV change detected."; + LOG(WORK) << "Camera " << b_ob.name() << " FOV change detected."; if (motion_time == 0.0f) { cam->set_fov(fov); } diff --git a/intern/cycles/blender/curves.cpp b/intern/cycles/blender/curves.cpp index 83ec79b6e88..6ae6e968642 100644 --- a/intern/cycles/blender/curves.cpp +++ b/intern/cycles/blender/curves.cpp @@ -386,7 +386,7 @@ static void ExportCurveSegments(Scene *scene, Hair *hair, ParticleCurveData *CDa /* check allocation */ if ((hair->get_curve_keys().size() != num_keys) || (hair->num_curves() != num_curves)) { - VLOG_WARNING << "Hair memory allocation failed, clearing data."; + LOG(WARNING) << "Hair memory allocation failed, clearing data."; hair->clear(true); } } @@ -450,7 +450,7 @@ static void export_hair_motion_validate_attribute(Hair *hair, if (num_motion_keys != num_keys || !have_motion) { /* No motion or hair "topology" changed, remove attributes again. */ if (num_motion_keys != num_keys) { - VLOG_WORK << "Hair topology changed, removing motion attribute."; + LOG(WORK) << "Hair topology changed, removing motion attribute."; } hair->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION); } diff --git a/intern/cycles/blender/display_driver.cpp b/intern/cycles/blender/display_driver.cpp index e00d80bbb85..76f42164c3d 100644 --- a/intern/cycles/blender/display_driver.cpp +++ b/intern/cycles/blender/display_driver.cpp @@ -866,8 +866,8 @@ void BlenderDisplayDriver::draw(const Params ¶ms) gpu_context_unlock(); - VLOG_DEVICE_STATS << "Display driver number of textures: " << DisplayGPUTexture::num_used; - VLOG_DEVICE_STATS << "Display driver number of PBOs: " << DisplayGPUPixelBuffer::num_used; + LOG(STATS) << "Display driver number of textures: " << DisplayGPUTexture::num_used; + LOG(STATS) << "Display driver number of PBOs: " << DisplayGPUPixelBuffer::num_used; } void BlenderDisplayDriver::gpu_context_create() diff --git a/intern/cycles/blender/mesh.cpp b/intern/cycles/blender/mesh.cpp index 90cf5ce6c44..0271cda25c9 100644 --- a/intern/cycles/blender/mesh.cpp +++ b/intern/cycles/blender/mesh.cpp @@ -998,10 +998,10 @@ void BlenderSync::sync_mesh_motion(BObjectInfo &b_ob_info, Mesh *mesh, const int { /* no motion, remove attributes again */ if (b_verts_num != numverts) { - VLOG_WARNING << "Topology differs, disabling motion blur for object " << ob_name; + LOG(WARNING) << "Topology differs, disabling motion blur for object " << ob_name; } else { - VLOG_DEBUG << "No actual deformation motion for object " << ob_name; + LOG(DEBUG) << "No actual deformation motion for object " << ob_name; } attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION); if (attr_mN) { @@ -1009,7 +1009,7 @@ void BlenderSync::sync_mesh_motion(BObjectInfo &b_ob_info, Mesh *mesh, const int } } else if (motion_step > 0) { - VLOG_DEBUG << "Filling deformation motion for object " << ob_name; + LOG(DEBUG) << "Filling deformation motion for object " << ob_name; /* motion, fill up previous steps that we might have skipped because * they had no motion, but we need them anyway now */ const float3 *P = mesh->get_verts().data(); @@ -1024,7 +1024,7 @@ void BlenderSync::sync_mesh_motion(BObjectInfo &b_ob_info, Mesh *mesh, const int } else { if (b_verts_num != numverts) { - VLOG_WARNING << "Topology differs, discarding motion blur for object " << ob_name + LOG(WARNING) << "Topology differs, discarding motion blur for object " << ob_name << " at time " << motion_step; const float3 *P = mesh->get_verts().data(); const float3 *N = (attr_N) ? attr_N->data_float3() : nullptr; diff --git a/intern/cycles/blender/object.cpp b/intern/cycles/blender/object.cpp index 096381b53df..4f321bd93ae 100644 --- a/intern/cycles/blender/object.cpp +++ b/intern/cycles/blender/object.cpp @@ -711,7 +711,7 @@ void BlenderSync::sync_motion(BL::RenderSettings &b_render, continue; } - VLOG_WORK << "Synchronizing motion for the relative time " << relative_time << "."; + LOG(WORK) << "Synchronizing motion for the relative time " << relative_time << "."; /* fixed shutter time to get previous and next frame for motion pass */ const float shuttertime = scene->motion_shutter_time(); diff --git a/intern/cycles/blender/session.cpp b/intern/cycles/blender/session.cpp index 1b7d1d2fc60..8ba31c2c090 100644 --- a/intern/cycles/blender/session.cpp +++ b/intern/cycles/blender/session.cpp @@ -473,8 +473,8 @@ void BlenderSession::render(BL::Depsgraph &b_depsgraph_) double total_time; double render_time; session->progress.get_time(total_time, render_time); - VLOG_INFO << "Total render time: " << total_time; - VLOG_INFO << "Render time (without synchronization): " << render_time; + LOG(INFO) << "Total render time: " << total_time; + LOG(INFO) << "Render time (without synchronization): " << render_time; } void BlenderSession::render_frame_finish() diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp index 062376ba1cd..589f27ad0ba 100644 --- a/intern/cycles/blender/sync.cpp +++ b/intern/cycles/blender/sync.cpp @@ -307,7 +307,7 @@ void BlenderSync::sync_data(BL::RenderSettings &b_render, * false = don't delete unused shaders, not supported. */ shader_map.post_sync(false); - VLOG_INFO << "Total time spent synchronizing data: " << timer.get_time(); + LOG(INFO) << "Total time spent synchronizing data: " << timer.get_time(); has_updates_ = false; } @@ -458,7 +458,7 @@ void BlenderSync::sync_integrator(BL::ViewLayer &b_view_layer, } if (scrambling_distance != 1.0f) { - VLOG_INFO << "Using scrambling distance: " << scrambling_distance; + LOG(INFO) << "Using scrambling distance: " << scrambling_distance; } integrator->set_scrambling_distance(scrambling_distance); diff --git a/intern/cycles/bvh/build.cpp b/intern/cycles/bvh/build.cpp index 2598768c476..09ab054f6cc 100644 --- a/intern/cycles/bvh/build.cpp +++ b/intern/cycles/bvh/build.cpp @@ -556,7 +556,7 @@ unique_ptr BVHBuild::run() if (rootnode) { if (progress.get_cancel()) { rootnode.reset(); - VLOG_WORK << "BVH build canceled."; + LOG(WORK) << "BVH build canceled."; } else { /*rotate(rootnode, 4, 5);*/ @@ -564,7 +564,7 @@ unique_ptr BVHBuild::run() rootnode->update_time(); } if (rootnode != nullptr) { - VLOG_WORK << "BVH build statistics:\n" + LOG(WORK) << "BVH build statistics:" << " Build time: " << time_dt() - build_start_time << "\n" << " Total number of nodes: " << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_NODE_COUNT)) @@ -583,7 +583,7 @@ unique_ptr BVHBuild::run() 1.0f) << "\n" << " Maximum depth: " - << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_DEPTH)) << "\n"; + << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_DEPTH)); } } diff --git a/intern/cycles/bvh/embree.cpp b/intern/cycles/bvh/embree.cpp index adf9551d31e..06d890fa41b 100644 --- a/intern/cycles/bvh/embree.cpp +++ b/intern/cycles/bvh/embree.cpp @@ -65,7 +65,7 @@ static bool rtc_memory_monitor_func(void *userPtr, const ssize_t bytes, const bo static void rtc_error_func(void * /*unused*/, enum RTCError /*unused*/, const char *str) { - VLOG_WARNING << str; + LOG(WARNING) << str; } static double progress_start_time = 0.0; diff --git a/intern/cycles/device/cpu/device_impl.cpp b/intern/cycles/device/cpu/device_impl.cpp index e9f0f56ed0c..6124929a1d4 100644 --- a/intern/cycles/device/cpu/device_impl.cpp +++ b/intern/cycles/device/cpu/device_impl.cpp @@ -44,7 +44,7 @@ CPUDevice::CPUDevice(const DeviceInfo &info_, Stats &stats_, Profiler &profiler_ { /* Pick any kernel, all of them are supposed to have same level of microarchitecture * optimization. */ - VLOG_INFO << "Using " << get_cpu_kernels().integrator_init_from_camera.get_uarch_name() + LOG(INFO) << "Using " << get_cpu_kernels().integrator_init_from_camera.get_uarch_name() << " CPU kernels."; if (info.cpu_threads == 0) { @@ -97,7 +97,7 @@ void CPUDevice::mem_alloc(device_memory &mem) } else { if (mem.name) { - VLOG_WORK << "Buffer allocate: " << mem.name << ", " + LOG(WORK) << "Buffer allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; } @@ -199,7 +199,7 @@ void CPUDevice::const_copy_to(const char *name, void *host, const size_t size) void CPUDevice::global_alloc(device_memory &mem) { - VLOG_WORK << "Global memory allocate: " << mem.name << ", " + LOG(WORK) << "Global memory allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; @@ -221,7 +221,7 @@ void CPUDevice::global_free(device_memory &mem) void CPUDevice::tex_alloc(device_texture &mem) { - VLOG_WORK << "Texture allocate: " << mem.name << ", " + LOG(WORK) << "Texture allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; diff --git a/intern/cycles/device/cuda/device.cpp b/intern/cycles/device/cuda/device.cpp index 64dbaa95114..062fcd8f04c 100644 --- a/intern/cycles/device/cuda/device.cpp +++ b/intern/cycles/device/cuda/device.cpp @@ -35,22 +35,22 @@ bool device_cuda_init() initialized = true; int cuew_result = cuewInit(CUEW_INIT_CUDA); if (cuew_result == CUEW_SUCCESS) { - VLOG_INFO << "CUEW initialization succeeded"; + LOG(INFO) << "CUEW initialization succeeded"; if (CUDADevice::have_precompiled_kernels()) { - VLOG_INFO << "Found precompiled kernels"; + LOG(INFO) << "Found precompiled kernels"; result = true; } else if (cuewCompilerPath() != nullptr) { - VLOG_INFO << "Found CUDA compiler " << cuewCompilerPath(); + LOG(INFO) << "Found CUDA compiler " << cuewCompilerPath(); result = true; } else { - VLOG_INFO << "Neither precompiled kernels nor CUDA compiler was found," + LOG(INFO) << "Neither precompiled kernels nor CUDA compiler was found," << " unable to use CUDA"; } } else { - VLOG_WARNING << "CUEW initialization failed: " + LOG(WARNING) << "CUEW initialization failed: " << ((cuew_result == CUEW_ERROR_ATEXIT_FAILED) ? "Error setting up atexit() handler" : "Error opening the library"); @@ -133,7 +133,7 @@ void device_cuda_info(vector &devices) } if (!cudaSupportsDevice(num)) { - VLOG_INFO << "Ignoring device \"" << name + LOG(INFO) << "Ignoring device \"" << name << "\", this graphics card is no longer supported."; continue; } @@ -194,25 +194,25 @@ void device_cuda_info(vector &devices) * Windows 10 even when it is, due to an issue in application profiles. * Detect case where we expect it to be available and override. */ if (preempt_attr == 0 && (major >= 6) && system_windows_version_at_least(10, 17134)) { - VLOG_INFO << "Assuming device has compute preemption on Windows 10."; + LOG(INFO) << "Assuming device has compute preemption on Windows 10."; preempt_attr = 1; } # endif if (timeout_attr && !preempt_attr) { - VLOG_INFO << "Device is recognized as display."; + LOG(INFO) << "Device is recognized as display."; info.description += " (Display)"; info.display_device = true; display_devices.push_back(info); } else { - VLOG_INFO << "Device has compute preemption or is not used for display."; + LOG(INFO) << "Device has compute preemption or is not used for display."; devices.push_back(info); } - VLOG_INFO << "Added device \"" << info.description << "\" with id \"" << info.id << "\"."; + LOG(INFO) << "Added device \"" << info.description << "\" with id \"" << info.id << "\"."; if (info.denoisers & DENOISER_OPENIMAGEDENOISE) { - VLOG_INFO << "Device with id \"" << info.id << "\" supports " + LOG(INFO) << "Device with id \"" << info.id << "\" supports " << denoiserTypeToHumanReadable(DENOISER_OPENIMAGEDENOISE) << "."; } } diff --git a/intern/cycles/device/cuda/device_impl.cpp b/intern/cycles/device/cuda/device_impl.cpp index e43b48c1112..d96e5b62e0f 100644 --- a/intern/cycles/device/cuda/device_impl.cpp +++ b/intern/cycles/device/cuda/device_impl.cpp @@ -259,9 +259,9 @@ string CUDADevice::compile_kernel(const string &common_cflags, if (!use_adaptive_compilation()) { if (!force_ptx) { const string cubin = path_get(string_printf("lib/%s_sm_%d%d.cubin.zst", name, major, minor)); - VLOG_INFO << "Testing for pre-compiled kernel " << cubin << "."; + LOG(INFO) << "Testing for pre-compiled kernel " << cubin << "."; if (path_exists(cubin)) { - VLOG_INFO << "Using precompiled kernel."; + LOG(INFO) << "Using precompiled kernel."; return cubin; } } @@ -271,9 +271,9 @@ string CUDADevice::compile_kernel(const string &common_cflags, while (ptx_major >= 3) { const string ptx = path_get( string_printf("lib/%s_compute_%d%d.ptx.zst", name, ptx_major, ptx_minor)); - VLOG_INFO << "Testing for pre-compiled kernel " << ptx << "."; + LOG(INFO) << "Testing for pre-compiled kernel " << ptx << "."; if (path_exists(ptx)) { - VLOG_INFO << "Using precompiled kernel."; + LOG(INFO) << "Using precompiled kernel."; return ptx; } @@ -301,9 +301,9 @@ string CUDADevice::compile_kernel(const string &common_cflags, const string cubin_file = string_printf( "cycles_%s_%s_%d%d_%s.%s", name, kernel_arch, major, minor, kernel_md5.c_str(), kernel_ext); const string cubin = path_cache_get(path_join("kernels", cubin_file)); - VLOG_INFO << "Testing for locally compiled kernel " << cubin << "."; + LOG(INFO) << "Testing for locally compiled kernel " << cubin << "."; if (path_exists(cubin)) { - VLOG_INFO << "Using locally compiled kernel."; + LOG(INFO) << "Using locally compiled kernel."; return cubin; } @@ -337,7 +337,7 @@ string CUDADevice::compile_kernel(const string &common_cflags, } const int nvcc_cuda_version = cuewCompilerVersion(); - VLOG_INFO << "Found nvcc " << nvcc << ", CUDA version " << nvcc_cuda_version << "."; + LOG(INFO) << "Found nvcc " << nvcc << ", CUDA version " << nvcc_cuda_version << "."; if (nvcc_cuda_version < 101) { printf( "Unsupported CUDA version %d.%d detected, " @@ -412,7 +412,7 @@ bool CUDADevice::load_kernels(const uint kernel_features) */ if (cuModule) { if (use_adaptive_compilation()) { - VLOG_INFO + LOG(INFO) << "Skipping CUDA kernel reload for adaptive compilation, not currently supported."; } return true; @@ -502,7 +502,7 @@ void CUDADevice::reserve_local_memory(const uint kernel_features) cuMemGetInfo(&free_after, &total); } - VLOG_INFO << "Local memory reserved " << string_human_readable_number(free_before - free_after) + LOG(INFO) << "Local memory reserved " << string_human_readable_number(free_before - free_after) << " bytes. (" << string_human_readable_size(free_before - free_after) << ")"; # if 0 @@ -853,7 +853,7 @@ void CUDADevice::tex_alloc(device_texture &mem) desc.NumChannels = mem.data_elements; desc.Flags = 0; - VLOG_WORK << "Array 3D allocate: " << mem.name << ", " + LOG(WORK) << "Array 3D allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; @@ -1090,10 +1090,10 @@ bool CUDADevice::should_use_graphics_interop(const GraphicsInteropDevice &intero if (log) { if (found) { - VLOG_INFO << "Graphics interop: found matching OpenGL device for CUDA"; + LOG(INFO) << "Graphics interop: found matching OpenGL device for CUDA"; } else { - VLOG_INFO << "Graphics interop: no matching OpenGL device for CUDA"; + LOG(INFO) << "Graphics interop: no matching OpenGL device for CUDA"; } } @@ -1108,13 +1108,13 @@ bool CUDADevice::should_use_graphics_interop(const GraphicsInteropDevice &intero if (log) { if (found) { - VLOG_INFO << "Graphics interop: found matching Vulkan device for CUDA"; + LOG(INFO) << "Graphics interop: found matching Vulkan device for CUDA"; } else { - VLOG_INFO << "Graphics interop: no matching Vulkan device for CUDA"; + LOG(INFO) << "Graphics interop: no matching Vulkan device for CUDA"; } - VLOG_INFO << "Graphics Interop: CUDA UUID " + LOG(INFO) << "Graphics Interop: CUDA UUID " << string_hex(reinterpret_cast(uuid.bytes), sizeof(uuid.bytes)) << ", Vulkan UUID " << string_hex(interop_device.uuid.data(), interop_device.uuid.size()); diff --git a/intern/cycles/device/cuda/queue.cpp b/intern/cycles/device/cuda/queue.cpp index 648e4f234eb..4c18ccca7ba 100644 --- a/intern/cycles/device/cuda/queue.cpp +++ b/intern/cycles/device/cuda/queue.cpp @@ -40,12 +40,12 @@ int CUDADeviceQueue::num_concurrent_states(const size_t state_size) const num_states = max((int)(num_states * factor), 1024); } else { - VLOG_DEVICE_STATS << "CYCLES_CONCURRENT_STATES_FACTOR evaluated to 0"; + LOG(STATS) << "CYCLES_CONCURRENT_STATES_FACTOR evaluated to 0"; } } - VLOG_DEVICE_STATS << "GPU queue concurrent states: " << num_states << ", using up to " - << string_human_readable_size(num_states * state_size); + LOG(STATS) << "GPU queue concurrent states: " << num_states << ", using up to " + << string_human_readable_size(num_states * state_size); return num_states; } diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index aa4eaf7125c..59476c9eb66 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -410,7 +410,7 @@ DeviceInfo Device::get_multi_device(const vector &subdevices, const int orig_cpu_threads = (threads) ? threads : TaskScheduler::max_concurrency(); const int cpu_threads = max(orig_cpu_threads - (subdevices.size() - 1), size_t(0)); - VLOG_INFO << "CPU render threads reduced from " << orig_cpu_threads << " to " + LOG(INFO) << "CPU render threads reduced from " << orig_cpu_threads << " to " << cpu_threads << ", to dedicate to GPU."; if (cpu_threads >= 1) { @@ -423,7 +423,7 @@ DeviceInfo Device::get_multi_device(const vector &subdevices, } } else { - VLOG_INFO << "CPU render threads disabled for interactive render."; + LOG(INFO) << "CPU render threads disabled for interactive render."; continue; } } @@ -544,7 +544,7 @@ void GPUDevice::init_host_memory(const size_t preferred_texture_headroom, } } else { - VLOG_WARNING << "Mapped host memory disabled, failed to get system RAM"; + LOG(WARNING) << "Mapped host memory disabled, failed to get system RAM"; map_host_limit = 0; } @@ -557,7 +557,7 @@ void GPUDevice::init_host_memory(const size_t preferred_texture_headroom, device_texture_headroom = preferred_texture_headroom > 0 ? preferred_texture_headroom : 128 * 1024 * 1024LL; // 128MB - VLOG_INFO << "Mapped host memory limit set to " << string_human_readable_number(map_host_limit) + LOG(INFO) << "Mapped host memory limit set to " << string_human_readable_number(map_host_limit) << " bytes. (" << string_human_readable_size(map_host_limit) << ")"; } @@ -619,7 +619,7 @@ void GPUDevice::move_textures_to_host(size_t size, const size_t headroom, const * multiple backend devices could be moving the memory. The * first one will do it, and the rest will adopt the pointer. */ if (max_mem) { - VLOG_WORK << "Move memory from device to host: " << max_mem->name; + LOG(WORK) << "Move memory from device to host: " << max_mem->name; /* Potentially need to call back into multi device, so pointer mapping * and peer devices are updated. This is also necessary since the device @@ -718,7 +718,7 @@ GPUDevice::Mem *GPUDevice::generic_alloc(device_memory &mem, const size_t pitch_ } if (mem.name) { - VLOG_WORK << "Buffer allocate: " << mem.name << ", " + LOG(WORK) << "Buffer allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")" << status; } diff --git a/intern/cycles/device/hip/device.cpp b/intern/cycles/device/hip/device.cpp index bf5feb0cdc9..2d023a3d1b9 100644 --- a/intern/cycles/device/hip/device.cpp +++ b/intern/cycles/device/hip/device.cpp @@ -40,34 +40,34 @@ bool device_hip_init() int hipew_result = hipewInit(HIPEW_INIT_HIP); if (hipew_result == HIPEW_SUCCESS) { - VLOG_INFO << "HIPEW initialization succeeded"; + LOG(INFO) << "HIPEW initialization succeeded"; if (!hipSupportsDriver()) { - VLOG_WARNING << "Driver version is too old"; + LOG(WARNING) << "Driver version is too old"; } else if (HIPDevice::have_precompiled_kernels()) { - VLOG_INFO << "Found precompiled kernels"; + LOG(INFO) << "Found precompiled kernels"; result = true; } else if (hipewCompilerPath() != nullptr) { - VLOG_INFO << "Found HIPCC " << hipewCompilerPath(); + LOG(INFO) << "Found HIPCC " << hipewCompilerPath(); result = true; } else { - VLOG_INFO << "Neither precompiled kernels nor HIPCC was found," + LOG(INFO) << "Neither precompiled kernels nor HIPCC was found," << " unable to use HIP"; } } else { if (hipew_result == HIPEW_ERROR_ATEXIT_FAILED) { - VLOG_WARNING << "HIPEW initialization failed: Error setting up atexit() handler"; + LOG(WARNING) << "HIPEW initialization failed: Error setting up atexit() handler"; } else if (hipew_result == HIPEW_ERROR_OLD_DRIVER) { - VLOG_WARNING + LOG(WARNING) << "HIPEW initialization failed: Driver version too old, requires AMD Radeon Pro " "24.Q2 driver or newer"; } else { - VLOG_WARNING << "HIPEW initialization failed: Error opening HIP dynamic library"; + LOG(WARNING) << "HIPEW initialization failed: Error opening HIP dynamic library"; } } @@ -219,20 +219,20 @@ void device_hip_info(vector &devices) hipDeviceGetAttribute(&timeout_attr, hipDeviceAttributeKernelExecTimeout, num); if (timeout_attr) { - VLOG_INFO << "Device is recognized as display."; + LOG(INFO) << "Device is recognized as display."; info.description += " (Display)"; info.display_device = true; display_devices.push_back(info); } else { - VLOG_INFO << "Device has compute preemption or is not used for display."; + LOG(INFO) << "Device has compute preemption or is not used for display."; devices.push_back(info); } - VLOG_INFO << "Added device \"" << info.description << "\" with id \"" << info.id << "\"."; + LOG(INFO) << "Added device \"" << info.description << "\" with id \"" << info.id << "\"."; if (info.denoisers & DENOISER_OPENIMAGEDENOISE) { - VLOG_INFO << "Device with id \"" << info.id << "\" supports " + LOG(INFO) << "Device with id \"" << info.id << "\" supports " << denoiserTypeToHumanReadable(DENOISER_OPENIMAGEDENOISE) << "."; } } diff --git a/intern/cycles/device/hip/device_impl.cpp b/intern/cycles/device/hip/device_impl.cpp index ef029f2bcf0..15fe203b853 100644 --- a/intern/cycles/device/hip/device_impl.cpp +++ b/intern/cycles/device/hip/device_impl.cpp @@ -244,9 +244,9 @@ string HIPDevice::compile_kernel(const uint kernel_features, const char *name, c /* Attempt to use kernel provided with Blender. */ if (!use_adaptive_compilation()) { const string fatbin = path_get(string_printf("lib/%s_%s.fatbin.zst", name, arch.c_str())); - VLOG_INFO << "Testing for pre-compiled kernel " << fatbin << "."; + LOG(INFO) << "Testing for pre-compiled kernel " << fatbin << "."; if (path_exists(fatbin)) { - VLOG_INFO << "Using precompiled kernel."; + LOG(INFO) << "Using precompiled kernel."; return fatbin; } } @@ -282,9 +282,9 @@ string HIPDevice::compile_kernel(const uint kernel_features, const char *name, c const string fatbin_file = string_printf( "cycles_%s_%s_%s", name, arch.c_str(), kernel_md5.c_str()); const string fatbin = path_cache_get(path_join("kernels", fatbin_file)); - VLOG_INFO << "Testing for locally compiled kernel " << fatbin << "."; + LOG(INFO) << "Testing for locally compiled kernel " << fatbin << "."; if (path_exists(fatbin)) { - VLOG_INFO << "Using locally compiled kernel."; + LOG(INFO) << "Using locally compiled kernel."; return fatbin; } @@ -327,7 +327,7 @@ string HIPDevice::compile_kernel(const uint kernel_features, const char *name, c } # endif const int hipcc_hip_version = hipewCompilerVersion(); - VLOG_INFO << "Found hipcc " << hipcc << ", HIP version " << hipcc_hip_version << "."; + LOG(INFO) << "Found hipcc " << hipcc << ", HIP version " << hipcc_hip_version << "."; double starttime = time_dt(); @@ -380,7 +380,7 @@ bool HIPDevice::load_kernels(const uint kernel_features) */ if (hipModule) { if (use_adaptive_compilation()) { - VLOG_INFO << "Skipping HIP kernel reload for adaptive compilation, not currently supported."; + LOG(INFO) << "Skipping HIP kernel reload for adaptive compilation, not currently supported."; } return true; } @@ -468,7 +468,7 @@ void HIPDevice::reserve_local_memory(const uint kernel_features) hipMemGetInfo(&free_after, &total); } - VLOG_INFO << "Local memory reserved " << string_human_readable_number(free_before - free_after) + LOG(INFO) << "Local memory reserved " << string_human_readable_number(free_before - free_after) << " bytes. (" << string_human_readable_size(free_before - free_after) << ")"; # if 0 @@ -816,7 +816,7 @@ void HIPDevice::tex_alloc(device_texture &mem) desc.NumChannels = mem.data_elements; desc.Flags = 0; - VLOG_WORK << "Array 3D allocate: " << mem.name << ", " + LOG(WORK) << "Array 3D allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; @@ -1059,10 +1059,10 @@ bool HIPDevice::should_use_graphics_interop(const GraphicsInteropDevice &interop if (log) { if (found) { - VLOG_INFO << "Graphics interop: found matching OpenGL device for HIP"; + LOG(INFO) << "Graphics interop: found matching OpenGL device for HIP"; } else { - VLOG_INFO << "Graphics interop: no matching OpenGL device for HIP"; + LOG(INFO) << "Graphics interop: no matching OpenGL device for HIP"; } } diff --git a/intern/cycles/device/hip/queue.cpp b/intern/cycles/device/hip/queue.cpp index 761137d6946..6377e383457 100644 --- a/intern/cycles/device/hip/queue.cpp +++ b/intern/cycles/device/hip/queue.cpp @@ -40,12 +40,12 @@ int HIPDeviceQueue::num_concurrent_states(const size_t state_size) const num_states = max((int)(num_states * factor), 1024); } else { - VLOG_DEVICE_STATS << "CYCLES_CONCURRENT_STATES_FACTOR evaluated to 0"; + LOG(STATS) << "CYCLES_CONCURRENT_STATES_FACTOR evaluated to 0"; } } - VLOG_DEVICE_STATS << "GPU queue concurrent states: " << num_states << ", using up to " - << string_human_readable_size(num_states * state_size); + LOG(STATS) << "GPU queue concurrent states: " << num_states << ", using up to " + << string_human_readable_size(num_states * state_size); return num_states; } diff --git a/intern/cycles/device/hip/util.cpp b/intern/cycles/device/hip/util.cpp index 1f9b9081adb..dfcd428b441 100644 --- a/intern/cycles/device/hip/util.cpp +++ b/intern/cycles/device/hip/util.cpp @@ -52,11 +52,11 @@ bool hipSupportsDriver() int hip_driver_version = 0; hipError_t result = hipDriverGetVersion(&hip_driver_version); if (result != hipSuccess) { - VLOG_WARNING << "Error getting driver version: " << hipewErrorString(result); + LOG(WARNING) << "Error getting driver version: " << hipewErrorString(result); return false; } - VLOG_DEBUG << "Detected HIP driver version: " << hip_driver_version; + LOG(DEBUG) << "Detected HIP driver version: " << hip_driver_version; if (hip_driver_version < 60140252) { /* Cycles crashes during rendering due to issues in older GPU drivers. diff --git a/intern/cycles/device/hiprt/device_impl.cpp b/intern/cycles/device/hiprt/device_impl.cpp index 05b738108f5..015f6e4335f 100644 --- a/intern/cycles/device/hiprt/device_impl.cpp +++ b/intern/cycles/device/hiprt/device_impl.cpp @@ -101,7 +101,7 @@ HIPRTDevice::HIPRTDevice(const DeviceInfo &info, return; } - if (VLOG_DEBUG_IS_ON) { + if (LOG_IS_ON(DEBUG)) { hiprtSetLogLevel(hiprtLogLevelInfo | hiprtLogLevelWarn | hiprtLogLevelError); } else { @@ -206,7 +206,7 @@ string HIPRTDevice::compile_kernel(const uint kernel_features, const char *name, } const int hipcc_hip_version = hipewCompilerVersion(); - VLOG_INFO << "Found hipcc " << hipcc << ", HIP version " << hipcc_hip_version << "."; + LOG(INFO) << "Found hipcc " << hipcc << ", HIP version " << hipcc_hip_version << "."; if (hipcc_hip_version < 40) { printf( "Unsupported HIP version %d.%d detected, " diff --git a/intern/cycles/device/metal/device.mm b/intern/cycles/device/metal/device.mm index e51ac5cc26c..63142f95087 100644 --- a/intern/cycles/device/metal/device.mm +++ b/intern/cycles/device/metal/device.mm @@ -102,10 +102,10 @@ void device_metal_info(vector &devices) devices.push_back(info); device_index++; - VLOG_INFO << "Added device \"" << info.description << "\" with id \"" << info.id << "\"."; + LOG(INFO) << "Added device \"" << info.description << "\" with id \"" << info.id << "\"."; if (info.denoisers & DENOISER_OPENIMAGEDENOISE) { - VLOG_INFO << "Device with id \"" << info.id << "\" supports " + LOG(INFO) << "Device with id \"" << info.id << "\" supports " << denoiserTypeToHumanReadable(DENOISER_OPENIMAGEDENOISE) << "."; } } diff --git a/intern/cycles/device/metal/device_impl.mm b/intern/cycles/device/metal/device_impl.mm index 754c6d2fb96..8aa75234cf8 100644 --- a/intern/cycles/device/metal/device_impl.mm +++ b/intern/cycles/device/metal/device_impl.mm @@ -502,7 +502,7 @@ void MetalDevice::compile_and_load(const int device_id, MetalPipelineType pso_ty if (MetalDevice *instance = get_device_by_ID(device_id, lock)) { if (mtlLibrary) { if (error && [error localizedDescription]) { - VLOG_WARNING << "MSL compilation messages: " + LOG(WARNING) << "MSL compilation messages: " << [[error localizedDescription] UTF8String]; } @@ -586,7 +586,7 @@ MetalDevice::MetalMem *MetalDevice::generic_alloc(device_memory &mem) } if (mem.name) { - VLOG_WORK << "Buffer allocate: " << mem.name << ", " + LOG(WORK) << "Buffer allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; } @@ -1041,7 +1041,7 @@ void MetalDevice::tex_alloc(device_texture &mem) desc.textureType = MTLTextureType3D; desc.depth = mem.data_depth; - VLOG_WORK << "Texture 3D allocate: " << mem.name << ", " + LOG(WORK) << "Texture 3D allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; @@ -1074,7 +1074,7 @@ void MetalDevice::tex_alloc(device_texture &mem) desc.storageMode = MTLStorageModeShared; desc.usage = MTLTextureUsageShaderRead; - VLOG_WORK << "Texture 2D allocate: " << mem.name << ", " + LOG(WORK) << "Texture 2D allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; diff --git a/intern/cycles/device/metal/queue.mm b/intern/cycles/device/metal/queue.mm index 62a74bfcbca..911765e88fa 100644 --- a/intern/cycles/device/metal/queue.mm +++ b/intern/cycles/device/metal/queue.mm @@ -398,8 +398,8 @@ bool MetalDeviceQueue::enqueue(DeviceKernel kernel, debug_enqueue_begin(kernel, work_size); - VLOG_DEVICE_STATS << "Metal queue launch " << device_kernel_as_string(kernel) << ", work_size " - << work_size; + LOG(STATS) << "Metal queue launch " << device_kernel_as_string(kernel) << ", work_size " + << work_size; id mtlComputeCommandEncoder = get_compute_encoder(kernel); diff --git a/intern/cycles/device/metal/util.h b/intern/cycles/device/metal/util.h index eed5b89d17b..9eb9f8891f3 100644 --- a/intern/cycles/device/metal/util.h +++ b/intern/cycles/device/metal/util.h @@ -15,7 +15,7 @@ # include "util/thread.h" -# define metal_printf VLOG_DEVICE_STATS << string_printf +# define metal_printf LOG(STATS) << string_printf CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/device/oneapi/device.cpp b/intern/cycles/device/oneapi/device.cpp index b4d5855bf17..3c8e13d99c6 100644 --- a/intern/cycles/device/oneapi/device.cpp +++ b/intern/cycles/device/oneapi/device.cpp @@ -144,10 +144,10 @@ static void device_iterator_cb(const char *id, info.has_execution_optimization = has_execution_optimization; devices->push_back(info); - VLOG_INFO << "Added device \"" << info.description << "\" with id \"" << info.id << "\"."; + LOG(INFO) << "Added device \"" << info.description << "\" with id \"" << info.id << "\"."; if (info.denoisers & DENOISER_OPENIMAGEDENOISE) { - VLOG_INFO << "Device with id \"" << info.id << "\" supports " + LOG(INFO) << "Device with id \"" << info.id << "\" supports " << denoiserTypeToHumanReadable(DENOISER_OPENIMAGEDENOISE) << "."; } } diff --git a/intern/cycles/device/oneapi/device_impl.cpp b/intern/cycles/device/oneapi/device_impl.cpp index 145bd32232a..42fcb4c24ff 100644 --- a/intern/cycles/device/oneapi/device_impl.cpp +++ b/intern/cycles/device/oneapi/device_impl.cpp @@ -73,7 +73,7 @@ OneapiDevice::OneapiDevice(const DeviceInfo &info, Stats &stats, Profiler &profi oneapi_error_string_ + "\""); } else { - VLOG_DEBUG << "oneAPI queue has been successfully created for the device \"" + LOG(DEBUG) << "oneAPI queue has been successfully created for the device \"" << info.description << "\""; assert(device_queue_); } @@ -85,7 +85,7 @@ OneapiDevice::OneapiDevice(const DeviceInfo &info, Stats &stats, Profiler &profi # endif if (use_hardware_raytracing) { - VLOG_INFO << "oneAPI will use hardware ray tracing for intersection acceleration."; + LOG(INFO) << "oneAPI will use hardware ray tracing for intersection acceleration."; } size_t globals_segment_size; @@ -95,7 +95,7 @@ OneapiDevice::OneapiDevice(const DeviceInfo &info, Stats &stats, Profiler &profi oneapi_error_string_ + "\""); } else { - VLOG_DEBUG << "Successfully created global/constant memory segment (kernel globals object)"; + LOG(DEBUG) << "Successfully created global/constant memory segment (kernel globals object)"; } kg_memory_ = usm_aligned_alloc_host(device_queue_, globals_segment_size, 16); @@ -115,7 +115,7 @@ OneapiDevice::OneapiDevice(const DeviceInfo &info, Stats &stats, Profiler &profi device_working_headroom = override_headroom; device_texture_headroom = override_headroom; } - VLOG_DEBUG << "oneAPI memory headroom size: " + LOG(DEBUG) << "oneAPI memory headroom size: " << string_human_readable_size(device_working_headroom); } @@ -239,11 +239,11 @@ bool OneapiDevice::load_kernels(const uint requested_features) "\""); return false; } - VLOG_INFO << "Test kernel has been executed successfully for \"" << info.description << "\""; + LOG(INFO) << "Test kernel has been executed successfully for \"" << info.description << "\""; assert(device_queue_); if (use_hardware_raytracing && !can_use_hardware_raytracing_for_features(requested_features)) { - VLOG_INFO + LOG(INFO) << "Hardware ray tracing disabled, not supported yet by oneAPI for requested features."; use_hardware_raytracing = false; } @@ -254,7 +254,7 @@ bool OneapiDevice::load_kernels(const uint requested_features) set_error("oneAPI kernels loading: got a runtime exception \"" + oneapi_error_string_ + "\""); } else { - VLOG_INFO << "Kernels loading (compilation) has been done for \"" << info.description << "\""; + LOG(INFO) << "Kernels loading (compilation) has been done for \"" << info.description << "\""; } if (is_finished_ok) { @@ -294,7 +294,7 @@ void OneapiDevice::reserve_private_memory(const uint kernel_features) size_t free_after = get_free_mem(); - VLOG_INFO << "For kernel execution were reserved " + LOG(INFO) << "For kernel execution were reserved " << string_human_readable_number(free_before - free_after) << " bytes. (" << string_human_readable_size(free_before - free_after) << ")"; } @@ -422,7 +422,7 @@ void OneapiDevice::mem_alloc(device_memory &mem) } else { if (mem.name) { - VLOG_DEBUG << "OneapiDevice::mem_alloc: \"" << mem.name << "\", " + LOG(DEBUG) << "OneapiDevice::mem_alloc: \"" << mem.name << "\", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; } @@ -433,7 +433,7 @@ void OneapiDevice::mem_alloc(device_memory &mem) void OneapiDevice::mem_copy_to(device_memory &mem) { if (mem.name) { - VLOG_DEBUG << "OneapiDevice::mem_copy_to: \"" << mem.name << "\", " + LOG(DEBUG) << "OneapiDevice::mem_copy_to: \"" << mem.name << "\", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; } @@ -461,7 +461,7 @@ void OneapiDevice::mem_copy_to(device_memory &mem) void OneapiDevice::mem_move_to_host(device_memory &mem) { if (mem.name) { - VLOG_DEBUG << "OneapiDevice::mem_move_to_host: \"" << mem.name << "\", " + LOG(DEBUG) << "OneapiDevice::mem_move_to_host: \"" << mem.name << "\", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; } @@ -496,7 +496,7 @@ void OneapiDevice::mem_copy_from( const size_t offset = elem * y * w; if (mem.name) { - VLOG_DEBUG << "OneapiDevice::mem_copy_from: \"" << mem.name << "\" object of " + LOG(DEBUG) << "OneapiDevice::mem_copy_from: \"" << mem.name << "\" object of " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ") from offset " << offset << " data " << size << " bytes"; @@ -526,7 +526,7 @@ void OneapiDevice::mem_copy_from( void OneapiDevice::mem_zero(device_memory &mem) { if (mem.name) { - VLOG_DEBUG << "OneapiDevice::mem_zero: \"" << mem.name << "\", " + LOG(DEBUG) << "OneapiDevice::mem_zero: \"" << mem.name << "\", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")\n"; } @@ -556,7 +556,7 @@ void OneapiDevice::mem_zero(device_memory &mem) void OneapiDevice::mem_free(device_memory &mem) { if (mem.name) { - VLOG_DEBUG << "OneapiDevice::mem_free: \"" << mem.name << "\", " + LOG(DEBUG) << "OneapiDevice::mem_free: \"" << mem.name << "\", " << string_human_readable_number(mem.device_size) << " bytes. (" << string_human_readable_size(mem.device_size) << ")\n"; } @@ -584,7 +584,7 @@ void OneapiDevice::const_copy_to(const char *name, void *host, const size_t size { assert(name); - VLOG_DEBUG << "OneapiDevice::const_copy_to \"" << name << "\" object " + LOG(DEBUG) << "OneapiDevice::const_copy_to \"" << name << "\" object " << string_human_readable_number(size) << " bytes. (" << string_human_readable_size(size) << ")"; @@ -634,7 +634,7 @@ void OneapiDevice::global_alloc(device_memory &mem) assert(mem.name); size_t size = mem.memory_size(); - VLOG_DEBUG << "OneapiDevice::global_alloc \"" << mem.name << "\" object " + LOG(DEBUG) << "OneapiDevice::global_alloc \"" << mem.name << "\" object " << string_human_readable_number(size) << " bytes. (" << string_human_readable_size(size) << ")"; @@ -799,7 +799,7 @@ void OneapiDevice::tex_alloc(device_texture &mem) desc = sycl::ext::oneapi::experimental::image_descriptor( {mem.data_width, mem.data_height, depth}, mem.data_elements, channel_type); - VLOG_WORK << "Array 2D/3D allocate: " << mem.name << ", " + LOG(WORK) << "Array 2D/3D allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; @@ -1387,7 +1387,7 @@ int parse_driver_build_version(const sycl::device &device) } if (driver_build_version == 0) { - VLOG_WARNING << "Unable to parse unknown Intel GPU driver version. \"" << driver_version + LOG(WARNING) << "Unable to parse unknown Intel GPU driver version. \"" << driver_version << "\" does not match xx.xx.xxxxx (Linux), x.x.xxxx (L0)," << " xx.xx.xxx.xxxx (Windows) for device \"" << device.get_info() << "\"."; @@ -1470,7 +1470,7 @@ std::vector available_sycl_devices() if (driver_build_version < lowest_supported_driver_version) { filter_out = true; - VLOG_WARNING << "Driver version for device \"" + LOG(WARNING) << "Driver version for device \"" << device.get_info() << "\" is too old. Expected \"" << lowest_supported_driver_version << "\" or newer, but got \"" << driver_build_version << "\"."; diff --git a/intern/cycles/device/oneapi/queue.cpp b/intern/cycles/device/oneapi/queue.cpp index 130ba969cff..253111c00a9 100644 --- a/intern/cycles/device/oneapi/queue.cpp +++ b/intern/cycles/device/oneapi/queue.cpp @@ -28,8 +28,8 @@ int OneapiDeviceQueue::num_concurrent_states(const size_t state_size) const { int num_states = 4 * num_concurrent_busy_states(state_size); - VLOG_DEVICE_STATS << "GPU queue concurrent states: " << num_states << ", using up to " - << string_human_readable_size(num_states * state_size); + LOG(STATS) << "GPU queue concurrent states: " << num_states << ", using up to " + << string_human_readable_size(num_states * state_size); return num_states; } diff --git a/intern/cycles/device/optix/device.cpp b/intern/cycles/device/optix/device.cpp index 835367ecf01..5dad8b8c9c3 100644 --- a/intern/cycles/device/optix/device.cpp +++ b/intern/cycles/device/optix/device.cpp @@ -44,12 +44,12 @@ bool device_optix_init() const OptixResult result = optixInit(); if (result == OPTIX_ERROR_UNSUPPORTED_ABI_VERSION) { - VLOG_WARNING << "OptiX initialization failed because the installed NVIDIA driver is too old. " + LOG(WARNING) << "OptiX initialization failed because the installed NVIDIA driver is too old. " "Please update to the latest driver first!"; return false; } if (result != OPTIX_SUCCESS) { - VLOG_WARNING << "OptiX initialization failed with error code " << (unsigned int)result; + LOG(WARNING) << "OptiX initialization failed with error code " << (unsigned int)result; return false; } diff --git a/intern/cycles/device/optix/device_impl.cpp b/intern/cycles/device/optix/device_impl.cpp index 9e203bda028..841c37dacf7 100644 --- a/intern/cycles/device/optix/device_impl.cpp +++ b/intern/cycles/device/optix/device_impl.cpp @@ -74,10 +74,10 @@ OptiXDevice::OptiXDevice(const DeviceInfo &info, Stats &stats, Profiler &profile LOG(ERROR) << message; break; case 3: - VLOG_WARNING << message; + LOG(WARNING) << message; break; case 4: - VLOG_INFO << message; + LOG(INFO) << message; break; default: break; @@ -85,7 +85,7 @@ OptiXDevice::OptiXDevice(const DeviceInfo &info, Stats &stats, Profiler &profile }; # endif if (DebugFlags().optix.use_debug) { - VLOG_INFO << "Using OptiX debug mode."; + LOG(INFO) << "Using OptiX debug mode."; options.validationMode = OPTIX_DEVICE_CONTEXT_VALIDATION_MODE_ALL; } optix_assert(optixDeviceContextCreate(cuContext, &options, &context)); @@ -1073,11 +1073,11 @@ bool OptiXDevice::build_optix_bvh(BVHOptiX *bvh, use_fast_trace_bvh = true; } else if (use_fast_trace_bvh) { - VLOG_INFO << "Using fast to trace OptiX BVH"; + LOG(INFO) << "Using fast to trace OptiX BVH"; options.buildFlags = OPTIX_BUILD_FLAG_PREFER_FAST_TRACE | OPTIX_BUILD_FLAG_ALLOW_COMPACTION; } else { - VLOG_INFO << "Using fast to update OptiX BVH"; + LOG(INFO) << "Using fast to update OptiX BVH"; options.buildFlags = OPTIX_BUILD_FLAG_PREFER_FAST_BUILD | OPTIX_BUILD_FLAG_ALLOW_UPDATE; } diff --git a/intern/cycles/device/queue.cpp b/intern/cycles/device/queue.cpp index 76d5eb6c0d5..10b81a6fe99 100644 --- a/intern/cycles/device/queue.cpp +++ b/intern/cycles/device/queue.cpp @@ -21,7 +21,7 @@ DeviceQueue::DeviceQueue(Device *device) : device(device) DeviceQueue::~DeviceQueue() { - if (VLOG_DEVICE_STATS_IS_ON) { + if (LOG_IS_ON(STATS)) { /* Print kernel execution times sorted by time. */ vector> stats_sorted; for (const auto &stat : stats_kernel_time_) { @@ -34,25 +34,24 @@ DeviceQueue::~DeviceQueue() return a.second > b.second; }); - VLOG_DEVICE_STATS << "GPU queue stats:"; + LOG(STATS) << "GPU queue stats:"; double total_time = 0.0; for (const auto &[mask, time] : stats_sorted) { total_time += time; - VLOG_DEVICE_STATS << " " << std::setfill(' ') << std::setw(10) << std::fixed - << std::setprecision(5) << std::right << time - << "s: " << device_kernel_mask_as_string(mask); + LOG(STATS) << " " << std::setfill(' ') << std::setw(10) << std::fixed + << std::setprecision(5) << std::right << time + << "s: " << device_kernel_mask_as_string(mask); } if (is_per_kernel_performance_) { - VLOG_DEVICE_STATS << "GPU queue total time: " << std::fixed << std::setprecision(5) - << total_time; + LOG(STATS) << "GPU queue total time: " << std::fixed << std::setprecision(5) << total_time; } } } void DeviceQueue::debug_init_execution() { - if (VLOG_DEVICE_STATS_IS_ON) { + if (LOG_IS_ON(STATS)) { last_sync_time_ = time_dt(); } @@ -61,9 +60,9 @@ void DeviceQueue::debug_init_execution() void DeviceQueue::debug_enqueue_begin(DeviceKernel kernel, const int work_size) { - if (VLOG_DEVICE_STATS_IS_ON) { - VLOG_DEVICE_STATS << "GPU queue launch " << device_kernel_as_string(kernel) << ", work_size " - << work_size; + if (LOG_IS_ON(STATS)) { + LOG(STATS) << "GPU queue launch " << device_kernel_as_string(kernel) << ", work_size " + << work_size; } last_kernels_enqueued_.set(kernel, true); @@ -71,17 +70,17 @@ void DeviceQueue::debug_enqueue_begin(DeviceKernel kernel, const int work_size) void DeviceQueue::debug_enqueue_end() { - if (VLOG_DEVICE_STATS_IS_ON && is_per_kernel_performance_) { + if (LOG_IS_ON(STATS) && is_per_kernel_performance_) { synchronize(); } } void DeviceQueue::debug_synchronize() { - if (VLOG_DEVICE_STATS_IS_ON) { + if (LOG_IS_ON(STATS)) { const double new_time = time_dt(); const double elapsed_time = new_time - last_sync_time_; - VLOG_DEVICE_STATS << "GPU queue synchronize, elapsed " << std::setw(10) << elapsed_time << "s"; + LOG(STATS) << "GPU queue synchronize, elapsed " << std::setw(10) << elapsed_time << "s"; /* There is no sense to have an entries in the performance data * container without related kernel information. */ diff --git a/intern/cycles/hydra/field.cpp b/intern/cycles/hydra/field.cpp index f794ba21901..f4febf0b9fa 100644 --- a/intern/cycles/hydra/field.cpp +++ b/intern/cycles/hydra/field.cpp @@ -44,10 +44,10 @@ class HdCyclesVolumeLoader : public VDBImageLoader { } } catch (const openvdb::IoError &e) { - VLOG_WARNING << "Error loading OpenVDB file: " << e.what(); + LOG(WARNING) << "Error loading OpenVDB file: " << e.what(); } catch (...) { - VLOG_WARNING << "Error loading OpenVDB file: Unknown error"; + LOG(WARNING) << "Error loading OpenVDB file: Unknown error"; } } }; diff --git a/intern/cycles/integrator/denoiser.cpp b/intern/cycles/integrator/denoiser.cpp index 9d7922615c2..f8f7abc8f94 100644 --- a/intern/cycles/integrator/denoiser.cpp +++ b/intern/cycles/integrator/denoiser.cpp @@ -258,7 +258,7 @@ bool Denoiser::load_kernels(Progress *progress) return false; } - VLOG_WORK << "Will denoise on " << denoiser_device_->info.description << " (" + LOG(WORK) << "Will denoise on " << denoiser_device_->info.description << " (" << denoiser_device_->info.id << ")"; denoise_kernels_are_loaded_ = true; diff --git a/intern/cycles/integrator/denoiser_gpu.cpp b/intern/cycles/integrator/denoiser_gpu.cpp index 1b1598140b1..e622e6a2ac2 100644 --- a/intern/cycles/integrator/denoiser_gpu.cpp +++ b/intern/cycles/integrator/denoiser_gpu.cpp @@ -54,7 +54,7 @@ bool DenoiserGPU::denoise_buffer(const BufferParams &buffer_params, task.render_buffers = render_buffers; } else { - VLOG_WORK << "Creating temporary buffer on denoiser device."; + LOG(WORK) << "Creating temporary buffer on denoiser device."; /* Create buffer which is available by the device used by denoiser. */ diff --git a/intern/cycles/integrator/denoiser_oidn.cpp b/intern/cycles/integrator/denoiser_oidn.cpp index 8ad189b13f7..829b0accd63 100644 --- a/intern/cycles/integrator/denoiser_oidn.cpp +++ b/intern/cycles/integrator/denoiser_oidn.cpp @@ -307,7 +307,7 @@ class OIDNDenoiseContext { /* Read pass pixels using PassAccessor into a temporary buffer which is owned by the pass.. */ void read_pass_pixels_into_buffer(OIDNPass &oidn_pass) { - VLOG_WORK << "Allocating temporary buffer for pass " << oidn_pass.name << " (" + LOG(WORK) << "Allocating temporary buffer for pass " << oidn_pass.name << " (" << pass_type_as_string(oidn_pass.type) << ")"; const int64_t width = buffer_params_.width; diff --git a/intern/cycles/integrator/denoiser_oidn_gpu.cpp b/intern/cycles/integrator/denoiser_oidn_gpu.cpp index 1bd2cbb290c..92aac3f9cce 100644 --- a/intern/cycles/integrator/denoiser_oidn_gpu.cpp +++ b/intern/cycles/integrator/denoiser_oidn_gpu.cpp @@ -77,7 +77,7 @@ bool OIDNDenoiserGPU::is_device_supported(const DeviceInfo &device) return false; } - VLOG_DEBUG << "Checking device " << device.description << " (" << device.id + LOG(DEBUG) << "Checking device " << device.description << " (" << device.id << ") for OIDN GPU support"; int device_type = OIDN_DEVICE_TYPE_DEFAULT; @@ -101,20 +101,20 @@ bool OIDNDenoiserGPU::is_device_supported(const DeviceInfo &device) # ifdef OIDN_DEVICE_METAL case DEVICE_METAL: { const int num_devices = oidnGetNumPhysicalDevices(); - VLOG_DEBUG << "Found " << num_devices << " OIDN device(s)"; + LOG(DEBUG) << "Found " << num_devices << " OIDN device(s)"; for (int i = 0; i < num_devices; i++) { const int type = oidnGetPhysicalDeviceInt(i, "type"); const char *name = oidnGetPhysicalDeviceString(i, "name"); - VLOG_DEBUG << "OIDN device " << i << ": name=\"" << name + LOG(DEBUG) << "OIDN device " << i << ": name=\"" << name << "\", type=" << oidn_device_type_to_string(OIDNDeviceType(type)); if (type == OIDN_DEVICE_TYPE_METAL) { if (device.id.find(name) != std::string::npos) { - VLOG_DEBUG << "OIDN device name matches the Cycles device name"; + LOG(DEBUG) << "OIDN device name matches the Cycles device name"; return true; } } } - VLOG_DEBUG << "No matched OIDN device found"; + LOG(DEBUG) << "No matched OIDN device found"; return false; } # endif @@ -127,11 +127,11 @@ bool OIDNDenoiserGPU::is_device_supported(const DeviceInfo &device) /* Match GPUs by their PCI ID. */ const int num_devices = oidnGetNumPhysicalDevices(); - VLOG_DEBUG << "Found " << num_devices << " OIDN device(s)"; + LOG(DEBUG) << "Found " << num_devices << " OIDN device(s)"; for (int i = 0; i < num_devices; i++) { const int type = oidnGetPhysicalDeviceInt(i, "type"); const char *name = oidnGetPhysicalDeviceString(i, "name"); - VLOG_DEBUG << "OIDN device " << i << ": name=\"" << name + LOG(DEBUG) << "OIDN device " << i << ": name=\"" << name << "\" type=" << oidn_device_type_to_string(OIDNDeviceType(type)); if (type == device_type) { if (oidnGetPhysicalDeviceBool(i, "pciAddressSupported")) { @@ -139,18 +139,18 @@ bool OIDNDenoiserGPU::is_device_supported(const DeviceInfo &device) unsigned int pci_bus = oidnGetPhysicalDeviceInt(i, "pciBus"); unsigned int pci_device = oidnGetPhysicalDeviceInt(i, "pciDevice"); string pci_id = string_printf("%04x:%02x:%02x", pci_domain, pci_bus, pci_device); - VLOG_INFO << "OIDN device PCI-e identifier: " << pci_id; + LOG(INFO) << "OIDN device PCI-e identifier: " << pci_id; if (device.id.find(pci_id) != string::npos) { - VLOG_DEBUG << "OIDN device PCI-e identifier matches the Cycles device ID"; + LOG(DEBUG) << "OIDN device PCI-e identifier matches the Cycles device ID"; return true; } } else { - VLOG_DEBUG << "Device does not support pciAddressSupported"; + LOG(DEBUG) << "Device does not support pciAddressSupported"; } } } - VLOG_DEBUG << "No matched OIDN device found"; + LOG(DEBUG) << "No matched OIDN device found"; return false; # endif } diff --git a/intern/cycles/integrator/path_trace.cpp b/intern/cycles/integrator/path_trace.cpp index 4084c627631..5ab57322a31 100644 --- a/intern/cycles/integrator/path_trace.cpp +++ b/intern/cycles/integrator/path_trace.cpp @@ -385,7 +385,7 @@ void PathTrace::path_trace(RenderWork &render_work) return; } - VLOG_WORK << "Will path trace " << render_work.path_trace.num_samples + LOG(WORK) << "Will path trace " << render_work.path_trace.num_samples << " samples at the resolution divider " << render_work.resolution_divider; const double start_time = time_dt(); @@ -415,7 +415,7 @@ void PathTrace::path_trace(RenderWork &render_work) work_balance_infos_[i].time_spent += work_time; work_balance_infos_[i].occupancy = statistics.occupancy; - VLOG_INFO << "Rendered " << num_samples << " samples in " << work_time << " seconds (" + LOG(INFO) << "Rendered " << num_samples << " samples in " << work_time << " seconds (" << work_time / num_samples << " seconds per sample), occupancy: " << statistics.occupancy; }); @@ -440,10 +440,10 @@ void PathTrace::adaptive_sample(RenderWork &render_work) bool did_reschedule_on_idle = false; while (true) { - VLOG_WORK << "Will filter adaptive stopping buffer, threshold " + LOG(WORK) << "Will filter adaptive stopping buffer, threshold " << render_work.adaptive_sampling.threshold; if (render_work.adaptive_sampling.reset) { - VLOG_WORK << "Will re-calculate convergency flag for currently converged pixels."; + LOG(WORK) << "Will re-calculate convergency flag for currently converged pixels."; } const double start_time = time_dt(); @@ -462,11 +462,11 @@ void PathTrace::adaptive_sample(RenderWork &render_work) render_work, time_dt() - start_time, is_cancel_requested()); if (num_active_pixels == 0) { - VLOG_WORK << "All pixels converged."; + LOG(WORK) << "All pixels converged."; if (!render_scheduler_.render_work_reschedule_on_converge(render_work)) { break; } - VLOG_WORK << "Continuing with lower threshold."; + LOG(WORK) << "Continuing with lower threshold."; } else if (did_reschedule_on_idle) { break; @@ -478,10 +478,10 @@ void PathTrace::adaptive_sample(RenderWork &render_work) * A better heuristic is possible here: for example, use maximum of 128^2 and percentage of * the final resolution. */ if (!render_scheduler_.render_work_reschedule_on_idle(render_work)) { - VLOG_WORK << "Rescheduling is not possible: final threshold is reached."; + LOG(WORK) << "Rescheduling is not possible: final threshold is reached."; break; } - VLOG_WORK << "Rescheduling lower threshold."; + LOG(WORK) << "Rescheduling lower threshold."; did_reschedule_on_idle = true; } else { @@ -575,7 +575,7 @@ void PathTrace::cryptomatte_postprocess(const RenderWork &render_work) if (!render_work.cryptomatte.postprocess) { return; } - VLOG_WORK << "Perform cryptomatte work."; + LOG(WORK) << "Perform cryptomatte work."; parallel_for_each(path_trace_works_, [&](unique_ptr &path_trace_work) { path_trace_work->cryptomatte_postproces(); @@ -593,7 +593,7 @@ void PathTrace::denoise(const RenderWork &render_work) return; } - VLOG_WORK << "Perform denoising work."; + LOG(WORK) << "Perform denoising work."; const double start_time = time_dt(); @@ -686,26 +686,26 @@ void PathTrace::update_display(const RenderWork &render_work) } if (!display_ && !output_driver_) { - VLOG_WORK << "Ignore display update."; + LOG(WORK) << "Ignore display update."; return; } if (full_params_.width == 0 || full_params_.height == 0) { - VLOG_WORK << "Skipping PathTraceDisplay update due to 0 size of the render buffer."; + LOG(WORK) << "Skipping PathTraceDisplay update due to 0 size of the render buffer."; return; } const double start_time = time_dt(); if (output_driver_) { - VLOG_WORK << "Invoke buffer update callback."; + LOG(WORK) << "Invoke buffer update callback."; const PathTraceTile tile(*this); output_driver_->update_render_tile(tile); } if (display_) { - VLOG_WORK << "Perform copy to GPUDisplay work."; + LOG(WORK) << "Perform copy to GPUDisplay work."; const int texture_width = render_state_.effective_big_tile_params.window_width; const int texture_height = render_state_.effective_big_tile_params.window_height; @@ -746,33 +746,33 @@ void PathTrace::rebalance(const RenderWork &render_work) const int num_works = path_trace_works_.size(); if (num_works == 1) { - VLOG_WORK << "Ignoring rebalance work due to single device render."; + LOG(WORK) << "Ignoring rebalance work due to single device render."; return; } const double start_time = time_dt(); - if (VLOG_IS_ON(3)) { - VLOG_WORK << "Perform rebalance work."; - VLOG_WORK << "Per-device path tracing time (seconds):"; + if (LOG_IS_ON(WORK)) { + LOG(WORK) << "Perform rebalance work."; + LOG(WORK) << "Per-device path tracing time (seconds):"; for (int i = 0; i < num_works; ++i) { - VLOG_WORK << path_trace_works_[i]->get_device()->info.description << ": " + LOG(WORK) << path_trace_works_[i]->get_device()->info.description << ": " << work_balance_infos_[i].time_spent; } } const bool did_rebalance = work_balance_do_rebalance(work_balance_infos_); - if (VLOG_IS_ON(3)) { - VLOG_WORK << "Calculated per-device weights for works:"; + if (LOG_IS_ON(WORK)) { + LOG(WORK) << "Calculated per-device weights for works:"; for (int i = 0; i < num_works; ++i) { - VLOG_WORK << path_trace_works_[i]->get_device()->info.description << ": " + LOG(WORK) << path_trace_works_[i]->get_device()->info.description << ": " << work_balance_infos_[i].weight; } } if (!did_rebalance) { - VLOG_WORK << "Balance in path trace works did not change."; + LOG(WORK) << "Balance in path trace works did not change."; render_scheduler_.report_rebalance_time(render_work, time_dt() - start_time, false); return; } @@ -796,7 +796,7 @@ void PathTrace::write_tile_buffer(const RenderWork &render_work) return; } - VLOG_WORK << "Write tile result."; + LOG(WORK) << "Write tile result."; render_state_.tile_written = true; @@ -810,13 +810,13 @@ void PathTrace::write_tile_buffer(const RenderWork &render_work) * * Important thing is: tile should be written to the software via callback only once. */ if (!has_multiple_tiles) { - VLOG_WORK << "Write tile result via buffer write callback."; + LOG(WORK) << "Write tile result via buffer write callback."; tile_buffer_write(); } /* Write tile to disk, so that the render work's render buffer can be re-used for the next tile. */ else { - VLOG_WORK << "Write tile result to disk."; + LOG(WORK) << "Write tile result to disk."; tile_buffer_write_to_disk(); } } @@ -827,10 +827,10 @@ void PathTrace::finalize_full_buffer_on_disk(const RenderWork &render_work) return; } - VLOG_WORK << "Handle full-frame render buffer work."; + LOG(WORK) << "Handle full-frame render buffer work."; if (!tile_manager_.has_written_tiles()) { - VLOG_WORK << "No tiles on disk."; + LOG(WORK) << "No tiles on disk."; return; } @@ -1030,7 +1030,7 @@ static string get_layer_view_name(const RenderBuffers &buffers) void PathTrace::process_full_buffer_from_disk(string_view filename) { - VLOG_WORK << "Processing full frame buffer file " << filename; + LOG(WORK) << "Processing full frame buffer file " << filename; progress_set_status("Reading full buffer from disk"); @@ -1319,7 +1319,7 @@ static string denoiser_device_report(const Denoiser *denoiser) string PathTrace::full_report() const { - string result = "\nFull path tracing report\n"; + string result = "Full path tracing report:\n"; result += path_trace_devices_report(path_trace_works_); result += denoiser_device_report(denoiser_.get()); @@ -1461,10 +1461,10 @@ void PathTrace::guiding_prepare_structures() void PathTrace::guiding_update_structures() { #if defined(WITH_PATH_GUIDING) - VLOG_WORK << "Update path guiding structures"; + LOG(WORK) << "Update path guiding structures"; - VLOG_DEBUG << "Number of surface samples: " << guiding_sample_data_storage_->GetSizeSurface(); - VLOG_DEBUG << "Number of volume samples: " << guiding_sample_data_storage_->GetSizeVolume(); + LOG(DEBUG) << "Number of surface samples: " << guiding_sample_data_storage_->GetSizeSurface(); + LOG(DEBUG) << "Number of volume samples: " << guiding_sample_data_storage_->GetSizeVolume(); const size_t num_valid_samples = guiding_sample_data_storage_->GetSizeSurface() + guiding_sample_data_storage_->GetSizeVolume(); @@ -1474,7 +1474,7 @@ void PathTrace::guiding_update_structures() guiding_field_->Update(*guiding_sample_data_storage_); guiding_update_count++; - VLOG_DEBUG << "Path guiding field valid: " << guiding_field_->Validate(); + LOG(DEBUG) << "Path guiding field valid: " << guiding_field_->Validate(); guiding_sample_data_storage_->Clear(); } diff --git a/intern/cycles/integrator/path_trace_work_cpu.cpp b/intern/cycles/integrator/path_trace_work_cpu.cpp index 1df30928b02..d13f67c1bcc 100644 --- a/intern/cycles/integrator/path_trace_work_cpu.cpp +++ b/intern/cycles/integrator/path_trace_work_cpu.cpp @@ -353,11 +353,11 @@ void PathTraceWorkCPU::guiding_push_sample_data_to_global_storage(ThreadKernelGl render_buffer) { # ifdef WITH_CYCLES_DEBUG - if (VLOG_WORK_IS_ON) { + if (LOG_IS_ON(WORK)) { /* Check if the generated path segments contain valid values. */ const bool validSegments = kg->opgl_path_segment_storage->ValidateSegments(); if (!validSegments) { - VLOG_WORK << "Guiding: invalid path segments!"; + LOG(WORK) << "Guiding: invalid path segments!"; } } @@ -382,10 +382,10 @@ void PathTraceWorkCPU::guiding_push_sample_data_to_global_storage(ThreadKernelGl # ifdef WITH_CYCLES_DEBUG /* Check if the training/radiance samples generated by the path segment storage are valid. */ - if (VLOG_WORK_IS_ON) { + if (LOG_IS_ON(WORK)) { const bool validSamples = kg->opgl_path_segment_storage->ValidateSamples(); if (!validSamples) { - VLOG_WORK + LOG(WORK) << "Guiding: path segment storage generated/contains invalid radiance/training samples!"; } } diff --git a/intern/cycles/integrator/path_trace_work_gpu.cpp b/intern/cycles/integrator/path_trace_work_gpu.cpp index 1faec419c1e..daf595256c8 100644 --- a/intern/cycles/integrator/path_trace_work_gpu.cpp +++ b/intern/cycles/integrator/path_trace_work_gpu.cpp @@ -157,7 +157,7 @@ void PathTraceWorkGPU::alloc_integrator_soa() if ((kernel_features & (feature))) { \ string name_str = string_printf("%sintegrator_state_" #parent_struct "_" #name, \ shadow ? "shadow_" : ""); \ - VLOG_DEBUG << "Skipping " << name_str \ + LOG(DEBUG) << "Skipping " << name_str \ << " -- data is packed inside integrator_state_" #parent_struct "_packed"; \ } # define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) \ @@ -206,13 +206,13 @@ void PathTraceWorkGPU::alloc_integrator_soa() #undef KERNEL_STRUCT_END_ARRAY #undef KERNEL_STRUCT_VOLUME_STACK_SIZE - if (VLOG_DEVICE_STATS_IS_ON) { + if (LOG_IS_ON(STATS)) { size_t total_soa_size = 0; for (auto &&soa_memory : integrator_state_soa_) { total_soa_size += soa_memory->memory_size(); } - VLOG_DEVICE_STATS << "GPU SoA state size: " << string_human_readable_size(total_soa_size); + LOG(STATS) << "GPU SoA state size: " << string_human_readable_size(total_soa_size); } } @@ -943,10 +943,10 @@ bool PathTraceWorkGPU::should_use_graphics_interop(PathTraceDisplay *display) true); if (interop_use_) { - VLOG_INFO << "Using graphics interop GPU display update."; + LOG(INFO) << "Using graphics interop GPU display update."; } else { - VLOG_INFO << "Using naive GPU display update."; + LOG(INFO) << "Using naive GPU display update."; } interop_use_checked_ = true; diff --git a/intern/cycles/integrator/render_scheduler.cpp b/intern/cycles/integrator/render_scheduler.cpp index 744f193eb44..36fdfaf8a7d 100644 --- a/intern/cycles/integrator/render_scheduler.cpp +++ b/intern/cycles/integrator/render_scheduler.cpp @@ -229,7 +229,7 @@ bool RenderScheduler::render_work_reschedule_on_idle(RenderWork &render_work) void RenderScheduler::render_work_reschedule_on_cancel(RenderWork &render_work) { - VLOG_WORK << "Schedule work for cancel."; + LOG(WORK) << "Schedule work for cancel."; /* Un-schedule samples: they will not be rendered and should not be counted. */ state_.num_rendered_samples -= render_work.path_trace.num_samples; @@ -495,7 +495,7 @@ void RenderScheduler::report_path_trace_time(const RenderWork &render_work, path_trace_time_.add_average(final_time_approx, render_work.path_trace.num_samples); - VLOG_WORK << "Average path tracing time: " << path_trace_time_.get_average() << " seconds."; + LOG(WORK) << "Average path tracing time: " << path_trace_time_.get_average() << " seconds."; } void RenderScheduler::report_path_trace_occupancy(const RenderWork &render_work, @@ -503,7 +503,7 @@ void RenderScheduler::report_path_trace_occupancy(const RenderWork &render_work, { state_.occupancy_num_samples = render_work.path_trace.num_samples; state_.occupancy = occupancy; - VLOG_WORK << "Measured path tracing occupancy: " << occupancy; + LOG(WORK) << "Measured path tracing occupancy: " << occupancy; } void RenderScheduler::report_adaptive_filter_time(const RenderWork &render_work, @@ -524,7 +524,7 @@ void RenderScheduler::report_adaptive_filter_time(const RenderWork &render_work, adaptive_filter_time_.add_average(final_time_approx, render_work.path_trace.num_samples); - VLOG_WORK << "Average adaptive sampling filter time: " << adaptive_filter_time_.get_average() + LOG(WORK) << "Average adaptive sampling filter time: " << adaptive_filter_time_.get_average() << " seconds."; } @@ -544,7 +544,7 @@ void RenderScheduler::report_denoise_time(const RenderWork &render_work, const d denoise_time_.add_average(final_time_approx); - VLOG_WORK << "Average denoising time: " << denoise_time_.get_average() << " seconds."; + LOG(WORK) << "Average denoising time: " << denoise_time_.get_average() << " seconds."; } void RenderScheduler::report_display_update_time(const RenderWork &render_work, const double time) @@ -563,7 +563,7 @@ void RenderScheduler::report_display_update_time(const RenderWork &render_work, display_update_time_.add_average(final_time_approx); - VLOG_WORK << "Average display update time: " << display_update_time_.get_average() + LOG(WORK) << "Average display update time: " << display_update_time_.get_average() << " seconds."; /* Move the display update moment further in time, so that logic which checks when last update @@ -590,7 +590,7 @@ void RenderScheduler::report_rebalance_time(const RenderWork &render_work, state_.last_rebalance_changed = balance_changed; - VLOG_WORK << "Average rebalance time: " << rebalance_time_.get_average() << " seconds."; + LOG(WORK) << "Average rebalance time: " << rebalance_time_.get_average() << " seconds."; } string RenderScheduler::full_report() const @@ -1115,7 +1115,7 @@ void RenderScheduler::update_start_resolution_divider() * that we have a somewhat good initial behavior, giving a chance to collect real numbers. */ start_resolution_divider_ = min(default_start_resolution_divider_, max_res_divider_for_desired_size); - VLOG_WORK << "Initial resolution divider is " << start_resolution_divider_; + LOG(WORK) << "Initial resolution divider is " << start_resolution_divider_; return; } @@ -1144,7 +1144,7 @@ void RenderScheduler::update_start_resolution_divider() * unreadable viewport render. */ start_resolution_divider_ = min(resolution_divider_for_update, max_res_divider_for_desired_size); - VLOG_WORK << "Calculated resolution divider is " << start_resolution_divider_; + LOG(WORK) << "Calculated resolution divider is " << start_resolution_divider_; } double RenderScheduler::guess_viewport_navigation_update_interval_in_seconds() const diff --git a/intern/cycles/integrator/shader_eval.cpp b/intern/cycles/integrator/shader_eval.cpp index 15d2bc75c13..a5e108210e2 100644 --- a/intern/cycles/integrator/shader_eval.cpp +++ b/intern/cycles/integrator/shader_eval.cpp @@ -33,7 +33,7 @@ bool ShaderEval::eval(const ShaderEvalType type, device_->foreach_device([&](Device *device) { if (!first_device) { - VLOG_WORK << "Multi-devices are not yet fully implemented, will evaluate shader on a " + LOG(WORK) << "Multi-devices are not yet fully implemented, will evaluate shader on a " "single device."; return; } diff --git a/intern/cycles/integrator/work_tile_scheduler.cpp b/intern/cycles/integrator/work_tile_scheduler.cpp index 7edc90e66ae..c1a0e3803e2 100644 --- a/intern/cycles/integrator/work_tile_scheduler.cpp +++ b/intern/cycles/integrator/work_tile_scheduler.cpp @@ -57,18 +57,18 @@ void WorkTileScheduler::reset_scheduler_state() tile_size_.num_samples; if (num_path_states_in_tile == 0) { - VLOG_WORK << "Will not schedule any tiles: no work remained for the device"; + LOG(WORK) << "Will not schedule any tiles: no work remained for the device"; num_tiles_x_ = 0; num_tiles_y_ = 0; num_tiles_per_sample_range_ = 0; } else { const int num_tiles = max_num_path_states_ / num_path_states_in_tile; - VLOG_WORK << "Will schedule " << num_tiles << " tiles of " << tile_size_; + LOG(WORK) << "Will schedule " << num_tiles << " tiles of " << tile_size_; /* The logging is based on multiple tiles scheduled, ignoring overhead of multi-tile * scheduling and purely focusing on the number of used path states. */ - VLOG_WORK << "Number of unused path states: " + LOG(WORK) << "Number of unused path states: " << max_num_path_states_ - num_tiles * num_path_states_in_tile; num_tiles_x_ = divide_up(image_size_px_.x, tile_size_.width); diff --git a/intern/cycles/kernel/osl/services.cpp b/intern/cycles/kernel/osl/services.cpp index 3a69ade9bdf..d3c07ab1a3b 100644 --- a/intern/cycles/kernel/osl/services.cpp +++ b/intern/cycles/kernel/osl/services.cpp @@ -133,7 +133,7 @@ OSLRenderServices::OSLRenderServices(OSL::TextureSystem *texture_system, const i OSLRenderServices::~OSLRenderServices() { if (m_texturesys) { - VLOG_INFO << "OSL texture system stats:\n" << m_texturesys->getstats(); + LOG(INFO) << "OSL texture system stats:\n" << m_texturesys->getstats(); } } diff --git a/intern/cycles/scene/alembic.cpp b/intern/cycles/scene/alembic.cpp index a5f395ef7c8..44a8b35c1b3 100644 --- a/intern/cycles/scene/alembic.cpp +++ b/intern/cycles/scene/alembic.cpp @@ -1558,7 +1558,7 @@ void AlembicProcedural::build_caches(Progress &progress) } } - VLOG_WORK << "AlembicProcedural memory usage : " << string_human_readable_size(memory_used); + LOG(WORK) << "AlembicProcedural memory usage : " << string_human_readable_size(memory_used); } CCL_NAMESPACE_END diff --git a/intern/cycles/scene/camera.cpp b/intern/cycles/scene/camera.cpp index 74bbfe7b266..47c77fbe82d 100644 --- a/intern/cycles/scene/camera.cpp +++ b/intern/cycles/scene/camera.cpp @@ -536,7 +536,7 @@ void Camera::device_update_volume(Device * /*device*/, DeviceScene *dscene, Scen if (object->get_geometry()->has_volume && viewplane_boundbox.intersects(object->bounds)) { /* TODO(sergey): Consider adding more grained check. */ - VLOG_INFO << "Detected camera inside volume."; + LOG(INFO) << "Detected camera inside volume."; kernel_camera.is_inside_volume = 1; parallel_for_cancel(); break; @@ -545,7 +545,7 @@ void Camera::device_update_volume(Device * /*device*/, DeviceScene *dscene, Scen }); if (!kernel_camera.is_inside_volume) { - VLOG_INFO << "Camera is outside of the volume."; + LOG(INFO) << "Camera is outside of the volume."; } } diff --git a/intern/cycles/scene/colorspace.cpp b/intern/cycles/scene/colorspace.cpp index 226d410213e..050f53234fd 100644 --- a/intern/cycles/scene/colorspace.cpp +++ b/intern/cycles/scene/colorspace.cpp @@ -47,7 +47,7 @@ ColorSpaceProcessor *ColorSpaceManager::get_processor(ustring colorspace) config = OCIO::GetCurrentConfig(); } catch (const OCIO::Exception &exception) { - VLOG_WARNING << "OCIO config error: " << exception.what(); + LOG(WARNING) << "OCIO config error: " << exception.what(); return nullptr; } @@ -64,7 +64,7 @@ ColorSpaceProcessor *ColorSpaceManager::get_processor(ustring colorspace) } catch (const OCIO::Exception &exception) { cached_processors[colorspace] = OCIO::ConstProcessorRcPtr(); - VLOG_WARNING << "Colorspace " << colorspace.c_str() + LOG(WARNING) << "Colorspace " << colorspace.c_str() << " can't be converted to scene_linear: " << exception.what(); } } @@ -92,7 +92,7 @@ bool ColorSpaceManager::colorspace_is_data(ustring colorspace) config = OCIO::GetCurrentConfig(); } catch (const OCIO::Exception &exception) { - VLOG_WARNING << "OCIO config error: " << exception.what(); + LOG(WARNING) << "OCIO config error: " << exception.what(); return false; } @@ -153,12 +153,12 @@ ustring ColorSpaceManager::detect_known_colorspace(ustring colorspace, const thread_scoped_lock cache_lock(cache_colorspaces_mutex); if (is_scene_linear) { - VLOG_INFO << "Colorspace " << colorspace.string() << " is no-op"; + LOG(INFO) << "Colorspace " << colorspace.string() << " is no-op"; cached_colorspaces[colorspace] = u_colorspace_raw; return u_colorspace_raw; } if (is_srgb) { - VLOG_INFO << "Colorspace " << colorspace.string() << " is sRGB"; + LOG(INFO) << "Colorspace " << colorspace.string() << " is sRGB"; cached_colorspaces[colorspace] = u_colorspace_srgb; return u_colorspace_srgb; } @@ -170,15 +170,15 @@ ustring ColorSpaceManager::detect_known_colorspace(ustring colorspace, config = OCIO::GetCurrentConfig(); } catch (const OCIO::Exception &exception) { - VLOG_WARNING << "OCIO config error: " << exception.what(); + LOG(WARNING) << "OCIO config error: " << exception.what(); return u_colorspace_raw; } if (!config || !config->getColorSpace(colorspace.c_str())) { - VLOG_WARNING << "Colorspace " << colorspace.c_str() << " not found, using raw instead"; + LOG(WARNING) << "Colorspace " << colorspace.c_str() << " not found, using raw instead"; } else { - VLOG_WARNING << "Colorspace " << colorspace.c_str() + LOG(WARNING) << "Colorspace " << colorspace.c_str() << " can't be converted to scene_linear, using raw instead"; } cached_colorspaces[colorspace] = u_colorspace_raw; @@ -186,11 +186,11 @@ ustring ColorSpaceManager::detect_known_colorspace(ustring colorspace, } /* Convert to/from colorspace with OpenColorIO. */ - VLOG_INFO << "Colorspace " << colorspace.string() << " handled through OpenColorIO"; + LOG(INFO) << "Colorspace " << colorspace.string() << " handled through OpenColorIO"; cached_colorspaces[colorspace] = colorspace; return colorspace; #else - VLOG_WARNING << "Colorspace " << colorspace.c_str() + LOG(WARNING) << "Colorspace " << colorspace.c_str() << " not available, built without OpenColorIO"; return u_colorspace_raw; #endif diff --git a/intern/cycles/scene/constant_fold.cpp b/intern/cycles/scene/constant_fold.cpp index aa232a83bd0..07fe135887c 100644 --- a/intern/cycles/scene/constant_fold.cpp +++ b/intern/cycles/scene/constant_fold.cpp @@ -30,7 +30,7 @@ bool ConstantFolder::all_inputs_constant() const void ConstantFolder::make_constant(const float value) const { - VLOG_DEBUG << "Folding " << node->name << "::" << output->name() << " to constant (" << value + LOG(DEBUG) << "Folding " << node->name << "::" << output->name() << " to constant (" << value << ")."; for (ShaderInput *sock : output->links) { @@ -43,7 +43,7 @@ void ConstantFolder::make_constant(const float value) const void ConstantFolder::make_constant(const float3 value) const { - VLOG_DEBUG << "Folding " << node->name << "::" << output->name() << " to constant " << value + LOG(DEBUG) << "Folding " << node->name << "::" << output->name() << " to constant " << value << "."; for (ShaderInput *sock : output->links) { @@ -56,7 +56,7 @@ void ConstantFolder::make_constant(const float3 value) const void ConstantFolder::make_constant(const int value) const { - VLOG_DEBUG << "Folding " << node->name << "::" << output->name() << " to constant (" << value + LOG(DEBUG) << "Folding " << node->name << "::" << output->name() << " to constant (" << value << ")."; for (ShaderInput *sock : output->links) { @@ -113,7 +113,7 @@ void ConstantFolder::bypass(ShaderOutput *new_output) const { assert(new_output); - VLOG_DEBUG << "Folding " << node->name << "::" << output->name() << " to socket " + LOG(DEBUG) << "Folding " << node->name << "::" << output->name() << " to socket " << new_output->parent->name << "::" << new_output->name() << "."; /* Remove all outgoing links from socket and connect them to new_output instead. @@ -132,7 +132,7 @@ void ConstantFolder::discard() const { assert(output->type() == SocketType::CLOSURE); - VLOG_DEBUG << "Discarding closure " << node->name << "."; + LOG(DEBUG) << "Discarding closure " << node->name << "."; graph->disconnect(output); } diff --git a/intern/cycles/scene/film.cpp b/intern/cycles/scene/film.cpp index c4c545fb370..80d2cb2a5b2 100644 --- a/intern/cycles/scene/film.cpp +++ b/intern/cycles/scene/film.cpp @@ -599,10 +599,10 @@ void Film::update_passes(Scene *scene) tag_modified(); /* Debug logging. */ - if (VLOG_INFO_IS_ON) { - VLOG_INFO << "Effective scene passes:"; + if (LOG_IS_ON(INFO)) { + LOG(INFO) << "Effective scene passes:"; for (const Pass *pass : scene->passes) { - VLOG_INFO << "- " << *pass; + LOG(INFO) << "- " << *pass; } } } diff --git a/intern/cycles/scene/geometry.cpp b/intern/cycles/scene/geometry.cpp index 9423c2ba64c..bcd0b28ad55 100644 --- a/intern/cycles/scene/geometry.cpp +++ b/intern/cycles/scene/geometry.cpp @@ -692,7 +692,7 @@ void GeometryManager::device_update(Device *device, return; } - VLOG_INFO << "Total " << scene->geometry.size() << " meshes."; + LOG(INFO) << "Total " << scene->geometry.size() << " meshes."; bool true_displacement_used = false; bool curve_shadow_transparency_used = false; @@ -976,7 +976,7 @@ void GeometryManager::device_update(Device *device, TaskPool::Summary summary; pool.wait_work(&summary); - VLOG_WORK << "Objects BVH build pool statistics:\n" << summary.full_report(); + LOG(WORK) << "Objects BVH build pool statistics:\n" << summary.full_report(); } for (Shader *shader : scene->shaders) { diff --git a/intern/cycles/scene/geometry_bvh.cpp b/intern/cycles/scene/geometry_bvh.cpp index d4f1e7128f7..44e5b2d20a4 100644 --- a/intern/cycles/scene/geometry_bvh.cpp +++ b/intern/cycles/scene/geometry_bvh.cpp @@ -113,7 +113,7 @@ void GeometryManager::device_update_bvh(Device *device, bparams.bvh_type = scene->params.bvh_type; bparams.curve_subdivisions = scene->params.curve_subdivisions(); - VLOG_INFO << "Using " << bvh_layout_name(bparams.bvh_layout) << " layout."; + LOG(INFO) << "Using " << bvh_layout_name(bparams.bvh_layout) << " layout."; const bool can_refit = scene->bvh != nullptr && scene->params.bvh_type == BVH_TYPE_DYNAMIC && (bparams.bvh_layout == BVHLayout::BVH_LAYOUT_OPTIX || diff --git a/intern/cycles/scene/image.cpp b/intern/cycles/scene/image.cpp index 14a88d446fa..15173eee369 100644 --- a/intern/cycles/scene/image.cpp +++ b/intern/cycles/scene/image.cpp @@ -663,7 +663,7 @@ bool ImageManager::file_load_image(Image *img, const int texture_limit) while (max_size * scale_factor > texture_limit) { scale_factor *= 0.5f; } - VLOG_WORK << "Scaling image " << img->loader->name() << " by a factor of " << scale_factor + LOG(WORK) << "Scaling image " << img->loader->name() << " by a factor of " << scale_factor << "."; vector scaled_pixels; size_t scaled_width; diff --git a/intern/cycles/scene/image_oiio.cpp b/intern/cycles/scene/image_oiio.cpp index 9ddcf88ceb6..2840f2ca130 100644 --- a/intern/cycles/scene/image_oiio.cpp +++ b/intern/cycles/scene/image_oiio.cpp @@ -20,11 +20,11 @@ bool OIIOImageLoader::load_metadata(const ImageDeviceFeatures & /*features*/, { /* Perform preliminary checks, with meaningful logging. */ if (!path_exists(filepath.string())) { - VLOG_WARNING << "File '" << filepath.string() << "' does not exist."; + LOG(WARNING) << "File '" << filepath.string() << "' does not exist."; return false; } if (path_is_directory(filepath.string())) { - VLOG_WARNING << "File '" << filepath.string() << "' is a directory, can't use as image."; + LOG(WARNING) << "File '" << filepath.string() << "' is a directory, can't use as image."; return false; } diff --git a/intern/cycles/scene/image_vdb.cpp b/intern/cycles/scene/image_vdb.cpp index 64d8bbb0600..04f7912d9ab 100644 --- a/intern/cycles/scene/image_vdb.cpp +++ b/intern/cycles/scene/image_vdb.cpp @@ -114,10 +114,10 @@ struct ToNanoOp { # endif } catch (const std::exception &e) { - VLOG_WARNING << "Error converting OpenVDB to NanoVDB grid: " << e.what(); + LOG(WARNING) << "Error converting OpenVDB to NanoVDB grid: " << e.what(); } catch (...) { - VLOG_WARNING << "Error converting OpenVDB to NanoVDB grid: Unknown error"; + LOG(WARNING) << "Error converting OpenVDB to NanoVDB grid: Unknown error"; } return true; } diff --git a/intern/cycles/scene/integrator.cpp b/intern/cycles/scene/integrator.cpp index 9565ba9432e..2b5cab588ff 100644 --- a/intern/cycles/scene/integrator.cpp +++ b/intern/cycles/scene/integrator.cpp @@ -400,7 +400,7 @@ AdaptiveSampling Integrator::get_adaptive_sampling() const if (clamped_aa_samples > 0 && adaptive_threshold == 0.0f) { adaptive_sampling.threshold = max(0.001f, 1.0f / (float)aa_samples); - VLOG_INFO << "Adaptive sampling: automatic threshold = " << adaptive_sampling.threshold; + LOG(INFO) << "Adaptive sampling: automatic threshold = " << adaptive_sampling.threshold; } else { adaptive_sampling.threshold = adaptive_threshold; @@ -421,7 +421,7 @@ AdaptiveSampling Integrator::get_adaptive_sampling() const * in various test scenes. */ const int min_samples = (int)ceilf(16.0f / powf(adaptive_sampling.threshold, 0.3f)); adaptive_sampling.min_samples = max(4, min_samples); - VLOG_INFO << "Adaptive sampling: automatic min samples = " << adaptive_sampling.min_samples; + LOG(INFO) << "Adaptive sampling: automatic min samples = " << adaptive_sampling.min_samples; } else { adaptive_sampling.min_samples = max(4, adaptive_min_samples); diff --git a/intern/cycles/scene/light.cpp b/intern/cycles/scene/light.cpp index 33d6a29e969..87cb4ea5f6a 100644 --- a/intern/cycles/scene/light.cpp +++ b/intern/cycles/scene/light.cpp @@ -274,7 +274,7 @@ void LightManager::test_enabled_lights(Scene *scene) num_lights++; } - VLOG_INFO << "Total " << num_lights << " lights."; + LOG(INFO) << "Total " << num_lights << " lights."; bool background_enabled = false; int background_resolution = 0; @@ -287,7 +287,7 @@ void LightManager::test_enabled_lights(Scene *scene) Shader *shader = scene->background->get_shader(scene); const bool disable_mis = !(has_portal || shader->has_surface_spatial_varying); if (disable_mis) { - VLOG_INFO << "Background MIS has been disabled.\n"; + LOG(INFO) << "Background MIS has been disabled."; } for (Light *light : background_lights) { light->is_enabled = !disable_mis; @@ -387,7 +387,7 @@ void LightManager::device_update_distribution(Device * /*unused*/, /* Distribution size. */ kintegrator->num_distribution = num_distribution; - VLOG_INFO << "Use light distribution with " << num_distribution << " emitters."; + LOG(INFO) << "Use light distribution with " << num_distribution << " emitters."; /* Emission area. */ KernelLightDistribution *distribution = dscene->light_distribution.alloc(num_distribution + 1); @@ -862,7 +862,7 @@ void LightManager::device_update_tree(Device * /*unused*/, KernelLightLinkSet *klight_link_sets = dscene->data.light_link_sets; memset(klight_link_sets, 0, sizeof(dscene->data.light_link_sets)); - VLOG_INFO << "Use light tree with " << num_emitters << " emitters and " << light_tree.num_nodes + LOG(INFO) << "Use light tree with " << num_emitters << " emitters and " << light_tree.num_nodes << " nodes."; if (!use_light_linking) { @@ -908,7 +908,7 @@ void LightManager::device_update_tree(Device * /*unused*/, KernelLightTreeNode *knodes = dscene->light_tree_nodes.alloc(light_link_nodes.size()); memcpy(knodes, light_link_nodes.data(), light_link_nodes.size() * sizeof(*knodes)); - VLOG_INFO << "Specialized light tree for light linking, with " + LOG(INFO) << "Specialized light tree for light linking, with " << light_link_nodes.size() - light_tree.num_nodes << " additional nodes."; } @@ -1074,14 +1074,13 @@ void LightManager::device_update_background(Device *device, if (res.x == 0) { res = environment_res; if (res.x > 0 && res.y > 0) { - VLOG_INFO << "Automatically set World MIS resolution to " << res.x << " by " << res.y - << "\n"; + LOG(INFO) << "Automatically set World MIS resolution to " << res.x << " by " << res.y; } } /* If it's still unknown, just use the default. */ if (res.x == 0 || res.y == 0) { res = make_int2(1024, 512); - VLOG_INFO << "Setting World MIS resolution to default\n"; + LOG(INFO) << "Setting World MIS resolution to default"; } kbackground->map_res_x = res.x; kbackground->map_res_y = res.y; @@ -1140,7 +1139,7 @@ void LightManager::device_update_background(Device *device, marg_cdf[res.y].y = 1.0f; - VLOG_WORK << "Background MIS build time " << time_dt() - time_start << "\n"; + LOG(WORK) << "Background MIS build time " << time_dt() - time_start; /* update device */ dscene->light_background_marginal_cdf.copy_to_device(); @@ -1397,7 +1396,7 @@ void LightManager::device_update_lights(DeviceScene *dscene, Scene *scene) light_index++; } - VLOG_INFO << "Number of lights sent to the device: " << num_lights; + LOG(INFO) << "Number of lights sent to the device: " << num_lights; dscene->lights.copy_to_device(); } diff --git a/intern/cycles/scene/object.cpp b/intern/cycles/scene/object.cpp index 9752882c88c..9077625249a 100644 --- a/intern/cycles/scene/object.cpp +++ b/intern/cycles/scene/object.cpp @@ -792,7 +792,7 @@ void ObjectManager::device_update(Device *device, dscene->objects.tag_modified(); } - VLOG_INFO << "Total " << scene->objects.size() << " objects."; + LOG(INFO) << "Total " << scene->objects.size() << " objects."; device_free(device, dscene, false); diff --git a/intern/cycles/scene/osl.cpp b/intern/cycles/scene/osl.cpp index a73dee11176..e5cf89ba414 100644 --- a/intern/cycles/scene/osl.cpp +++ b/intern/cycles/scene/osl.cpp @@ -385,7 +385,7 @@ void OSLManager::shading_system_init() ss->attribute("max_optix_groupdata_alloc", 2048); } - VLOG_INFO << "Using shader search path: " << shader_path; + LOG(INFO) << "Using shader search path: " << shader_path; /* our own ray types */ static const char *raytypes[] = { @@ -628,7 +628,7 @@ void OSLShaderManager::device_update_specific(Device *device, } }); - VLOG_INFO << "Total " << scene->shaders.size() << " shaders."; + LOG(INFO) << "Total " << scene->shaders.size() << " shaders."; /* setup shader engine */ OSLManager::foreach_osl_device(device, [](Device *, OSLGlobals *og) { diff --git a/intern/cycles/scene/particles.cpp b/intern/cycles/scene/particles.cpp index e681ffecd73..82d5458c711 100644 --- a/intern/cycles/scene/particles.cpp +++ b/intern/cycles/scene/particles.cpp @@ -99,7 +99,7 @@ void ParticleSystemManager::device_update(Device *device, } }); - VLOG_INFO << "Total " << scene->particle_systems.size() << " particle systems."; + LOG(INFO) << "Total " << scene->particle_systems.size() << " particle systems."; device_free(device, dscene); diff --git a/intern/cycles/scene/scene.cpp b/intern/cycles/scene/scene.cpp index 629e10a98f8..d30c9875be4 100644 --- a/intern/cycles/scene/scene.cpp +++ b/intern/cycles/scene/scene.cpp @@ -374,7 +374,7 @@ void Scene::device_update(Device *device_, Progress &progress) const size_t mem_used = util_guarded_get_mem_used(); const size_t mem_peak = util_guarded_get_mem_peak(); - VLOG_INFO << "System memory statistics after full device sync:\n" + LOG(INFO) << "System memory statistics after full device sync:\n" << " Usage: " << string_human_readable_number(mem_used) << " (" << string_human_readable_size(mem_used) << ")\n" << " Peak: " << string_human_readable_number(mem_peak) << " (" @@ -603,32 +603,24 @@ bool Scene::update_camera_resolution(Progress &progress, int width, int height) static void log_kernel_features(const uint features) { - VLOG_INFO << "Requested features:\n"; - VLOG_INFO << "Use BSDF " << string_from_bool(features & KERNEL_FEATURE_NODE_BSDF) << "\n"; - VLOG_INFO << "Use Emission " << string_from_bool(features & KERNEL_FEATURE_NODE_EMISSION) - << "\n"; - VLOG_INFO << "Use Volume " << string_from_bool(features & KERNEL_FEATURE_NODE_VOLUME) << "\n"; - VLOG_INFO << "Use Bump " << string_from_bool(features & KERNEL_FEATURE_NODE_BUMP) << "\n"; - VLOG_INFO << "Use Voronoi " << string_from_bool(features & KERNEL_FEATURE_NODE_VORONOI_EXTRA) - << "\n"; - VLOG_INFO << "Use Shader Raytrace " << string_from_bool(features & KERNEL_FEATURE_NODE_RAYTRACE) - << "\n"; - VLOG_INFO << "Use MNEE " << string_from_bool(features & KERNEL_FEATURE_MNEE) << "\n"; - VLOG_INFO << "Use Transparent " << string_from_bool(features & KERNEL_FEATURE_TRANSPARENT) - << "\n"; - VLOG_INFO << "Use Denoising " << string_from_bool(features & KERNEL_FEATURE_DENOISING) << "\n"; - VLOG_INFO << "Use Path Tracing " << string_from_bool(features & KERNEL_FEATURE_PATH_TRACING) - << "\n"; - VLOG_INFO << "Use Hair " << string_from_bool(features & KERNEL_FEATURE_HAIR) << "\n"; - VLOG_INFO << "Use Pointclouds " << string_from_bool(features & KERNEL_FEATURE_POINTCLOUD) - << "\n"; - VLOG_INFO << "Use Object Motion " << string_from_bool(features & KERNEL_FEATURE_OBJECT_MOTION) - << "\n"; - VLOG_INFO << "Use Baking " << string_from_bool(features & KERNEL_FEATURE_BAKING) << "\n"; - VLOG_INFO << "Use Subsurface " << string_from_bool(features & KERNEL_FEATURE_SUBSURFACE) << "\n"; - VLOG_INFO << "Use Volume " << string_from_bool(features & KERNEL_FEATURE_VOLUME) << "\n"; - VLOG_INFO << "Use Shadow Catcher " << string_from_bool(features & KERNEL_FEATURE_SHADOW_CATCHER) - << "\n"; + LOG(INFO) << "Requested features:"; + LOG(INFO) << "Use BSDF " << string_from_bool(features & KERNEL_FEATURE_NODE_BSDF); + LOG(INFO) << "Use Emission " << string_from_bool(features & KERNEL_FEATURE_NODE_EMISSION); + LOG(INFO) << "Use Volume " << string_from_bool(features & KERNEL_FEATURE_NODE_VOLUME); + LOG(INFO) << "Use Bump " << string_from_bool(features & KERNEL_FEATURE_NODE_BUMP); + LOG(INFO) << "Use Voronoi " << string_from_bool(features & KERNEL_FEATURE_NODE_VORONOI_EXTRA); + LOG(INFO) << "Use Shader Raytrace " << string_from_bool(features & KERNEL_FEATURE_NODE_RAYTRACE); + LOG(INFO) << "Use MNEE " << string_from_bool(features & KERNEL_FEATURE_MNEE); + LOG(INFO) << "Use Transparent " << string_from_bool(features & KERNEL_FEATURE_TRANSPARENT); + LOG(INFO) << "Use Denoising " << string_from_bool(features & KERNEL_FEATURE_DENOISING); + LOG(INFO) << "Use Path Tracing " << string_from_bool(features & KERNEL_FEATURE_PATH_TRACING); + LOG(INFO) << "Use Hair " << string_from_bool(features & KERNEL_FEATURE_HAIR); + LOG(INFO) << "Use Pointclouds " << string_from_bool(features & KERNEL_FEATURE_POINTCLOUD); + LOG(INFO) << "Use Object Motion " << string_from_bool(features & KERNEL_FEATURE_OBJECT_MOTION); + LOG(INFO) << "Use Baking " << string_from_bool(features & KERNEL_FEATURE_BAKING); + LOG(INFO) << "Use Subsurface " << string_from_bool(features & KERNEL_FEATURE_SUBSURFACE); + LOG(INFO) << "Use Volume " << string_from_bool(features & KERNEL_FEATURE_VOLUME); + LOG(INFO) << "Use Shadow Catcher " << string_from_bool(features & KERNEL_FEATURE_SHADOW_CATCHER); } bool Scene::load_kernels(Progress &progress) @@ -683,7 +675,7 @@ int Scene::get_max_closure_count() * closures discarded due to mixing or low weights. We need to limit * to MAX_CLOSURE as this is hardcoded in CPU/mega kernels, and it * avoids excessive memory usage for split kernels. */ - VLOG_WARNING << "Maximum number of closures exceeded: " << max_closure_global << " > " + LOG(WARNING) << "Maximum number of closures exceeded: " << max_closure_global << " > " << MAX_CLOSURE; max_closure_global = MAX_CLOSURE; @@ -734,7 +726,7 @@ int Scene::get_volume_stack_size() const volume_stack_size = min(volume_stack_size, MAX_VOLUME_STACK_SIZE); - VLOG_WORK << "Detected required volume stack size " << volume_stack_size; + LOG(WORK) << "Detected required volume stack size " << volume_stack_size; return volume_stack_size; } diff --git a/intern/cycles/scene/shader.cpp b/intern/cycles/scene/shader.cpp index 666e44865c4..c8204ab1a87 100644 --- a/intern/cycles/scene/shader.cpp +++ b/intern/cycles/scene/shader.cpp @@ -897,7 +897,7 @@ void ShaderManager::init_xyz_transforms() config = OCIO::GetCurrentConfig(); } catch (OCIO::Exception &exception) { - VLOG_WARNING << "OCIO config error: " << exception.what(); + LOG(WARNING) << "OCIO config error: " << exception.what(); return; } diff --git a/intern/cycles/scene/shader_graph.cpp b/intern/cycles/scene/shader_graph.cpp index 3f4e5bf2e4c..242cc1b77ff 100644 --- a/intern/cycles/scene/shader_graph.cpp +++ b/intern/cycles/scene/shader_graph.cpp @@ -663,7 +663,7 @@ void ShaderGraph::deduplicate_nodes() } if (num_deduplicated > 0) { - VLOG_DEBUG << "Deduplicated " << num_deduplicated << " nodes."; + LOG(DEBUG) << "Deduplicated " << num_deduplicated << " nodes."; } } @@ -704,7 +704,7 @@ void ShaderGraph::verify_volume_output() } } if (!has_valid_volume) { - VLOG_DEBUG << "Disconnect meaningless volume output."; + LOG(DEBUG) << "Disconnect meaningless volume output."; disconnect(volume_in->link); } } diff --git a/intern/cycles/scene/svm.cpp b/intern/cycles/scene/svm.cpp index 5a329a793a8..4934b4baeb0 100644 --- a/intern/cycles/scene/svm.cpp +++ b/intern/cycles/scene/svm.cpp @@ -43,7 +43,7 @@ void SVMShaderManager::device_update_shader(Scene *scene, compiler.background = (shader == scene->background->get_shader(scene)); compiler.compile(shader, *svm_nodes, 0, &summary); - VLOG_WORK << "Compilation summary:\n" + LOG(WORK) << "Compilation summary:\n" << "Shader name: " << shader->name << "\n" << summary.full_report(); } @@ -65,7 +65,7 @@ void SVMShaderManager::device_update_specific(Device *device, const int num_shaders = scene->shaders.size(); - VLOG_INFO << "Total " << num_shaders << " shaders."; + LOG(INFO) << "Total " << num_shaders << " shaders."; const double start_time = time_dt(); @@ -136,7 +136,7 @@ void SVMShaderManager::device_update_specific(Device *device, update_flags = UPDATE_NONE; - VLOG_INFO << "Shader manager updated " << num_shaders << " shaders in " << time_dt() - start_time + LOG(INFO) << "Shader manager updated " << num_shaders << " shaders in " << time_dt() - start_time << " seconds."; } diff --git a/intern/cycles/scene/tables.cpp b/intern/cycles/scene/tables.cpp index d88a3f57006..a860b93a005 100644 --- a/intern/cycles/scene/tables.cpp +++ b/intern/cycles/scene/tables.cpp @@ -36,7 +36,7 @@ void LookupTables::device_update(Device * /*unused*/, DeviceScene *dscene, Scene } }); - VLOG_INFO << "Total " << lookup_tables.size() << " lookup tables."; + LOG(INFO) << "Total " << lookup_tables.size() << " lookup tables."; if (!lookup_tables.empty()) { dscene->lookup_table.copy_to_device(); diff --git a/intern/cycles/scene/volume.cpp b/intern/cycles/scene/volume.cpp index f5742f7f0f4..7f7076231a6 100644 --- a/intern/cycles/scene/volume.cpp +++ b/intern/cycles/scene/volume.cpp @@ -755,7 +755,7 @@ void GeometryManager::create_volume_mesh(const Scene *scene, Volume *volume, Pro } /* Print stats. */ - VLOG_WORK << "Memory usage volume mesh: " + LOG(WORK) << "Memory usage volume mesh: " << (vertices.size() * sizeof(float3) + indices.size() * sizeof(int)) / (1024.0 * 1024.0) << "Mb."; diff --git a/intern/cycles/session/session.cpp b/intern/cycles/session/session.cpp index 90914e99041..8aef6e1536a 100644 --- a/intern/cycles/session/session.cpp +++ b/intern/cycles/session/session.cpp @@ -165,12 +165,12 @@ void Session::run_main_render_loop() RenderWork render_work = run_update_for_next_iteration(); if (!render_work) { - if (VLOG_INFO_IS_ON) { + if (LOG_IS_ON(INFO)) { double total_time; double render_time; progress.get_time(total_time, render_time); - VLOG_INFO << "Rendering in main loop is done in " << render_time << " seconds."; - VLOG_INFO << path_trace_->full_report(); + LOG(INFO) << "Rendering in main loop is done in " << render_time << " seconds."; + LOG(INFO) << path_trace_->full_report(); } if (params.background) { diff --git a/intern/cycles/session/tile.cpp b/intern/cycles/session/tile.cpp index 540306d6ad2..1c991db6fd6 100644 --- a/intern/cycles/session/tile.cpp +++ b/intern/cycles/session/tile.cpp @@ -334,7 +334,7 @@ int TileManager::compute_render_tile_size(const int suggested_tile_size) const void TileManager::reset_scheduling(const BufferParams ¶ms, const int2 tile_size) { - VLOG_WORK << "Using tile size of " << tile_size; + LOG(WORK) << "Using tile size of " << tile_size; close_tile_output(); @@ -467,7 +467,7 @@ bool TileManager::open_tile_output() write_state_.num_tiles_written = 0; - VLOG_WORK << "Opened tile file " << write_state_.filename; + LOG(WORK) << "Opened tile file " << write_state_.filename; return true; } @@ -486,7 +486,7 @@ bool TileManager::close_tile_output() return false; } - VLOG_WORK << "Tile output is closed."; + LOG(WORK) << "Tile output is closed."; return true; } @@ -538,7 +538,7 @@ bool TileManager::write_tile(const RenderBuffers &tile_buffers) pixels = pixel_storage.data(); } - VLOG_WORK << "Write tile at " << tile_x << ", " << tile_y; + LOG(WORK) << "Write tile at " << tile_x << ", " << tile_y; /* The image tile sizes in the OpenEXR file are different from the size of our big tiles. The * write_tiles() method expects a contiguous image region that will be split into tiles @@ -570,7 +570,7 @@ bool TileManager::write_tile(const RenderBuffers &tile_buffers) ++write_state_.num_tiles_written; - VLOG_WORK << "Tile written in " << time_dt() - time_start << " seconds."; + LOG(WORK) << "Tile written in " << time_dt() - time_start << " seconds."; return true; } @@ -595,7 +595,7 @@ void TileManager::finish_write_tiles() const int tile_x = tile.x + tile.window_x; const int tile_y = tile.y + tile.window_y; - VLOG_WORK << "Write dummy tile at " << tile_x << ", " << tile_y; + LOG(WORK) << "Write dummy tile at " << tile_x << ", " << tile_y; write_state_.tile_out->write_tiles(tile_x, tile_x + tile.window_width, @@ -614,7 +614,7 @@ void TileManager::finish_write_tiles() full_buffer_written_cb(write_state_.filename); } - VLOG_WORK << "Tile file size is " + LOG(WORK) << "Tile file size is " << string_human_readable_number(path_file_size(write_state_.filename)) << " bytes."; /* Advance the counter upon explicit finish of the file. diff --git a/intern/cycles/subd/osd.cpp b/intern/cycles/subd/osd.cpp index 412e10f0adb..f328cd1a072 100644 --- a/intern/cycles/subd/osd.cpp +++ b/intern/cycles/subd/osd.cpp @@ -244,7 +244,7 @@ void TopologyRefinerFactory::reportInvalidTopology(TopologyError /*err_ OsdMesh const &osd_mesh) { const Mesh &mesh = osd_mesh.mesh; - VLOG_WARNING << "Invalid subdivision topology for '" << mesh.name.c_str() << "': " << msg; + LOG(WARNING) << "Invalid subdivision topology for '" << mesh.name.c_str() << "': " << msg; } } // namespace OpenSubdiv::OPENSUBDIV_VERSION::Far diff --git a/intern/cycles/util/debug.cpp b/intern/cycles/util/debug.cpp index b853214b348..2ea2d5aecad 100644 --- a/intern/cycles/util/debug.cpp +++ b/intern/cycles/util/debug.cpp @@ -22,7 +22,7 @@ void DebugFlags::CPU::reset() do { \ flag = (getenv(env) == nullptr); \ if (!flag) { \ - VLOG_INFO << "Disabling " << STRINGIFY(flag) << " instruction set."; \ + LOG(INFO) << "Disabling " << STRINGIFY(flag) << " instruction set."; \ } \ } while (0) diff --git a/intern/cycles/util/log.h b/intern/cycles/util/log.h index 2006e60b0e9..02a1497f891 100644 --- a/intern/cycles/util/log.h +++ b/intern/cycles/util/log.h @@ -70,28 +70,26 @@ extern LogLevel LOG_LEVEL; #define LOG_STRINGIFY(x) LOG_STRINGIFY_APPEND("", x) #ifdef NDEBUG -# define VLOG_IF(level, condition) \ +# define LOG_IF(level, condition) \ if constexpr (level != DFATAL && level != DERROR && level != DWARNING) \ if (LIKELY(!(level <= LOG_LEVEL && (condition)))) \ ; \ else \ LogMessage(level, __FILE__ ":" LOG_STRINGIFY(__LINE__), __func__).stream() #else -# define VLOG_IF(level, condition) \ +# define LOG_IF(level, condition) \ if (LIKELY(!(level <= LOG_LEVEL && (condition)))) \ ; \ else \ LogMessage(level, __FILE__ ":" LOG_STRINGIFY(__LINE__), __func__).stream() #endif -// TODO: remove distinction -#define VLOG(level) VLOG_IF(level, true) -#define LOG(level) VLOG_IF(level, true) +#define LOG(level) LOG_IF(level, true) -#define VLOG_IS_ON(level) ((level) <= LOG_LEVEL) +#define LOG_IS_ON(level) ((level) <= LOG_LEVEL) -#define CHECK(expression) VLOG_IF(FATAL, !(expression)) -#define CHECK_OP(op, a, b) VLOG_IF(FATAL, !((a)op(b))) +#define CHECK(expression) LOG_IF(FATAL, !(expression)) +#define CHECK_OP(op, a, b) LOG_IF(FATAL, !((a)op(b))) #define CHECK_GE(a, b) CHECK_OP(>=, a, b) #define CHECK_NE(a, b) CHECK_OP(!=, a, b) #define CHECK_EQ(a, b) CHECK_OP(==, a, b) @@ -108,12 +106,12 @@ template T DCheckNotNull(T &&t, const char *expression) return std::forward(t); } -# define DCHECK(expression) VLOG_IF(DFATAL, !(expression)) << LOG_STRINGIFY(expression) << " " +# define DCHECK(expression) LOG_IF(DFATAL, !(expression)) << LOG_STRINGIFY(expression) << " " # define DCHECK_NOTNULL(expression) DCheckNotNull(expression, LOG_STRINGIFY(expression)) # define DCHECK_OP(op, a, b) \ - VLOG_IF(DFATAL, !((a)op(b))) << "Failed " << LOG_STRINGIFY(a) << " (" << a << ") " \ - << LOG_STRINGIFY(op) << " " << LOG_STRINGIFY(b) << " (" << b \ - << ") " + LOG_IF(DFATAL, !((a)op(b))) << "Failed " << LOG_STRINGIFY(a) << " (" << a << ") " \ + << LOG_STRINGIFY(op) << " " << LOG_STRINGIFY(b) << " (" << b \ + << ") " # define DCHECK_GE(a, b) DCHECK_OP(>=, a, b) # define DCHECK_NE(a, b) DCHECK_OP(!=, a, b) # define DCHECK_EQ(a, b) DCHECK_OP(==, a, b) @@ -121,7 +119,7 @@ template T DCheckNotNull(T &&t, const char *expression) # define DCHECK_LT(a, b) DCHECK_OP(<, a, b) # define DCHECK_LE(a, b) DCHECK_OP(<=, a, b) #else -# define LOG_SUPPRESS() VLOG_IF(DEBUG, false) +# define LOG_SUPPRESS() LOG_IF(DEBUG, false) # define DCHECK(expression) LOG_SUPPRESS() # define DCHECK_NOTNULL(expression) (expression) # define DCHECK_GE(a, b) LOG_SUPPRESS() @@ -132,23 +130,6 @@ template T DCheckNotNull(T &&t, const char *expression) # define DCHECK_LE(a, b) LOG_SUPPRESS() #endif -/* Verbose logging categories. */ - -/* Warnings. */ -#define VLOG_WARNING VLOG(WARNING) -/* Info about devices, scene contents and features used. */ -#define VLOG_INFO VLOG(INFO) -#define VLOG_INFO_IS_ON VLOG_IS_ON(INFO) -/* Work being performed and timing/memory stats about that work. */ -#define VLOG_WORK VLOG(WORK) -#define VLOG_WORK_IS_ON VLOG_IS_ON(WORK) -/* Detailed device timing stats. */ -#define VLOG_DEVICE_STATS VLOG(STATS) -#define VLOG_DEVICE_STATS_IS_ON VLOG_IS_ON(STATS) -/* Verbose debug messages. */ -#define VLOG_DEBUG VLOG(DEBUG) -#define VLOG_DEBUG_IS_ON VLOG_IS_ON(DEBUG) - struct int2; struct float3; diff --git a/intern/cycles/util/task.cpp b/intern/cycles/util/task.cpp index 3430a6bc71f..a5328a35d85 100644 --- a/intern/cycles/util/task.cpp +++ b/intern/cycles/util/task.cpp @@ -68,7 +68,7 @@ void TaskScheduler::init(const int num_threads) } if (num_threads > 0) { /* Automatic number of threads. */ - VLOG_INFO << "Overriding number of TBB threads to " << num_threads << "."; + LOG(INFO) << "Overriding number of TBB threads to " << num_threads << "."; global_control = make_unique(tbb::global_control::max_allowed_parallelism, num_threads); active_num_threads = num_threads;