EEVEE-Next: Concatenate info strings

Pull Request: https://projects.blender.org/blender/blender/pulls/118674
This commit is contained in:
Miguel Pozo
2024-02-23 18:39:53 +01:00
parent ae3220e62b
commit e842e9fd4c
5 changed files with 28 additions and 27 deletions

View File

@@ -66,7 +66,7 @@ void Film::init_aovs()
}
if (aovs.size() > AOV_MAX) {
inst_.info = "Error: Too many AOVs";
inst_.info += "Error: Too many AOVs\n";
return;
}

View File

@@ -111,10 +111,10 @@ void HiZBuffer::update()
void HiZBuffer::debug_draw(View &view, GPUFrameBuffer *view_fb)
{
if (inst_.debug_mode == eDebugMode::DEBUG_HIZ_VALIDATION) {
inst_.info =
inst_.info +=
"Debug Mode: HiZ Validation\n"
" - Red: pixel in front of HiZ tile value.\n"
" - Blue: No error.";
" - Blue: No error.\n";
inst_.hiz_buffer.update();
GPU_framebuffer_bind(view_fb);
inst_.manager->submit(debug_draw_ps_, view);

View File

@@ -75,7 +75,7 @@ void VolumeProbeModule::init()
}
if (irradiance_atlas_tx_.is_valid() == false) {
inst_.info = "Irradiance Atlas texture could not be created";
inst_.info += "Irradiance Atlas texture could not be created\n";
}
}
@@ -127,7 +127,7 @@ void VolumeProbeModule::set_view(View & /*view*/)
int3 grid_size = int3(cache->size);
if (grid_size.x <= 0 || grid_size.y <= 0 || grid_size.z <= 0) {
inst_.info = "Error: Malformed irradiance grid data";
inst_.info += "Error: Malformed irradiance grid data\n";
continue;
}
@@ -135,9 +135,9 @@ void VolumeProbeModule::set_view(View & /*view*/)
/* Note that we reserve 1 slot for the world irradiance. */
if (grid_loaded.size() >= IRRADIANCE_GRID_MAX - 1) {
inst_.info = "Error: Too many irradiance grids in the scene";
inst_.info += "Error: Too many irradiance grids in the scene\n";
/* TODO frustum cull and only load visible grids. */
// inst_.info = "Error: Too many grid visible";
// inst_.info += "Error: Too many grid visible\n";
continue;
}
@@ -148,7 +148,7 @@ void VolumeProbeModule::set_view(View & /*view*/)
grid.bricks = bricks_alloc(brick_len);
if (grid.bricks.is_empty()) {
inst_.info = "Error: Irradiance grid allocation failed";
inst_.info += "Error: Irradiance grid allocation failed\n";
continue;
}
grid.do_update = true;
@@ -165,7 +165,7 @@ void VolumeProbeModule::set_view(View & /*view*/)
bricks_infos_buf_.extend(grid.bricks);
if (grid_size.x <= 0 || grid_size.y <= 0 || grid_size.z <= 0) {
inst_.info = "Error: Malformed irradiance grid data";
inst_.info += "Error: Malformed irradiance grid data\n";
continue;
}
@@ -307,7 +307,7 @@ void VolumeProbeModule::set_view(View & /*view*/)
}
if (irradiance_a_tx.is_valid() == false) {
inst_.info = "Error: Could not allocate irradiance staging texture";
inst_.info += "Error: Could not allocate irradiance staging texture\n";
/* Avoid undefined behavior with uninitialized values. Still load a clear texture. */
float4 zero(0.0f);
irradiance_a_tx.ensure_3d(GPU_RGB16F, int3(1), usage, zero);
@@ -402,22 +402,22 @@ void VolumeProbeModule::debug_pass_draw(View &view, GPUFrameBuffer *view_fb)
{
switch (inst_.debug_mode) {
case eDebugMode::DEBUG_IRRADIANCE_CACHE_SURFELS_NORMAL:
inst_.info = "Debug Mode: Surfels Normal";
inst_.info += "Debug Mode: Surfels Normal\n";
break;
case eDebugMode::DEBUG_IRRADIANCE_CACHE_SURFELS_CLUSTER:
inst_.info = "Debug Mode: Surfels Cluster";
inst_.info += "Debug Mode: Surfels Cluster\n";
break;
case eDebugMode::DEBUG_IRRADIANCE_CACHE_SURFELS_IRRADIANCE:
inst_.info = "Debug Mode: Surfels Irradiance";
inst_.info += "Debug Mode: Surfels Irradiance\n";
break;
case eDebugMode::DEBUG_IRRADIANCE_CACHE_SURFELS_VISIBILITY:
inst_.info = "Debug Mode: Surfels Visibility";
inst_.info += "Debug Mode: Surfels Visibility\n";
break;
case eDebugMode::DEBUG_IRRADIANCE_CACHE_VALIDITY:
inst_.info = "Debug Mode: Irradiance Validity";
inst_.info += "Debug Mode: Irradiance Validity\n";
break;
case eDebugMode::DEBUG_IRRADIANCE_CACHE_VIRTUAL_OFFSET:
inst_.info = "Debug Mode: Virtual Offset";
inst_.info += "Debug Mode: Virtual Offset\n";
break;
default:
/* Nothing to display. */
@@ -866,7 +866,7 @@ void IrradianceBake::surfels_create(const Object &probe_object)
!irradiance_L1_b_tx_.is_valid() || !irradiance_L1_c_tx_.is_valid() ||
!validity_tx_.is_valid() || !virtual_offset_tx_.is_valid())
{
inst_.info = "Error: Not enough memory to bake " + std::string(probe_object.id.name) + ".";
inst_.info += "Error: Not enough memory to bake " + std::string(probe_object.id.name) + ".\n";
do_break_ = true;
return;
}
@@ -972,7 +972,8 @@ void IrradianceBake::surfels_create(const Object &probe_object)
if (required_mem > max_size) {
capture_info_buf_.surfel_len = 0u;
capture_info_buf_.push_update();
inst_.info = "Error: Not enough memory to bake " + std::string(probe_object.id.name) + ".";
inst_.info += "Error: Not enough memory to bake " + std::string(probe_object.id.name) +
".\n";
do_break_ = true;
return;
}

View File

@@ -338,7 +338,7 @@ void LightModule::end_sync()
if (sun_lights_len_ + local_lights_len_ > CULLING_MAX_ITEM) {
sun_lights_len_ = min_ii(sun_lights_len_, CULLING_MAX_ITEM);
local_lights_len_ = min_ii(local_lights_len_, CULLING_MAX_ITEM - sun_lights_len_);
inst_.info = "Error: Too many lights in the scene.";
inst_.info += "Error: Too many lights in the scene.\n";
}
lights_len_ = sun_lights_len_ + local_lights_len_;
@@ -471,7 +471,7 @@ void LightModule::set_view(View &view, const int2 extent)
void LightModule::debug_draw(View &view, GPUFrameBuffer *view_fb)
{
if (inst_.debug_mode == eDebugMode::DEBUG_LIGHT_CULLING) {
inst_.info = "Debug Mode: Light Culling Validation";
inst_.info += "Debug Mode: Light Culling Validation\n";
inst_.hiz_buffer.update();
GPU_framebuffer_bind(view_fb);
inst_.manager->submit(debug_draw_ps_, view);

View File

@@ -773,7 +773,7 @@ void ShadowModule::init()
/* Make allocation safe. Avoids crash later on. */
if (!atlas_tx_.is_valid()) {
atlas_tx_.ensure_2d_array(ShadowModule::atlas_type, int2(1), 1);
inst_.info = "Error: Could not allocate shadow atlas. Most likely out of GPU memory.";
inst_.info += "Error: Could not allocate shadow atlas. Most likely out of GPU memory.\n";
}
/* Read end of the swap-chain to avoid stall. */
@@ -794,12 +794,12 @@ void ShadowModule::init()
std::stringstream ss;
ss << "Error: Shadow buffer full, may result in missing shadows and lower performance. ("
<< stats.page_used_count << " / " << shadow_page_len_ << ")\n";
inst_.info = ss.str();
inst_.info += ss.str();
}
if (stats.view_needed_count > SHADOW_VIEW_MAX && enabled_) {
std::stringstream ss;
ss << "Error: Too many shadow updates, some shadow might be incorrect.\n";
inst_.info = ss.str();
inst_.info += ss.str();
}
}
@@ -1420,16 +1420,16 @@ void ShadowModule::debug_draw(View &view, GPUFrameBuffer *view_fb)
switch (inst_.debug_mode) {
case DEBUG_SHADOW_TILEMAPS:
inst_.info = "Debug Mode: Shadow Tilemap\n";
inst_.info += "Debug Mode: Shadow Tilemap\n";
break;
case DEBUG_SHADOW_VALUES:
inst_.info = "Debug Mode: Shadow Values\n";
inst_.info += "Debug Mode: Shadow Values\n";
break;
case DEBUG_SHADOW_TILE_RANDOM_COLOR:
inst_.info = "Debug Mode: Shadow Tile Random Color\n";
inst_.info += "Debug Mode: Shadow Tile Random Color\n";
break;
case DEBUG_SHADOW_TILEMAP_RANDOM_COLOR:
inst_.info = "Debug Mode: Shadow Tilemap Random Color\n";
inst_.info += "Debug Mode: Shadow Tilemap Random Color\n";
break;
default:
break;