diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index a1d2f5567e..90fcca305a 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -2783,9 +2783,9 @@ static bool gl_overlay_load(void *data, * sizeof(uint32_t)); gl_load_texture_data(gl->overlay_tex[i], - &images[i], RARCH_WRAP_EDGE, TEXTURE_FILTER_LINEAR, - alignment); + alignment, + images[i].width, images[i].height, images[i].pixels); /* Default. Stretch to whole screen. */ gl_overlay_tex_geom(gl, i, 0, 0, 1, 1); diff --git a/gfx/gl_common.c b/gfx/gl_common.c index 0c632a2778..ab6e680b4e 100644 --- a/gfx/gl_common.c +++ b/gfx/gl_common.c @@ -17,10 +17,11 @@ #include "gl_common.h" void gl_load_texture_data(GLuint id, - const struct texture_image *img, enum gfx_wrap_type wrap_type, enum texture_filter_type filter_type, - unsigned alignment) + unsigned alignment, + unsigned width, unsigned height, + const void *frame) { GLint mag_filter, min_filter; GLenum wrap; @@ -69,9 +70,9 @@ void gl_load_texture_data(GLuint id, glTexImage2D(GL_TEXTURE_2D, 0, driver.gfx_use_rgba ? GL_RGBA : RARCH_GL_INTERNAL_FORMAT32, - img->width, img->height, 0, + width, height, 0, driver.gfx_use_rgba ? GL_RGBA : RARCH_GL_TEXTURE_TYPE32, - RARCH_GL_FORMAT32, img->pixels); + RARCH_GL_FORMAT32, frame); if (want_mipmap) glGenerateMipmap(GL_TEXTURE_2D); @@ -117,9 +118,11 @@ bool gl_load_luts(const struct video_shader *generic_shader, filter_type = TEXTURE_FILTER_MIPMAP_LINEAR; } - gl_load_texture_data(textures_lut[i], &img, + gl_load_texture_data(textures_lut[i], generic_shader->lut[i].wrap, - filter_type, 4); + filter_type, 4, + img.width, img.height, + img.pixels); texture_image_free(&img); } diff --git a/gfx/gl_common.h b/gfx/gl_common.h index 78efa3dc1e..3f8f4399e2 100644 --- a/gfx/gl_common.h +++ b/gfx/gl_common.h @@ -404,10 +404,11 @@ void gl_set_viewport(gl_t *gl, unsigned width, unsigned height, bool force_full, bool allow_rotate); void gl_load_texture_data(GLuint id, - const struct texture_image *img, enum gfx_wrap_type wrap_type, enum texture_filter_type filter_type, - unsigned alignment); + unsigned alignment, + unsigned width, unsigned height, + const void *frame); bool gl_load_luts(const struct video_shader *generic_shader, GLuint *lut_textures); diff --git a/menu/menu_texture.c b/menu/menu_texture.c index 1b020c6f66..24268e0ffa 100644 --- a/menu/menu_texture.c +++ b/menu/menu_texture.c @@ -30,7 +30,8 @@ static void menu_texture_png_load_gl(struct texture_image *ti, /* Generate the OpenGL texture object */ glGenTextures(1, id); gl_load_texture_data((GLuint)*id, - ti, RARCH_WRAP_EDGE, filter_type, 4 /* TODO/FIXME - dehardcode */); + RARCH_WRAP_EDGE, filter_type, 4 /* TODO/FIXME - dehardcode */, + ti->width, ti->height, ti->pixels); } #endif