-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathllg_rendertype.py
More file actions
65 lines (55 loc) · 2.81 KB
/
Copy pathllg_rendertype.py
File metadata and controls
65 lines (55 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
from dataclasses import dataclass
from llg_renderstats import RenderStats, RtRenderStats, NrtRenderStats
from llg_results import Result, RtResult, NrtResult
@dataclass
class RenderType:
pc_id: str
render_object: str
vulkan_stats: RenderStats
directx_stats: RenderStats
def __init__(self, pc_id:str, render_object:str):
self.pc_id = pc_id
self.render_object = render_object
def init_rt(self):
self.vulkan_stats = RtRenderStats(0,0,0,0,0,0)
self.directx_stats = RtRenderStats(0,0,0,0,0,0)
def init_nrt(self):
self.vulkan_stats = NrtRenderStats(0,0,0,0,0,0)
self.directx_stats = NrtRenderStats(0,0,0,0,0,0)
def __change_vulkan_result(self, result: Result):
# replace the zero-filled stats with the actual stats
if isinstance(result, RtResult):
self.vulkan_stats = RtRenderStats(result.cpu_min(),
result.cpu_avg(),
result.cpu_max(),
result.fps_min(),
result.fps_avg(),
result.fps_max())
elif isinstance(result, NrtResult):
self.vulkan_stats = NrtRenderStats(result.cpu_min(),
result.cpu_avg(),
result.cpu_max(),
result.spf_min(),
result.spf_avg(),
result.spf_max())
def __change_directx_result(self, result: Result):
# replace the zero-filled stats with the actual stats
if isinstance(result, RtResult):
self.directx_stats = RtRenderStats(result.cpu_min(),
result.cpu_avg(),
result.cpu_max(),
result.fps_min(),
result.fps_avg(),
result.fps_max())
elif isinstance(result, NrtResult):
self.directx_stats = NrtRenderStats(result.cpu_min(),
result.cpu_avg(),
result.cpu_max(),
result.spf_min(),
result.spf_avg(),
result.spf_max())
def change_result(self, result: Result):
if result.engine() == "vulkan":
self.__change_vulkan_result(result)
elif result.engine() == "directx11":
self.__change_directx_result(result)