summaryrefslogblamecommitdiff
path: root/validateShaders.py
blob: 18c2ca10f81a47f5eff410c1f98a330397737128 (plain) (tree)
1
2
3
4
5
6
7
8
9

                     
                                
 

                                                              
 

                                                        
 
                                                  





















                                                    
#!/usr/bin/env python

from subprocess import PIPE, run

def validate(path: str):
	print("validating \"", path, "\"... ", end='', sep='')

	path  = "source/dw/app/shader/" + path + ".glsl"
	program = "glslangValidator"

	status = run([program, path], stdout=PIPE)

	result = status.returncode
	if result != 0x0:
		print("\x1B[38;5;161merror\x1B[0m")
		print()
		print(status.stdout.decode("utf-8"))
		quit(0x1)

	print("\x1B[38;5;77mokay\x1B[0m")

if __name__ == "__main__":
	print("validating shaders...")

	shaders = [
		"main.frag",
		"main.vert",
	]

	for shader in shaders:
		validate(shader)

	print("success")