Skip to content

Commit

Permalink
Image Cache - disable verbose logging
Browse files Browse the repository at this point in the history
The bug has been fixed that required looking into the details of how the
image cache worked.
  • Loading branch information
david-cattermole committed Sep 30, 2024
1 parent 29fd63b commit 66889b5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
48 changes: 24 additions & 24 deletions src/mmSolver/image/ImageCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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: "
Expand All @@ -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);
Expand All @@ -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: "
Expand All @@ -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);
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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: ");

Expand Down Expand Up @@ -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: ");

Expand Down Expand Up @@ -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: "
Expand Down Expand Up @@ -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: "
Expand Down Expand Up @@ -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=\""
Expand All @@ -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);
Expand All @@ -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=\""
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
16 changes: 8 additions & 8 deletions src/mmSolver/image/ImageCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,41 +172,41 @@ 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;
}

// 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;
}

// 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();
Expand All @@ -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());
Expand Down

0 comments on commit 66889b5

Please sign in to comment.