mirror of
https://github.com/libretro/RetroArch
synced 2025-04-11 00:44:20 +00:00
Add warning when FBO textures are resized.
This commit is contained in:
parent
077317d94e
commit
12f1eb926d
12
gfx/gl.c
12
gfx/gl.c
@ -398,8 +398,11 @@ static void gl_compute_fbo_geometry(gl_t *gl, unsigned width, unsigned height,
|
|||||||
unsigned last_height = height;
|
unsigned last_height = height;
|
||||||
unsigned last_max_width = gl->tex_w;
|
unsigned last_max_width = gl->tex_w;
|
||||||
unsigned last_max_height = gl->tex_h;
|
unsigned last_max_height = gl->tex_h;
|
||||||
GLint max_size;
|
|
||||||
|
GLint max_size = 0;
|
||||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_size);
|
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_size);
|
||||||
|
bool size_modified = false;
|
||||||
|
|
||||||
// Calculate viewports for FBOs.
|
// Calculate viewports for FBOs.
|
||||||
for (int i = 0; i < gl->fbo_pass; i++)
|
for (int i = 0; i < gl->fbo_pass; i++)
|
||||||
{
|
{
|
||||||
@ -443,24 +446,31 @@ static void gl_compute_fbo_geometry(gl_t *gl, unsigned width, unsigned height,
|
|||||||
|
|
||||||
if (gl->fbo_rect[i].img_width > max_size)
|
if (gl->fbo_rect[i].img_width > max_size)
|
||||||
{
|
{
|
||||||
|
size_modified = true;
|
||||||
gl->fbo_rect[i].img_width = max_size;
|
gl->fbo_rect[i].img_width = max_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gl->fbo_rect[i].img_height > max_size)
|
if (gl->fbo_rect[i].img_height > max_size)
|
||||||
{
|
{
|
||||||
|
size_modified = true;
|
||||||
gl->fbo_rect[i].img_height = max_size;
|
gl->fbo_rect[i].img_height = max_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gl->fbo_rect[i].max_img_width > max_size)
|
if (gl->fbo_rect[i].max_img_width > max_size)
|
||||||
{
|
{
|
||||||
|
size_modified = true;
|
||||||
gl->fbo_rect[i].max_img_width = max_size;
|
gl->fbo_rect[i].max_img_width = max_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gl->fbo_rect[i].max_img_height > max_size)
|
if (gl->fbo_rect[i].max_img_height > max_size)
|
||||||
{
|
{
|
||||||
|
size_modified = true;
|
||||||
gl->fbo_rect[i].max_img_height = max_size;
|
gl->fbo_rect[i].max_img_height = max_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (size_modified)
|
||||||
|
RARCH_WARN("FBO textures exceeded maximum size of GPU (%ux%u). Resizing to fit.\n", max_size, max_size);
|
||||||
|
|
||||||
last_width = gl->fbo_rect[i].img_width;
|
last_width = gl->fbo_rect[i].img_width;
|
||||||
last_height = gl->fbo_rect[i].img_height;
|
last_height = gl->fbo_rect[i].img_height;
|
||||||
last_max_width = gl->fbo_rect[i].max_img_width;
|
last_max_width = gl->fbo_rect[i].max_img_width;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user