mirror of
https://github.com/mborgerson/xemu.git
synced 2025-12-01 16:10:01 +00:00
nv2a: Move numeric locale setup to main
This commit is contained in:
committed by
mborgerson
parent
4921607c90
commit
90a0187e9b
@ -22,7 +22,6 @@
|
|||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include "qemu/fast-hash.h"
|
#include "qemu/fast-hash.h"
|
||||||
#include "qemu/mstring.h"
|
#include "qemu/mstring.h"
|
||||||
#include <locale.h>
|
|
||||||
|
|
||||||
#include "xemu-version.h"
|
#include "xemu-version.h"
|
||||||
#include "ui/xemu-settings.h"
|
#include "ui/xemu-settings.h"
|
||||||
@ -195,13 +194,6 @@ static GLuint get_shader_module_for_key(PGRAPHGLState *r,
|
|||||||
|
|
||||||
static void generate_shaders(PGRAPHGLState *r, ShaderBinding *binding)
|
static void generate_shaders(PGRAPHGLState *r, ShaderBinding *binding)
|
||||||
{
|
{
|
||||||
char *previous_numeric_locale = setlocale(LC_NUMERIC, NULL);
|
|
||||||
if (previous_numeric_locale) {
|
|
||||||
previous_numeric_locale = g_strdup(previous_numeric_locale);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Ensure numeric values are printed with '.' radix, no grouping */
|
|
||||||
setlocale(LC_NUMERIC, "C");
|
|
||||||
GLuint program = glCreateProgram();
|
GLuint program = glCreateProgram();
|
||||||
|
|
||||||
ShaderState *state = &binding->state;
|
ShaderState *state = &binding->state;
|
||||||
@ -260,11 +252,6 @@ static void generate_shaders(PGRAPHGLState *r, ShaderBinding *binding)
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_shader_uniform_locs(binding);
|
update_shader_uniform_locs(binding);
|
||||||
|
|
||||||
if (previous_numeric_locale) {
|
|
||||||
setlocale(LC_NUMERIC, previous_numeric_locale);
|
|
||||||
g_free(previous_numeric_locale);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *shader_gl_vendor = NULL;
|
static const char *shader_gl_vendor = NULL;
|
||||||
|
|||||||
@ -28,7 +28,6 @@
|
|||||||
#include "qemu/fast-hash.h"
|
#include "qemu/fast-hash.h"
|
||||||
#include "qemu/mstring.h"
|
#include "qemu/mstring.h"
|
||||||
#include "renderer.h"
|
#include "renderer.h"
|
||||||
#include <locale.h>
|
|
||||||
|
|
||||||
#define VSH_UBO_BINDING 0
|
#define VSH_UBO_BINDING 0
|
||||||
#define PSH_UBO_BINDING 1
|
#define PSH_UBO_BINDING 1
|
||||||
@ -401,14 +400,6 @@ static ShaderBinding *gen_shaders(PGRAPHState *pg, ShaderState *state)
|
|||||||
NV2A_VK_DPRINTF("cache miss");
|
NV2A_VK_DPRINTF("cache miss");
|
||||||
nv2a_profile_inc_counter(NV2A_PROF_SHADER_GEN);
|
nv2a_profile_inc_counter(NV2A_PROF_SHADER_GEN);
|
||||||
|
|
||||||
char *previous_numeric_locale = setlocale(LC_NUMERIC, NULL);
|
|
||||||
if (previous_numeric_locale) {
|
|
||||||
previous_numeric_locale = g_strdup(previous_numeric_locale);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Ensure numeric values are printed with '.' radix, no grouping */
|
|
||||||
setlocale(LC_NUMERIC, "C");
|
|
||||||
|
|
||||||
ShaderModuleCacheKey key;
|
ShaderModuleCacheKey key;
|
||||||
|
|
||||||
bool need_geometry_shader = pgraph_glsl_need_geom(&state->geom);
|
bool need_geometry_shader = pgraph_glsl_need_geom(&state->geom);
|
||||||
@ -441,11 +432,6 @@ static ShaderBinding *gen_shaders(PGRAPHState *pg, ShaderState *state)
|
|||||||
key.psh.glsl_opts.tex_binding = PSH_TEX_BINDING;
|
key.psh.glsl_opts.tex_binding = PSH_TEX_BINDING;
|
||||||
snode->psh.module_info = get_and_ref_shader_module_for_key(r, &key);
|
snode->psh.module_info = get_and_ref_shader_module_for_key(r, &key);
|
||||||
|
|
||||||
if (previous_numeric_locale) {
|
|
||||||
setlocale(LC_NUMERIC, previous_numeric_locale);
|
|
||||||
g_free(previous_numeric_locale);
|
|
||||||
}
|
|
||||||
|
|
||||||
update_shader_uniform_locs(snode);
|
update_shader_uniform_locs(snode);
|
||||||
|
|
||||||
snode->initialized = true;
|
snode->initialized = true;
|
||||||
|
|||||||
@ -58,6 +58,7 @@
|
|||||||
#include "ui/xemu-notifications.h"
|
#include "ui/xemu-notifications.h"
|
||||||
|
|
||||||
#include <stb_image.h>
|
#include <stb_image.h>
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Provide hint to prefer high-performance graphics for hybrid systems
|
// Provide hint to prefer high-performance graphics for hybrid systems
|
||||||
@ -1268,6 +1269,8 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
QemuThread thread;
|
QemuThread thread;
|
||||||
|
|
||||||
|
setlocale(LC_NUMERIC, "C");
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (AttachConsole(ATTACH_PARENT_PROCESS)) {
|
if (AttachConsole(ATTACH_PARENT_PROCESS)) {
|
||||||
// Launched with a console. If stdout and stderr are not associated with
|
// Launched with a console. If stdout and stderr are not associated with
|
||||||
|
|||||||
Reference in New Issue
Block a user