[client] egl: dont re-setup the fps texture on each update

This commit is contained in:
Geoffrey McRae 2020-05-29 16:47:21 +10:00
parent 28c93ef5ac
commit e8c949c1e7
2 changed files with 19 additions and 13 deletions

View File

@ -1 +1 @@
B2-rc2-5-gd7921c5d5f+1 B2-rc2-6-g28c93ef5ac+1

View File

@ -44,6 +44,7 @@ struct EGL_FPS
EGL_Model * model; EGL_Model * model;
bool ready; bool ready;
int iwidth, iheight;
float width, height; float width, height;
// uniforms // uniforms
@ -144,6 +145,13 @@ void egl_fps_update(EGL_FPS * fps, const float avgFPS, const float renderFPS)
return; return;
} }
if (fps->iwidth != bmp->width || fps->iheight != bmp->height)
{
fps->iwidth = bmp->width;
fps->iheight = bmp->height;
fps->width = (float)bmp->width;
fps->height = (float)bmp->height;
egl_texture_setup( egl_texture_setup(
fps->texture, fps->texture,
EGL_PF_BGRA, EGL_PF_BGRA,
@ -152,6 +160,7 @@ void egl_fps_update(EGL_FPS * fps, const float avgFPS, const float renderFPS)
bmp->width * bmp->bpp, bmp->width * bmp->bpp,
false false
); );
}
egl_texture_update egl_texture_update
( (
@ -159,10 +168,7 @@ void egl_fps_update(EGL_FPS * fps, const float avgFPS, const float renderFPS)
bmp->pixels bmp->pixels
); );
fps->width = bmp->width;
fps->height = bmp->height;
fps->ready = true; fps->ready = true;
fps->font->release(fps->fontObj, bmp); fps->font->release(fps->fontObj, bmp);
} }