renderdiff: add two params to local_test.sh (#9301)
- --no_rebuild will skip building the gltf_viewer again - --num_threads will limit the number of threads used in running the rendering test. Both of these options are meant for debugging locally.
This commit is contained in:
@@ -83,7 +83,8 @@ def _render_test_config(gltf_viewer,
|
||||
local_only=False,
|
||||
opengl_lib=None,
|
||||
vk_icd=None,
|
||||
test_filter=None):
|
||||
test_filter=None,
|
||||
num_threads=None):
|
||||
assert os.path.isdir(output_dir), f"output directory {output_dir} does not exist"
|
||||
assert os.access(gltf_viewer, os.X_OK)
|
||||
|
||||
@@ -93,7 +94,7 @@ def _render_test_config(gltf_viewer,
|
||||
gltf_viewer_abs = os.path.abspath(gltf_viewer)
|
||||
|
||||
results = []
|
||||
with concurrent.futures.ThreadPoolExecutor() as executor:
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=num_threads) as executor:
|
||||
futures = []
|
||||
for test in test_config.tests:
|
||||
test_json_path = os.path.abspath(
|
||||
@@ -130,6 +131,7 @@ if __name__ == "__main__":
|
||||
parser.add_argument('--opengl_lib', help='Path to the folder containing OpenGL driver lib (for LD_LIBRARY_PATH)')
|
||||
parser.add_argument('--vk_icd', help='Path to VK ICD file')
|
||||
parser.add_argument('--test_filter', help='Filter for the tests to run')
|
||||
parser.add_argument('--num_threads', help='Number of threads to use for rendering', type=int)
|
||||
|
||||
args, _ = parser.parse_known_args(sys.argv[1:])
|
||||
test = test_config.parse_from_path(args.test)
|
||||
@@ -140,7 +142,8 @@ if __name__ == "__main__":
|
||||
args.output_dir,
|
||||
opengl_lib=args.opengl_lib,
|
||||
vk_icd=args.vk_icd,
|
||||
test_filter=args.test_filter)
|
||||
test_filter=args.test_filter,
|
||||
num_threads=args.num_threads)
|
||||
|
||||
with open(f'{output_dir}/render_results.json', 'w') as f:
|
||||
f.write(json.dumps(results, indent=2))
|
||||
|
||||
Reference in New Issue
Block a user