mirror of
https://github.com/LTTLabsOSS/markbench-tests.git
synced 2026-01-09 22:18:00 -05:00
Update superposition harness (#72)
* Update superposition harness * update cspell: --------- Signed-off-by: nharris-lmg <105814489+nharris-lmg@users.noreply.github.com>
This commit is contained in:
@@ -13,6 +13,10 @@
|
|||||||
"Kikis",
|
"Kikis",
|
||||||
"Jcraft",
|
"Jcraft",
|
||||||
"Kombustor",
|
"Kombustor",
|
||||||
|
"Unigine",
|
||||||
|
"directx",
|
||||||
|
"opengl",
|
||||||
|
"argies",
|
||||||
"turbopolsa",
|
"turbopolsa",
|
||||||
"RLCS",
|
"RLCS",
|
||||||
"Dota",
|
"Dota",
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ Wrapper for the Unigine benchmark Superposition.
|
|||||||
- Python 3.10+
|
- Python 3.10+
|
||||||
- [Unigine Superposition](https://benchmark.unigine.com/superposition) installed.
|
- [Unigine Superposition](https://benchmark.unigine.com/superposition) installed.
|
||||||
|
|
||||||
|
> Unigine Superposition PROFESSIONAL edition needs to be unlocked to support CLI commands.
|
||||||
|
|
||||||
## Output
|
## Output
|
||||||
|
|
||||||
report.json
|
report.json
|
||||||
- `api`: graphics api to be used: directx or opengl.
|
- `api`: graphics api to be used: directx or opengl.
|
||||||
- `preset`: graphics preset to be used: low, medium, high, extreme.
|
- `preset`: graphics preset to be used: low, medium, high, extreme.
|
||||||
- `resolution` resolution to be used, example: 1080,1920
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
friendly_name: "Unigine Superposition"
|
friendly_name: "Unigine Superposition"
|
||||||
executable: "superposition.py"
|
executable: "superposition.py"
|
||||||
process_name: "superposition.exe"
|
process_name: "superposition.exe"
|
||||||
hidden: 1
|
hidden: 0
|
||||||
output_dir: "run"
|
output_dir: "run"
|
||||||
options:
|
options:
|
||||||
- name: api
|
- name: api
|
||||||
@@ -12,6 +12,3 @@ options:
|
|||||||
type: select
|
type: select
|
||||||
values: [low, medium, high, extreme, 4k_optimized, 8k_optimized]
|
values: [low, medium, high, extreme, 4k_optimized, 8k_optimized]
|
||||||
tooltip: See Superposition doc section "Benchmark Presets"
|
tooltip: See Superposition doc section "Benchmark Presets"
|
||||||
- name: resolution
|
|
||||||
type: input
|
|
||||||
tooltip: Format must be height,width. 1080,1920
|
|
||||||
@@ -24,20 +24,11 @@ parser.add_argument("-a", "--api", dest="api",
|
|||||||
help="graphics api", metavar="api", required=True)
|
help="graphics api", metavar="api", required=True)
|
||||||
parser.add_argument("-p", "--preset", dest="preset",
|
parser.add_argument("-p", "--preset", dest="preset",
|
||||||
help="performance preset", metavar="preset", required=True)
|
help="performance preset", metavar="preset", required=True)
|
||||||
parser.add_argument("-r", "--resolution", dest="resolution",
|
|
||||||
help="resolution", metavar="resolution", required=True)
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.preset not in avail_presets:
|
if args.preset not in avail_presets:
|
||||||
raise ValueError(f"Error, unknown preset: {args.preset}")
|
raise ValueError(f"Error, unknown preset: {args.preset}")
|
||||||
|
|
||||||
match = re.search(r"^\d+,\d+$", args.resolution)
|
|
||||||
if match is None:
|
|
||||||
raise ValueError("Resolution value must be in format height,width")
|
|
||||||
r = args.resolution.split(",")
|
|
||||||
h = r[0]
|
|
||||||
w = r[1]
|
|
||||||
|
|
||||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
log_dir = os.path.join(script_dir, "run")
|
log_dir = os.path.join(script_dir, "run")
|
||||||
if not os.path.isdir(log_dir):
|
if not os.path.isdir(log_dir):
|
||||||
@@ -53,14 +44,14 @@ console.setFormatter(formatter)
|
|||||||
logging.getLogger('').addHandler(console)
|
logging.getLogger('').addHandler(console)
|
||||||
|
|
||||||
cmd = f'{INSTALL_DIR}\\{EXECUTABLE}'
|
cmd = f'{INSTALL_DIR}\\{EXECUTABLE}'
|
||||||
argstr = f"-fullscreen 1 -mode default -api {args.api} -quality {args.preset} -resolution {w}x{h}"
|
argstr = f"-fullscreen 1 -mode default -api {args.api} -quality {args.preset} -iterations 1"
|
||||||
argstr += f" -log_txt {log_dir}\\log.txt"
|
argstr += f" -log_txt {log_dir}\\log.txt"
|
||||||
|
|
||||||
logging.info(cmd)
|
logging.info(cmd)
|
||||||
logging.info(argstr)
|
logging.info(argstr)
|
||||||
argies = argstr.split(" ")
|
argies = argstr.split(" ")
|
||||||
cmd = cmd.rstrip()
|
cmd = cmd.rstrip()
|
||||||
process = Popen([cmd, *argies])
|
with Popen([cmd, *argies]) as process:
|
||||||
EXIT_CODE = process.wait()
|
EXIT_CODE = process.wait()
|
||||||
|
|
||||||
if EXIT_CODE > 0:
|
if EXIT_CODE > 0:
|
||||||
@@ -77,8 +68,7 @@ with open(log_path, encoding="utf-8") as log:
|
|||||||
score = match.group(1)
|
score = match.group(1)
|
||||||
|
|
||||||
report = {
|
report = {
|
||||||
"resolution": f"{w}x{h}",
|
"preset": args.preset,
|
||||||
"graphics_preset": args.preset,
|
|
||||||
"score": score
|
"score": score
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user