diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2013-11-13 16:48:10 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:05:12 +0300 |
commit | a4ef24bba74fd8e242a7fd9b0e1687d26dcbf2d5 (patch) | |
tree | 900e76183e11e8b98f11aced19765fbd342ad8f5 /tools/autobuild | |
parent | 0b02ded37c8e01e4f9e37931c9c56982d23bb511 (diff) |
[drape] shader compilation test on OpenGL ES offline GLSL compiler (PowerVR util)
Diffstat (limited to 'tools/autobuild')
-rw-r--r-- | tools/autobuild/shader_preprocessor.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/autobuild/shader_preprocessor.py b/tools/autobuild/shader_preprocessor.py index 77ae7f5b0e..9ed70d9d4c 100644 --- a/tools/autobuild/shader_preprocessor.py +++ b/tools/autobuild/shader_preprocessor.py @@ -172,6 +172,31 @@ def validateDocumentation(shaders, shaderDir): print "no documentation for shaders:", undocumentedShaders exit(20) +def writeEnumerationFile(shaderDir, shaders, outputFile): + file = open(outputFile, 'w') + vertexShaders = [s for s in shaders if s.endswith(".vsh")] + fragmentShaders = [s for s in shaders if s.endswith(".fsh")] + + file.write("#pragma once\n\n") + file.write("#include \"../../std/vector.hpp\"\n") + file.write("#include \"../../std/string.hpp\"\n\n") + file.write("namespace gpu_test\n") + file.write("{\n") + + file.write(" vector<string> VertexEnum;\n") + file.write(" vector<string> FragmentEnum;\n\n") + + file.write(" void InitEnumeration()\n") + file.write(" {\n") + + for s in vertexShaders: + file.write(" VertexEnum.push_back(\"%s\");\n" % (os.path.abspath(os.path.join(shaderDir, s)))) + for s in fragmentShaders: + file.write(" FragmentEnum.push_back(\"%s\");\n" % (os.path.abspath(os.path.join(shaderDir, s)))) + + file.write(" }\n") + file.write("}\n") + if len(sys.argv) < 4: print "Usage : " + sys.argv[0] + " <shader_dir> <index_file_name> <generate_file_name>" exit(1) @@ -193,3 +218,6 @@ else: print "No need to update definition file" writeImplementationFile(programDefinition, programIndex, shaderIndex, shaderDir, implFile, definesFile) validateDocumentation(shaders, shaderDir) + +if len(sys.argv) > 4: + writeEnumerationFile(shaderDir, shaders, sys.argv[4]) |