Skip to content

Commit

Permalink
Fix texture storage not assigning default scale
Browse files Browse the repository at this point in the history
• Print errors if an invalid value is passed
  • Loading branch information
Repiteo committed Oct 12, 2023
1 parent b137180 commit 9ee41c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion drivers/gles3/storage/texture_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2314,7 +2314,9 @@ Rect2i TextureStorage::_render_target_get_sdf_rect(const RenderTarget *rt) const
scale = 200;
} break;
default: {
}
ERR_PRINT("Invalid viewport SDF oversize, defaulting to 100%.");
scale = 100;
} break;
}

margin = (rt->size * scale / 100) - rt->size;
Expand Down Expand Up @@ -2391,6 +2393,7 @@ void TextureStorage::_render_target_allocate_sdf(RenderTarget *rt) {
scale = 25;
} break;
default: {
ERR_PRINT("Invalid viewport SDF scale, defaulting to 100%.");
scale = 100;
} break;
}
Expand Down
5 changes: 4 additions & 1 deletion servers/rendering/renderer_rd/storage_rd/texture_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3511,7 +3511,9 @@ Rect2i TextureStorage::_render_target_get_sdf_rect(const RenderTarget *rt) const
scale = 200;
} break;
default: {
}
ERR_PRINT("Invalid viewport SDF oversize, defaulting to 100%.");
scale = 100;
} break;
}

margin = (rt->size * scale / 100) - rt->size;
Expand Down Expand Up @@ -3603,6 +3605,7 @@ void TextureStorage::_render_target_allocate_sdf(RenderTarget *rt) {
scale = 25;
} break;
default: {
ERR_PRINT("Invalid viewport SDF scale, defaulting to 100%.");
scale = 100;
} break;
}
Expand Down

0 comments on commit 9ee41c7

Please sign in to comment.