Skip to content

Commit

Permalink
Eat GL errors
Browse files Browse the repository at this point in the history
  • Loading branch information
maluoi committed Oct 22, 2023
1 parent 80bfde0 commit 5d69184
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/sk_gpu_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1993,6 +1993,13 @@ bool skg_tex_get_mip_contents(skg_tex_t *tex, int32_t mip_level, void *ref_data,
///////////////////////////////////////////

bool skg_tex_get_mip_contents_arr(skg_tex_t *tex, int32_t mip_level, int32_t arr_index, void *ref_data, size_t data_size) {
uint32_t result = glGetError();
while (result != 0) {
char text[128];
snprintf(text, 128, "skg_tex_get_mip_contents_arr: eating a gl error from somewhere else: %d", result);
skg_log(skg_log_warning, text);
}

// Double check on mips first
int32_t mip_levels = tex->mips == skg_mip_generate ? (int32_t)skg_mip_count(tex->width, tex->height) : 1;
if (mip_level != 0) {
Expand Down Expand Up @@ -2046,7 +2053,7 @@ bool skg_tex_get_mip_contents_arr(skg_tex_t *tex, int32_t mip_level, int32_t arr
}
#endif

uint32_t result = glGetError();
result = glGetError();
if (result != 0) {
char text[128];
snprintf(text, 128, "skg_tex_get_mip_contents_arr error: %d", result);
Expand Down

0 comments on commit 5d69184

Please sign in to comment.