(shader_glsl.c) Small cleanups

This commit is contained in:
twinaphex 2016-12-02 16:50:08 +01:00
parent 65ba82ca4b
commit 45407f9b52

View File

@ -415,12 +415,7 @@ static bool gl_glsl_load_source_path(struct video_shader_pass *pass,
const char *path)
{
ssize_t len;
int nitems = 0;
if (!pass)
return false;
nitems = filestream_read_file(path,
int nitems = filestream_read_file(path,
(void**)&pass->source.string.vertex, &len);
if (nitems <= 0 || len <= 0)
@ -451,13 +446,14 @@ static bool gl_glsl_compile_programs(
* load the file here, and pretend
* we were really using XML all along.
*/
if (*pass->source.path && !gl_glsl_load_source_path(
pass, pass->source.path))
if ( !string_is_empty(pass->source.path)
&& !gl_glsl_load_source_path(pass, pass->source.path))
{
RARCH_ERR("Failed to load GLSL shader: %s.\n",
pass->source.path);
return false;
}
*pass->source.path = '\0';
vertex = pass->source.string.vertex;