2022-08-20 22:12:11 -04:00
|
|
|
import subprocess, os
|
|
|
|
|
2022-08-21 16:24:13 -04:00
|
|
|
plats = [
|
2022-08-23 18:02:15 -04:00
|
|
|
{ 'location': 'glsl', 'frag': '140', 'vert': '140' },
|
2022-08-21 16:24:13 -04:00
|
|
|
{ 'location': 'dx11', 'frag': 'ps_5_0', 'vert': 'vs_5_0' },
|
|
|
|
{ 'location': 'spirv', 'frag': 'spirv', 'vert': 'spirv' }
|
|
|
|
]
|
|
|
|
|
2022-08-20 22:12:11 -04:00
|
|
|
for root, dirs, _ in os.walk('shaders'):
|
|
|
|
for name in dirs:
|
2022-08-21 16:24:13 -04:00
|
|
|
for config in plats:
|
|
|
|
subprocess.run(["..\\out\\install\\x64-Debug\\bin\\shaderc", "-f", os.path.join(root, name, name + '.frag'),
|
|
|
|
"--type", "fragment"
|
|
|
|
"--platform", "windows",
|
|
|
|
"--profile", config['frag'],
|
|
|
|
"--varyingdef", os.path.join(root, name, "varying.def.sc"),
|
|
|
|
"-i", "ext\\bgfx\\bgfx\\examples\\common",
|
|
|
|
"-i", "ext\\bgfx\\bgfx\\src",
|
|
|
|
"-o", "..\\out\\build\\x64-Debug\\ADVect\\shaders\\" + config['location'] + "\\" + name + ".frag.bin"])
|
|
|
|
subprocess.run(["..\\out\\install\\x64-Debug\\bin\\shaderc", "-f", os.path.join(root, name, name + '.vert'),
|
|
|
|
"--type", "vertex"
|
|
|
|
"--platform", "windows",
|
|
|
|
"--profile", config['vert'],
|
|
|
|
"--varyingdef", os.path.join(root, name, "varying.def.sc"),
|
|
|
|
"-i", "ext\\bgfx\\bgfx\\examples\\common",
|
|
|
|
"-i", "ext\\bgfx\\bgfx\\src",
|
|
|
|
"-o", "..\\out\\build\\x64-Debug\\ADVect\\shaders\\" + config['location'] + "\\" + name + ".vert.bin"])
|
|
|
|
|