INNER CODE UNIT · Python

regression_check_reflect

Hongtae/SwiftVVD · SupportPackages/SPIRV-Cross/Sources/test_shaders.py:711

def regression_check_reflect(shader, json_file, args):
    reference = reference_path(shader[0], shader[1], args.opt) + '.json'
    joined_path = os.path.join(shader[0], shader[1])
    print('Reference shader reflection path:', reference)
    if os.path.exists(reference):
        actual = md5_for_file(json_file)
        expected = md5_for_file(reference)
        if actual != expected:
            if args.update:
                print('Generated reflection json has changed for {}!'.format(reference))
                # If we expect changes, update the reference file.
                if os.path.exists(reference):
                    remove_file(reference)
                make_reference_dir(reference)
                shutil.move(json_file, reference)
            else:
                print('Generated reflection json in {} does not match reference {}!'.format(json_file, reference))
                if args.diff:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…