apple m chips support wip

This commit is contained in:
minjaesong
2023-02-28 04:36:11 +09:00
parent 66356fc0c9
commit 6f4d9180dc
7 changed files with 151 additions and 2 deletions

View File

@@ -51,6 +51,7 @@ import java.lang.reflect.Field;
import java.util.*;
import static net.torvald.terrarum.TerrarumKt.*;
import static org.lwjgl.glfw.GLFW.*;
/**
* The framework's Application Loader
@@ -133,6 +134,8 @@ public class App implements ApplicationListener {
public static String renderer = "(a super-fancy virtual photoradiator)";
public static String rendererVendor = "(aperture science psychovisualcomputation laboratory)";
public static boolean isAppleM = false;
public static int THREAD_COUNT = Runtime.getRuntime().availableProcessors();
public static boolean MULTITHREAD;
@@ -341,6 +344,10 @@ public class App implements ApplicationListener {
processorVendor = "Unknown CPU";
}
if (processor.startsWith("Apple M") && Objects.equals(systemArch, "aarch64")) {
isAppleM = true;
System.out.println("Apple Proprietary "+processor+" detected; don't expect smooth sailing...");
}
if (!IS_DEVELOPMENT_BUILD) {
var p = UnsafeHelper.INSTANCE.allocate(64);
@@ -437,7 +444,7 @@ public class App implements ApplicationListener {
camera = new OrthographicCamera((scr.getWf()), (scr.getHf()));
batch = new FlippingSpriteBatch();
shapeRender = new ShapeRenderer();
shapeRender = new ShapeRenderer(5000, MacosGL32Shaders.INSTANCE.createShapeRendererShader());
initViewPort(scr.getWidth(), scr.getHeight());