Skip to content

Commit

Permalink
Fix build warning with memset value being too large
Browse files Browse the repository at this point in the history
Should resolve issue #83342
  • Loading branch information
griffinkh committed Jan 8, 2024
1 parent c8c483c commit b97cb5e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gles3/storage/texture_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,7 @@ void TextureStorage::update_texture_atlas() {
//generate atlas
Vector<TextureAtlas::SortItem> itemsv;
itemsv.resize(texture_atlas.textures.size());
int base_size = 8;
uint32_t base_size = 8;

int idx = 0;

Expand All @@ -1488,7 +1488,7 @@ void TextureStorage::update_texture_atlas() {
si.size.height = (src_tex->height / border) + 1;
si.pixel_size = Size2i(src_tex->width, src_tex->height);

if (base_size < si.size.width) {
if (base_size < (uint32_t)si.size.width) {
base_size = nearest_power_of_2_templated(si.size.width);
}

Expand Down Expand Up @@ -1519,7 +1519,7 @@ void TextureStorage::update_texture_atlas() {
TextureAtlas::SortItem &si = items[i];
int best_idx = -1;
int best_height = 0x7FFFFFFF;
for (int j = 0; j <= base_size - si.size.width; j++) {
for (uint32_t j = 0; j <= base_size - si.size.width; j++) {
int height = 0;
for (int k = 0; k < si.size.width; k++) {
int h = v_offsets[k + j];
Expand Down Expand Up @@ -1550,7 +1550,7 @@ void TextureStorage::update_texture_atlas() {
}
}

if (max_height <= base_size * 2) {
if ((uint32_t)max_height <= base_size * 2) {
atlas_height = max_height;
break; //good ratio, break;
}
Expand Down

0 comments on commit b97cb5e

Please sign in to comment.