OpenGL: Only invalidate texture if dimensions change (fixes #1612)
Vicki Pfau vi@endrift.com
Wed, 08 Jan 2020 18:49:09 -0800
3 files changed,
12 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -99,7 +99,7 @@ Other fixes:
- 3DS: Fix screen darkening (fixes mgba.io/i/1562) - Core: Fix uninitialized memory issues with graphics caches - Core: Return null for out of bounds cached tile VRAM querying - - Vita: Fix analog controls (fixes mgba.io/i/1554) + - OpenGL: Only invalidate texture if dimensions change (fixes mgba.io/i/1612) - Qt: Fix fast forward mute being reset (fixes mgba.io/i/1574) - Qt: Fix scrollbar arrows in memory view (fixes mgba.io/i/1558) - Qt: Fix several cases where shader selections don't get saved@@ -108,6 +108,7 @@ - Qt: Fix "restart needed" dialog after first config (fixes mgba.io/i/1601)
- Qt: Fix undesired screen filtering when paused (fixes mgba.io/i/1602) - Qt: Fix sprite view using wrong base address (fixes mgba.io/i/1603) - Qt: Fix inability to clear default keybindings + - Vita: Fix analog controls (fixes mgba.io/i/1554) Misc: - GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580) - GBA Audio: Redo channel 4 batching for GBA only
M
src/platform/opengl/gl.c
→
src/platform/opengl/gl.c
@@ -24,6 +24,8 @@
static void mGLContextInit(struct VideoBackend* v, WHandle handle) { UNUSED(handle); struct mGLContext* context = (struct mGLContext*) v; + v->width = 1; + v->height = 1; glGenTextures(2, context->tex); glBindTexture(GL_TEXTURE_2D, context->tex[0]); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);@@ -42,6 +44,9 @@ }
static void mGLContextSetDimensions(struct VideoBackend* v, unsigned width, unsigned height) { struct mGLContext* context = (struct mGLContext*) v; + if (width == v->width && height == v->height) { + return; + } v->width = width; v->height = height;
M
src/platform/opengl/gles2.c
→
src/platform/opengl/gles2.c
@@ -98,6 +98,8 @@
static void mGLES2ContextInit(struct VideoBackend* v, WHandle handle) { UNUSED(handle); struct mGLES2Context* context = (struct mGLES2Context*) v; + v->width = 1; + v->height = 1; glGenTextures(1, &context->tex); glBindTexture(GL_TEXTURE_2D, context->tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);@@ -172,6 +174,9 @@ }
static void mGLES2ContextSetDimensions(struct VideoBackend* v, unsigned width, unsigned height) { struct mGLES2Context* context = (struct mGLES2Context*) v; + if (width == v->width && height == v->height) { + return; + } v->width = width; v->height = height;