[Mesa-dev] [PATCH 1/3] glsl: Make the standalone compiler accept '.glsl' files.

Kenneth Graunke kenneth at whitecape.org
Tue Apr 17 11:45:19 PDT 2012


These ought to be treated as 'any stage', but for now, they're just
treated as vertex shaders.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/glsl/main.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Needed for the next patch.  Otherwise, I'd have to copy .glsl files to
a temporary .vert or .frag file, which is doable but just ugly.  This
seems less ugly and we can turn it into proper 'generic' shader support
someday.

diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index d43bf1a..3231b1b 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -238,7 +238,7 @@ main(int argc, char **argv)
 	 usage_fail(argv[0]);
 
       const char *const ext = & argv[optind][len - 5];
-      if (strncmp(".vert", ext, 5) == 0)
+      if (strncmp(".vert", ext, 5) == 0 || strncmp(".glsl", ext, 5) == 0)
 	 shader->Type = GL_VERTEX_SHADER;
       else if (strncmp(".geom", ext, 5) == 0)
 	 shader->Type = GL_GEOMETRY_SHADER;
-- 
1.7.7.6



More information about the mesa-dev mailing list