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:
Themaister 2013-04-07 13:08:09 +02:00
parent f88ea04c28
commit f3ca37cb2b
3 changed files with 12 additions and 7 deletions

View File

@ -249,7 +249,11 @@ static const bool video_smooth = true;
static const bool force_aspect = true;
// Enable use of shaders.
#ifdef RARCH_CONSOLE
static const bool shader_enable = true;
#else
static const bool shader_enable = false;
#endif
// Only scale in integer steps.
// The base size depends on system-reported geometry and aspect ratio.

View File

@ -250,18 +250,16 @@ static bool gl_shader_init(void *data)
gl_t *gl = (gl_t*)data;
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");
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)
{
#ifdef HAVE_CG

View File

@ -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)
{
if (!path)
return fallback;
const char *ext = path_get_extension(path);
if (strcmp(ext, "cg") == 0 || strcmp(ext, "cgp") == 0)