2022-08-20 22:12:11 -04:00
|
|
|
import subprocess, os
|
|
|
|
|
2022-08-28 09:40:27 -04:00
|
|
|
SHADERC = "..\\out\\install\\x64-Debug\\bin\\shaderc"
|
|
|
|
OUT = "..\\out\\build\\x64-Debug\\ADVect\\shaders\\"
|
|
|
|
# OUT = "..\\build\\ADVect\\shaders\\"
|
|
|
|
|
|
|
|
P = lambda location, frag, vert: { 'location': location, 'frag': frag, 'vert': vert }
|
2022-08-21 16:24:13 -04:00
|
|
|
plats = [
|
2022-08-28 09:40:27 -04:00
|
|
|
P('glsl', '140', '140'),
|
|
|
|
P('dx11', 'ps_5_0', 'vs_5_0'),
|
|
|
|
P('spirv', 'spirv', 'spirv')
|
2022-08-21 16:24:13 -04:00
|
|
|
]
|
|
|
|
|
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:
|
2022-08-28 09:40:27 -04:00
|
|
|
subprocess.run([SHADERC, "-f", os.path.join(root, name, name + '.frag'),
|
2022-08-21 16:24:13 -04:00
|
|
|
"--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",
|
2022-08-28 09:40:27 -04:00
|
|
|
"-o", OUT + config['location'] + "\\" + name + ".frag.bin"])
|
|
|
|
subprocess.run([SHADERC, "-f", os.path.join(root, name, name + '.vert'),
|
2022-08-21 16:24:13 -04:00
|
|
|
"--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",
|
2022-08-28 09:40:27 -04:00
|
|
|
"-o", OUT + config['location'] + "\\" + name + ".vert.bin"])
|
2022-08-21 16:24:13 -04:00
|
|
|
|