mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Merge pull request #12644 from jdgleaver/fpu-fix
(Menu+Widgets) Add workaround for FPU bug that breaks scale factor comparisons on certain platforms (fixes XMB thumbnails on 32bit Linux/Windows)
This commit is contained in:
commit
7f4f1d82bb
@ -1037,9 +1037,15 @@ void gfx_widgets_iterate(
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)data;
|
dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)data;
|
||||||
/* Check whether screen dimensions or menu scale
|
/* c.f. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323
|
||||||
* factor have changed */
|
* On some platforms (e.g. 32-bit x86 without SSE),
|
||||||
float scale_factor = 0.0f;
|
* gcc can produce inconsistent floating point results
|
||||||
|
* depending upon optimisation level. This can break
|
||||||
|
* floating point variable comparisons. A workaround is
|
||||||
|
* to declare the affected variable as 'volatile', which
|
||||||
|
* disables optimisations and removes excess precision
|
||||||
|
* (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323#c87) */
|
||||||
|
volatile float scale_factor = 0.0f;
|
||||||
gfx_display_t *p_disp = (gfx_display_t*)data_disp;
|
gfx_display_t *p_disp = (gfx_display_t*)data_disp;
|
||||||
settings_t *settings = (settings_t*)settings_data;
|
settings_t *settings = (settings_t*)settings_data;
|
||||||
#ifdef HAVE_XMB
|
#ifdef HAVE_XMB
|
||||||
@ -1051,6 +1057,8 @@ void gfx_widgets_iterate(
|
|||||||
scale_factor = gfx_display_get_widget_dpi_scale(p_disp,
|
scale_factor = gfx_display_get_widget_dpi_scale(p_disp,
|
||||||
settings, width, height, fullscreen);
|
settings, width, height, fullscreen);
|
||||||
|
|
||||||
|
/* Check whether screen dimensions or menu scale
|
||||||
|
* factor have changed */
|
||||||
if ((scale_factor != p_dispwidget->last_scale_factor) ||
|
if ((scale_factor != p_dispwidget->last_scale_factor) ||
|
||||||
(width != p_dispwidget->last_video_width) ||
|
(width != p_dispwidget->last_video_width) ||
|
||||||
(height != p_dispwidget->last_video_height))
|
(height != p_dispwidget->last_video_height))
|
||||||
|
@ -3512,7 +3512,15 @@ static void materialui_render(void *data,
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
float bottom;
|
float bottom;
|
||||||
float scale_factor;
|
/* c.f. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323
|
||||||
|
* On some platforms (e.g. 32-bit x86 without SSE),
|
||||||
|
* gcc can produce inconsistent floating point results
|
||||||
|
* depending upon optimisation level. This can break
|
||||||
|
* floating point variable comparisons. A workaround is
|
||||||
|
* to declare the affected variable as 'volatile', which
|
||||||
|
* disables optimisations and removes excess precision
|
||||||
|
* (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323#c87) */
|
||||||
|
volatile float scale_factor;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
materialui_handle_t *mui = (materialui_handle_t*)data;
|
materialui_handle_t *mui = (materialui_handle_t*)data;
|
||||||
gfx_display_t *p_disp = disp_get_ptr();
|
gfx_display_t *p_disp = disp_get_ptr();
|
||||||
|
@ -1750,7 +1750,15 @@ static void ozone_render(void *data,
|
|||||||
bool is_idle)
|
bool is_idle)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
float scale_factor;
|
/* c.f. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323
|
||||||
|
* On some platforms (e.g. 32-bit x86 without SSE),
|
||||||
|
* gcc can produce inconsistent floating point results
|
||||||
|
* depending upon optimisation level. This can break
|
||||||
|
* floating point variable comparisons. A workaround is
|
||||||
|
* to declare the affected variable as 'volatile', which
|
||||||
|
* disables optimisations and removes excess precision
|
||||||
|
* (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323#c87) */
|
||||||
|
volatile float scale_factor;
|
||||||
unsigned entries_end = (unsigned)menu_entries_get_size();
|
unsigned entries_end = (unsigned)menu_entries_get_size();
|
||||||
bool pointer_enabled = false;
|
bool pointer_enabled = false;
|
||||||
unsigned language = *msg_hash_get_uint(MSG_HASH_USER_LANGUAGE);
|
unsigned language = *msg_hash_get_uint(MSG_HASH_USER_LANGUAGE);
|
||||||
|
@ -3971,7 +3971,15 @@ static void xmb_render(void *data,
|
|||||||
/* 'i' must be of 'size_t', since it is passed
|
/* 'i' must be of 'size_t', since it is passed
|
||||||
* by reference to menu_entries_ctl() */
|
* by reference to menu_entries_ctl() */
|
||||||
size_t i;
|
size_t i;
|
||||||
float scale_factor;
|
/* c.f. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323
|
||||||
|
* On some platforms (e.g. 32-bit x86 without SSE),
|
||||||
|
* gcc can produce inconsistent floating point results
|
||||||
|
* depending upon optimisation level. This can break
|
||||||
|
* floating point variable comparisons. A workaround is
|
||||||
|
* to declare the affected variable as 'volatile', which
|
||||||
|
* disables optimisations and removes excess precision
|
||||||
|
* (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323#c87) */
|
||||||
|
volatile float scale_factor;
|
||||||
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
size_t end = menu_entries_get_size();
|
size_t end = menu_entries_get_size();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user