From 66889b5154ea9c8f9be220c96144a00147c2c2e9 Mon Sep 17 00:00:00 2001 From: David Cattermole Date: Tue, 1 Oct 2024 00:31:17 +1000 Subject: [PATCH] Image Cache - disable verbose logging The bug has been fixed that required looking into the details of how the image cache worked. --- src/mmSolver/image/ImageCache.cpp | 48 +++++++++++++++---------------- src/mmSolver/image/ImageCache.h | 16 +++++------ 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/mmSolver/image/ImageCache.cpp b/src/mmSolver/image/ImageCache.cpp index 8f1c0993..b86c2905 100644 --- a/src/mmSolver/image/ImageCache.cpp +++ b/src/mmSolver/image/ImageCache.cpp @@ -64,7 +64,7 @@ MTexture *read_texture_image_file(MHWRender::MTextureManager *texture_manager, const bool do_texture_update) { assert(texture_manager != nullptr); - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache: read_texture_image_file:" << " file_path=" << file_path.asChar()); @@ -195,7 +195,7 @@ MTexture *read_texture_image_file(MHWRender::MTextureManager *texture_manager, void ImageCache::set_gpu_capacity_bytes( MHWRender::MTextureManager *texture_manager, const size_t value) { - const bool verbose = true; + const bool verbose = false; m_gpu_capacity_bytes = value; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::set_gpu_capacity_bytes: " << "m_gpu_capacity_bytes=" << m_gpu_capacity_bytes); @@ -218,7 +218,7 @@ void ImageCache::set_gpu_capacity_bytes( } void ImageCache::set_cpu_capacity_bytes(const size_t value) { - const bool verbose = true; + const bool verbose = false; m_cpu_capacity_bytes = value; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::set_cpu_capacity_bytes: " << "m_cpu_capacity_bytes=" << m_cpu_capacity_bytes); @@ -301,7 +301,7 @@ void ImageCache::print_cache_brief() const { } void ImageCache::gpu_group_names(GPUVectorString &out_group_names) const { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::gpu_group_names: "); out_group_names.clear(); @@ -318,7 +318,7 @@ void ImageCache::gpu_group_names(GPUVectorString &out_group_names) const { } void ImageCache::cpu_group_names(CPUVectorString &out_group_names) const { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::cpu_group_names: "); out_group_names.clear(); @@ -444,7 +444,7 @@ bool ImageCache::cpu_insert_group(const CPUCacheString &group_name, static void update_texture(MTexture *texture, const ImageCache::CPUCacheValue &image_pixel_data) { - const bool verbose = true; + const bool verbose = false; // No need for MIP-maps. const bool generate_mip_maps = false; @@ -470,7 +470,7 @@ ImageCache::GPUCacheValue ImageCache::gpu_insert_item( const ImageCache::CPUCacheValue &image_pixel_data) { assert(texture_manager != nullptr); assert(image_pixel_data.is_valid()); - const bool verbose = true; + const bool verbose = false; const GPUGroupKey item_key = mmsolver::hash::make_hash(file_path); const GPUGroupKey group_key = mmsolver::hash::make_hash(group_name); @@ -553,7 +553,7 @@ ImageCache::GPUCacheValue ImageCache::gpu_insert_item( bool ImageCache::cpu_insert_item(const CPUCacheString &group_name, const CPUCacheString &file_path, const CPUCacheValue &image_pixel_data) { - const bool verbose = true; + const bool verbose = false; const CPUGroupKey item_key = mmsolver::hash::make_hash(file_path); const CPUGroupKey group_key = mmsolver::hash::make_hash(group_name); @@ -602,7 +602,7 @@ bool ImageCache::cpu_insert_item(const CPUCacheString &group_name, ImageCache::GPUCacheValue ImageCache::gpu_find_item( const GPUCacheString &file_path) { - const bool verbose = true; + const bool verbose = false; const GPUGroupKey item_key = mmsolver::hash::make_hash(file_path); MMSOLVER_MAYA_VRB("mmsolver::ImageCache::gpu_find_item: " @@ -613,7 +613,7 @@ ImageCache::GPUCacheValue ImageCache::gpu_find_item( ImageCache::GPUCacheValue ImageCache::gpu_find_item( const GPUCacheKey item_key) { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::gpu_find_item: " << "item_key=" << item_key); @@ -631,7 +631,7 @@ ImageCache::GPUCacheValue ImageCache::gpu_find_item( ImageCache::CPUCacheValue ImageCache::cpu_find_item( const CPUCacheString &file_path) { - const bool verbose = true; + const bool verbose = false; const CPUGroupKey item_key = mmsolver::hash::make_hash(file_path); MMSOLVER_MAYA_VRB("mmsolver::ImageCache::cpu_find_item: " @@ -642,7 +642,7 @@ ImageCache::CPUCacheValue ImageCache::cpu_find_item( ImageCache::CPUCacheValue ImageCache::cpu_find_item( const CPUCacheKey item_key) { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::cpu_find_item: " << "item_key=" << item_key); @@ -660,7 +660,7 @@ ImageCache::CPUCacheValue ImageCache::cpu_find_item( CacheEvictionResult ImageCache::gpu_evict_one_item( MHWRender::MTextureManager *texture_manager) { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::gpu_evict_one_item: "); MMSOLVER_MAYA_VRB( @@ -701,7 +701,7 @@ CacheEvictionResult ImageCache::gpu_evict_one_item( } CacheEvictionResult ImageCache::cpu_evict_one_item() { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::cpu_evict_one_item: "); MMSOLVER_MAYA_VRB( @@ -743,7 +743,7 @@ CacheEvictionResult ImageCache::cpu_evict_one_item() { CacheEvictionResult ImageCache::gpu_evict_enough_for_new_item( MHWRender::MTextureManager *texture_manager, const size_t new_memory_chunk_size) { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::gpu_evict_enough_for_new_item: "); @@ -781,7 +781,7 @@ CacheEvictionResult ImageCache::gpu_evict_enough_for_new_item( CacheEvictionResult ImageCache::cpu_evict_enough_for_new_item( const size_t new_memory_chunk_size) { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::cpu_evict_enough_for_new_item: "); @@ -818,7 +818,7 @@ CacheEvictionResult ImageCache::cpu_evict_enough_for_new_item( } size_t ImageCache::gpu_remove_item_from_group(const GPUCacheKey item_key) { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB( "mmsolver::ImageCache::gpu_remove_item_from_group: " @@ -869,7 +869,7 @@ size_t ImageCache::gpu_remove_item_from_group(const GPUCacheKey item_key) { } size_t ImageCache::cpu_remove_item_from_group(const CPUCacheKey item_key) { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB( "mmsolver::ImageCache::cpu_remove_item_from_group: " @@ -921,7 +921,7 @@ size_t ImageCache::cpu_remove_item_from_group(const CPUCacheKey item_key) { bool ImageCache::gpu_erase_item(MHWRender::MTextureManager *texture_manager, const GPUCacheString &file_path) { - const bool verbose = true; + const bool verbose = false; const GPUGroupKey item_key = mmsolver::hash::make_hash(file_path); MMSOLVER_MAYA_VRB("mmsolver::ImageCache::gpu_erase_item: " << "item_key=" << item_key << "file_path=\"" @@ -931,7 +931,7 @@ bool ImageCache::gpu_erase_item(MHWRender::MTextureManager *texture_manager, bool ImageCache::gpu_erase_item(MHWRender::MTextureManager *texture_manager, const GPUCacheKey item_key) { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::gpu_erase_item: " << "item_key=" << item_key); @@ -955,7 +955,7 @@ bool ImageCache::gpu_erase_item(MHWRender::MTextureManager *texture_manager, } bool ImageCache::cpu_erase_item(const CPUCacheString &file_path) { - const bool verbose = true; + const bool verbose = false; const CPUGroupKey item_key = mmsolver::hash::make_hash(file_path); MMSOLVER_MAYA_VRB("mmsolver::ImageCache::cpu_erase_item: " << "item_key=" << item_key << "file_path=\"" @@ -964,7 +964,7 @@ bool ImageCache::cpu_erase_item(const CPUCacheString &file_path) { } bool ImageCache::cpu_erase_item(const CPUCacheKey item_key) { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::cpu_erase_item: " << "item_key=" << item_key); @@ -990,7 +990,7 @@ bool ImageCache::cpu_erase_item(const CPUCacheKey item_key) { size_t ImageCache::gpu_erase_group_items( MHWRender::MTextureManager *texture_manager, const GPUCacheString &group_name) { - const bool verbose = true; + const bool verbose = false; if (verbose) { const GPUGroupKey group_key = mmsolver::hash::make_hash(group_name); @@ -1021,7 +1021,7 @@ size_t ImageCache::gpu_erase_group_items( } size_t ImageCache::cpu_erase_group_items(const CPUCacheString &group_name) { - const bool verbose = true; + const bool verbose = false; if (verbose) { const CPUGroupKey group_key = mmsolver::hash::make_hash(group_name); diff --git a/src/mmSolver/image/ImageCache.h b/src/mmSolver/image/ImageCache.h index b44d517c..107caf20 100644 --- a/src/mmSolver/image/ImageCache.h +++ b/src/mmSolver/image/ImageCache.h @@ -172,13 +172,13 @@ struct ImageCache { public: // Get the capacity of the cache. size_t get_gpu_capacity_bytes() const { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::get_gpu_capacity_bytes: " << "m_gpu_capacity_bytes=" << m_gpu_capacity_bytes); return m_gpu_capacity_bytes; } size_t get_cpu_capacity_bytes() const { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::get_cpu_capacity_bytes: " << "m_cpu_capacity_bytes=" << m_cpu_capacity_bytes); return m_cpu_capacity_bytes; @@ -186,13 +186,13 @@ struct ImageCache { // Get amount of bytes used by the cache. size_t get_gpu_used_bytes() const { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::get_gpu_used_bytes: " << "m_gpu_used_bytes=" << m_gpu_used_bytes); return m_gpu_used_bytes; } size_t get_cpu_used_bytes() const { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::get_cpu_used_bytes: " << "m_cpu_used_bytes=" << m_cpu_used_bytes); return m_cpu_used_bytes; @@ -200,13 +200,13 @@ struct ImageCache { // Get the number of items in the cache. size_t get_gpu_item_count() const { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::get_gpu_item_count: " << "m_gpu_item_map.size()=" << m_gpu_item_map.size()); return m_gpu_item_map.size(); } size_t get_cpu_item_count() const { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::get_cpu_item_count: " << "m_cpu_item_map.size()=" << m_cpu_item_map.size()); return m_cpu_item_map.size(); @@ -223,14 +223,14 @@ struct ImageCache { // Get the number of groups in the cache. size_t get_gpu_group_count() const { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::get_gpu_group_count: " << "m_gpu_group_map.size()=" << m_gpu_group_map.size()); return m_gpu_group_map.size(); } size_t get_cpu_group_count() const { - const bool verbose = true; + const bool verbose = false; MMSOLVER_MAYA_VRB("mmsolver::ImageCache::get_cpu_group_count: " << "m_cpu_group_map.size()=" << m_cpu_group_map.size());