blob: 4177cfcf42f905c8c7d6a177de3252c8579780d4 (
plain)
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
66
67
68
69
|
if (require('os').platform !== "darwin") {
gpuinfo = require('@electron/remote').app.getGPUFeatureStatus();
document.write("kartik<br>");
document.write("├ kartik.accel<br>");
if (gpuinfo['2d_canvas'].startsWith("enabled")) {
document.write("│ ├ <span style='color:lightgreen;'>kartik.accel.Canvas</span><br>");
} else {
document.write("│ ├ <span style='color:lightcoral;'>kartik.accel.Canvas</span><br>");
}
if (gpuinfo['gpu_compositing'].startsWith("enabled")) {
document.write("│ ├ <span style='color:lightgreen;'>kartik.accel.Compositing</span><br>");
} else {
document.write("│ ├ <span style='color:lightcoral;'>kartik.accel.Compositing</span><br>");
}
if (gpuinfo['video_decode'].startsWith("enabled")) {
document.write("│ └ <span style='color:lightgreen;'>kartik.accel.VideoDecode</span><br>");
} else {
document.write("│ └ <span style='color:lightcoral;'>kartik.accel.VideoDecode</span><br>");
}
document.write("├ kartik.raster<br>");
if (gpuinfo['multiple_raster_threads'].startsWith("enabled")) {
document.write("│ ├ <span style='color:lightgreen;'>kartik.raster.Threaded</span><br>");
} else {
document.write("│ ├ <span style='color:lightcoral;'>kartik.raster.Threaded</span><br>");
}
if (gpuinfo['oop_rasterization'].startsWith("enabled")) {
document.write("│ ├ <span style='color:lightgreen;'>kartik.raster.ObjectOP</span><br>");
} else {
document.write("│ ├ <span style='color:lightcoral;'>kartik.raster.ObjectOP</span><br>");
}
if (gpuinfo['rasterization'].startsWith("enabled")) {
document.write("│ └ <span style='color:lightgreen;'>kartik.raster.Common</span><br>");
} else {
document.write("│ └ <span style='color:lightcoral;'>kartik.raster.Common</span><br>");
}
document.write("└ kartik.renderer<br>");
if (gpuinfo['opengl'].startsWith("enabled")) {
document.write(" ├ <span style='color:lightgreen;'>kartik.renderer.OpenGL</span><br>");
} else {
document.write(" ├ <span style='color:lightcoral;'>kartik.renderer.OpenGL</span><br>");
}
if (gpuinfo['skia_renderer'].startsWith("enabled")) {
document.write(" ├ <span style='color:lightgreen;'>kartik.renderer.Skia</span><br>");
} else {
document.write(" ├ <span style='color:lightcoral;'>kartik.renderer.Skia</span><br>");
}
if (gpuinfo['vulkan'].startsWith("enabled")) {
document.write(" └ <span style='color:lightgreen;'>kartik.renderer.Vulkan</span><br>");
} else {
document.write(" └ <span style='color:lightcoral;'>kartik.renderer.Vulkan</span></span><br>");
}
} else {
document.write("You are using macOS<br><br>Kartik can't detect GPU info<br>for Apple macOS.");
}
document.onkeydown = (e) => {
if (e.shiftKey) {
document.getElementById('gpuinfo-inner').style.opacity = "1";
document.getElementById('gpuinfo-outer').style.display = "none";
} else {
document.getElementById('gpuinfo-inner').style.opacity = "0";
document.getElementById('gpuinfo-outer').style.display = "";
}
}
document.onkeyup = (e) => {
document.getElementById('gpuinfo-inner').style.opacity = "0";
document.getElementById('gpuinfo-outer').style.display = "";
}
|