6from __future__
import print_function
14 print(sys.argv[0],
' <compiler> <folder>')
22for filename
in os.listdir(folder):
23 basename, ext = os.path.splitext(filename)
24 if ext
not in [
'.frag',
'.spv']:
28 cmdline.extend([
'-f',
'-p'])
29 cmdline.append(os.path.join(folder, filename))
31 output = subprocess.check_output(cmdline)
32 except subprocess.CalledProcessError:
34 stats.setdefault(basename, {})
35 for line
in output.splitlines():
36 if line.startswith(
'Instructions Emitted'):
37 inst = line.split(
':')[1].split()
38 stats[basename][ext] = inst
40for k, v
in stats.iteritems():
41 gl = v.get(
'.frag', [
'',
'',
''])
42 vk = v.get(
'.spv', [
'',
'',
''])
44 k, gl[0], gl[1], gl[2], vk[0], vk[1], vk[2]))
uint32_t uint32_t * format
def print(*args, **kwargs)