2017-08-22 21:03:54 +02:00
|
|
|
# Benchmark all examples
|
|
|
|
|
import subprocess
|
|
|
|
|
import sys
|
|
|
|
|
import os
|
2017-08-23 21:24:50 +02:00
|
|
|
import platform
|
2017-08-22 21:03:54 +02:00
|
|
|
|
|
|
|
|
EXAMPLES = [
|
|
|
|
|
"bloom",
|
|
|
|
|
"computecloth",
|
|
|
|
|
"computecullandlod",
|
|
|
|
|
"computenbody",
|
|
|
|
|
"computeparticles",
|
2022-07-15 10:33:57 -04:00
|
|
|
"computeraytracing",
|
2017-08-22 21:03:54 +02:00
|
|
|
"computeshader",
|
2022-07-15 10:33:57 -04:00
|
|
|
"conditionalrender",
|
|
|
|
|
"conservativeraster",
|
2017-08-22 21:03:54 +02:00
|
|
|
"debugmarker",
|
|
|
|
|
"deferred",
|
|
|
|
|
"deferredmultisampling",
|
|
|
|
|
"deferredshadows",
|
2022-07-15 10:33:57 -04:00
|
|
|
"descriptorindexing",
|
|
|
|
|
"descriptorsets",
|
2017-08-22 21:03:54 +02:00
|
|
|
"displacement",
|
|
|
|
|
"distancefieldfonts",
|
2022-07-15 10:33:57 -04:00
|
|
|
"dynamicrendering",
|
2017-08-22 21:03:54 +02:00
|
|
|
"dynamicuniformbuffer",
|
|
|
|
|
"gears",
|
|
|
|
|
"geometryshader",
|
2022-07-15 10:33:57 -04:00
|
|
|
"gltfloading",
|
|
|
|
|
"gltfscenerendering",
|
|
|
|
|
"gltfskinning",
|
|
|
|
|
"graphicspipelinelibrary",
|
2017-08-22 21:03:54 +02:00
|
|
|
"hdr",
|
|
|
|
|
"imgui",
|
|
|
|
|
"indirectdraw",
|
2022-07-15 10:33:57 -04:00
|
|
|
"inlineuniformblocks",
|
|
|
|
|
"inputattachments",
|
2017-08-22 21:03:54 +02:00
|
|
|
"instancing",
|
|
|
|
|
"multisampling",
|
|
|
|
|
"multithreading",
|
2022-07-15 10:33:57 -04:00
|
|
|
"multiview",
|
|
|
|
|
"negativeviewportheight",
|
2017-08-22 21:03:54 +02:00
|
|
|
"occlusionquery",
|
|
|
|
|
"offscreen",
|
2022-07-15 10:33:57 -04:00
|
|
|
"oit",
|
2017-08-22 21:03:54 +02:00
|
|
|
"parallaxmapping",
|
|
|
|
|
"particlefire",
|
|
|
|
|
"pbrbasic",
|
|
|
|
|
"pbribl",
|
|
|
|
|
"pbrtexture",
|
|
|
|
|
"pipelines",
|
2022-07-15 10:33:57 -04:00
|
|
|
"pipelinestatistics",
|
2017-08-22 21:03:54 +02:00
|
|
|
"pushconstants",
|
2022-07-15 10:33:57 -04:00
|
|
|
"pushdescriptors",
|
2017-08-22 21:03:54 +02:00
|
|
|
"radialblur",
|
2022-07-15 10:33:57 -04:00
|
|
|
"rayquery",
|
|
|
|
|
"raytracingbasic",
|
|
|
|
|
"raytracingcallable",
|
|
|
|
|
"raytracingreflections",
|
|
|
|
|
"raytracingshadows",
|
2017-08-22 21:03:54 +02:00
|
|
|
"shadowmapping",
|
2022-07-15 10:33:57 -04:00
|
|
|
"shadowmappingcascade",
|
2017-08-22 21:03:54 +02:00
|
|
|
"shadowmappingomni",
|
|
|
|
|
"specializationconstants",
|
|
|
|
|
"sphericalenvmapping",
|
|
|
|
|
"ssao",
|
|
|
|
|
"stencilbuffer",
|
|
|
|
|
"subpasses",
|
|
|
|
|
"terraintessellation",
|
|
|
|
|
"tessellation",
|
|
|
|
|
"textoverlay",
|
|
|
|
|
"texture",
|
|
|
|
|
"texture3d",
|
|
|
|
|
"texturearray",
|
|
|
|
|
"texturecubemap",
|
2022-07-15 10:33:57 -04:00
|
|
|
"texturecubemaparray",
|
2017-08-22 21:03:54 +02:00
|
|
|
"texturemipmapgen",
|
|
|
|
|
"texturesparseresidency",
|
|
|
|
|
"triangle",
|
2022-07-15 10:33:57 -04:00
|
|
|
"variablerateshading",
|
|
|
|
|
"vertexattributes",
|
2017-08-22 21:03:54 +02:00
|
|
|
"viewportarray",
|
|
|
|
|
"vulkanscene"
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
CURR_INDEX = 0
|
|
|
|
|
|
|
|
|
|
ARGS = "-fullscreen -b"
|
|
|
|
|
|
|
|
|
|
print("Benchmarking all examples...")
|
|
|
|
|
|
|
|
|
|
os.makedirs("./benchmark", exist_ok=True)
|
|
|
|
|
|
|
|
|
|
for example in EXAMPLES:
|
2017-08-26 14:05:48 +02:00
|
|
|
print("---- (%d/%d) Running %s in benchmark mode ----" % (CURR_INDEX+1, len(EXAMPLES), example))
|
2022-07-15 10:33:57 -04:00
|
|
|
if platform.system() == 'Linux' or platform.system() == 'Darwin':
|
2018-07-14 11:28:58 +02:00
|
|
|
RESULT_CODE = subprocess.call("./%s %s -bf ./benchmark/%s.csv 5" % (example, ARGS, example), shell=True)
|
2017-08-23 21:24:50 +02:00
|
|
|
else:
|
2018-07-14 11:28:58 +02:00
|
|
|
RESULT_CODE = subprocess.call("%s %s -bf ./benchmark/%s.csv 5" % (example, ARGS, example))
|
2017-08-22 21:03:54 +02:00
|
|
|
if RESULT_CODE == 0:
|
2017-08-26 14:05:48 +02:00
|
|
|
print("Results written to ./benchmark/%s.csv" % example)
|
2017-08-22 21:03:54 +02:00
|
|
|
else:
|
2017-08-26 14:05:48 +02:00
|
|
|
print("Error, result code = %d" % RESULT_CODE)
|
2017-08-22 21:03:54 +02:00
|
|
|
CURR_INDEX += 1
|
|
|
|
|
|
|
|
|
|
print("Benchmark run finished")
|