mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
Always use NULL shader is shader_enable is false.
RARCH_CONSOLE sets true as default. Update the config if shader_enable is false.
This commit is contained in:
parent
f88ea04c28
commit
f3ca37cb2b
@ -249,7 +249,11 @@ static const bool video_smooth = true;
|
|||||||
static const bool force_aspect = true;
|
static const bool force_aspect = true;
|
||||||
|
|
||||||
// Enable use of shaders.
|
// Enable use of shaders.
|
||||||
|
#ifdef RARCH_CONSOLE
|
||||||
|
static const bool shader_enable = true;
|
||||||
|
#else
|
||||||
static const bool shader_enable = false;
|
static const bool shader_enable = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Only scale in integer steps.
|
// Only scale in integer steps.
|
||||||
// The base size depends on system-reported geometry and aspect ratio.
|
// The base size depends on system-reported geometry and aspect ratio.
|
||||||
|
12
gfx/gl.c
12
gfx/gl.c
@ -250,18 +250,16 @@ static bool gl_shader_init(void *data)
|
|||||||
gl_t *gl = (gl_t*)data;
|
gl_t *gl = (gl_t*)data;
|
||||||
const gl_shader_backend_t *backend = NULL;
|
const gl_shader_backend_t *backend = NULL;
|
||||||
|
|
||||||
if (DEFAULT_SHADER_TYPE == RARCH_SHADER_NONE && !g_settings.video.shader_enable)
|
const char *shader_path = (g_settings.video.shader_enable && *g_settings.video.shader_path) ?
|
||||||
|
g_settings.video.shader_path : NULL;
|
||||||
|
enum rarch_shader_type type = gfx_shader_parse_type(shader_path, DEFAULT_SHADER_TYPE);
|
||||||
|
|
||||||
|
if (type == RARCH_SHADER_NONE)
|
||||||
{
|
{
|
||||||
RARCH_LOG("[GL]: Not loading any shader.\n");
|
RARCH_LOG("[GL]: Not loading any shader.\n");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *shader_path = *g_settings.video.shader_path ? g_settings.video.shader_path : NULL;
|
|
||||||
enum rarch_shader_type type = gfx_shader_parse_type(g_settings.video.shader_path, DEFAULT_SHADER_TYPE);
|
|
||||||
|
|
||||||
if (type == RARCH_SHADER_NONE)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_CG
|
#ifdef HAVE_CG
|
||||||
|
@ -1060,6 +1060,9 @@ void gfx_shader_write_conf_cgp(config_file_t *conf, const struct gfx_shader *sha
|
|||||||
|
|
||||||
enum rarch_shader_type gfx_shader_parse_type(const char *path, enum rarch_shader_type fallback)
|
enum rarch_shader_type gfx_shader_parse_type(const char *path, enum rarch_shader_type fallback)
|
||||||
{
|
{
|
||||||
|
if (!path)
|
||||||
|
return fallback;
|
||||||
|
|
||||||
const char *ext = path_get_extension(path);
|
const char *ext = path_get_extension(path);
|
||||||
|
|
||||||
if (strcmp(ext, "cg") == 0 || strcmp(ext, "cgp") == 0)
|
if (strcmp(ext, "cg") == 0 || strcmp(ext, "cgp") == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user