fixed shader ../path
authorhgn <hgodden00@gmail.com>
Sat, 20 Aug 2022 00:30:03 +0000 (01:30 +0100)
committerhgn <hgodden00@gmail.com>
Sat, 20 Aug 2022 00:30:03 +0000 (01:30 +0100)
src/shader.c
src/vg/vg_shader.h

index 2f7c16790fe6d81d900b9c2d535157b8d74ce3ec..f5e7b360da8e9703a5da66e18f4e83b43a2fdaa8 100644 (file)
@@ -27,7 +27,7 @@ static int compile_subshader( FILE *header, char *name )
       /* VG */
 
       fprintf( header, "{\n"
-         ".orig_file = \"../shaders/%s\",\n"
+         ".orig_file = \"../../shaders/%s\",\n"
          ".static_src = \n", name );
 
       char *cur = full, *start = full;
index 1c9373493cc1458f0dde12fd30f29753be501c1f..6007a42dbd25bce96a97d0b2ced1586ef7b1a3af 100644 (file)
@@ -84,13 +84,16 @@ static int vg_shader_compile( struct vg_shader *shader )
       char error[260];
       char path[260];
       strcpy( path, shader->vs.orig_file );
-      avs = stb_include_file( path, "", "../shaders", error );
+      avs = stb_include_file( path, "", "../../shaders", error );
 
       strcpy( path, shader->fs.orig_file );
-      afs = stb_include_file( path, "", "../shaders", error );
+      afs = stb_include_file( path, "", "../../shaders", error );
    
       if( !avs || !afs )
       {
+         vg_error( "Could not find shader source files (%s)\n",
+               shader->vs.orig_file );
+
          free( avs );
          free( afs );
          return 0;