aboutsummaryrefslogtreecommitdiff
path: root/views/script/menu_gpuinfo.js
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-06-05 19:27:48 +0200
committerMinteck <nekostarfan@gmail.com>2021-06-05 19:27:48 +0200
commit8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6 (patch)
tree7096b67b189c0220826123c7d5b121752545d140 /views/script/menu_gpuinfo.js
downloadkartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.tar.gz
kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.tar.bz2
kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.zip
Presque sortie du jeu
Diffstat (limited to 'views/script/menu_gpuinfo.js')
-rw-r--r--views/script/menu_gpuinfo.js69
1 files changed, 69 insertions, 0 deletions
diff --git a/views/script/menu_gpuinfo.js b/views/script/menu_gpuinfo.js
new file mode 100644
index 0000000..4177cfc
--- /dev/null
+++ b/views/script/menu_gpuinfo.js
@@ -0,0 +1,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(" &nbsp;├ <span style='color:lightgreen;'>kartik.renderer.OpenGL</span><br>");
+ } else {
+ document.write(" &nbsp;├ <span style='color:lightcoral;'>kartik.renderer.OpenGL</span><br>");
+ }
+ if (gpuinfo['skia_renderer'].startsWith("enabled")) {
+ document.write(" &nbsp;├ <span style='color:lightgreen;'>kartik.renderer.Skia</span><br>");
+ } else {
+ document.write(" &nbsp;├ <span style='color:lightcoral;'>kartik.renderer.Skia</span><br>");
+ }
+ if (gpuinfo['vulkan'].startsWith("enabled")) {
+ document.write(" &nbsp;└ <span style='color:lightgreen;'>kartik.renderer.Vulkan</span><br>");
+ } else {
+ document.write(" &nbsp;└ <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 = "";
+} \ No newline at end of file