Compare commits
68
Commits
9dca822b21
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c5e4ef976 | ||
|
|
cdcbd92f73 | ||
|
|
bfa53c7849 | ||
|
|
d8cfb79c9a | ||
|
|
bc17e7886d | ||
|
|
b43d76bbc2 | ||
|
|
641f19dd67 | ||
|
|
09874d1b8a | ||
|
|
396d4f2232 | ||
|
|
340d8ff463 | ||
|
|
c1f6c5ec10 | ||
|
|
bc078abea4 | ||
|
|
02b1aab8f3 | ||
|
|
c7c7fd9856 | ||
|
|
5a82dfcf2d | ||
|
|
d309f63814 | ||
|
|
814e35a663 | ||
|
|
8eb4314952 | ||
|
|
072cf05aff | ||
|
|
ba4fa73cad | ||
|
|
d0a462aed8 | ||
|
|
8ef73e4059 | ||
|
|
857f5eec64 | ||
|
|
a061b267f7 | ||
|
|
e3a17373a9 | ||
|
|
9036a7391a | ||
|
|
6c4e036e46 | ||
|
|
dce550da0d | ||
|
|
bfe426f11e | ||
|
|
8d7c7d2d97 | ||
|
|
9ba9e81686 | ||
|
|
a1453f0a6c | ||
|
|
96d3c5b345 | ||
|
|
5fd1ff4904 | ||
|
|
7a7d9c1fd0 | ||
|
|
2dae61adbf | ||
|
|
7fdbe645e4 | ||
|
|
62b91f0f1d | ||
|
|
0139086858 | ||
|
|
7f8b3e8786 | ||
|
|
91c4d15313 | ||
|
|
30e63d79a2 | ||
|
|
cc5267378d | ||
|
|
0808c672bc | ||
|
|
e5873759cc | ||
|
|
55957d3640 | ||
|
|
c01d317fdb | ||
|
|
94f371b4a3 | ||
|
|
3139dff800 | ||
|
|
21386d3703 | ||
|
|
4a123c08d6 | ||
|
|
9526fe42b9 | ||
|
|
cab2095668 | ||
|
|
36ce0209fb | ||
|
|
099eec4fe4 | ||
|
|
afa3215abd | ||
|
|
867733cdfc | ||
|
|
61d48be579 | ||
|
|
52fcac6fe9 | ||
|
|
618ccc1cc2 | ||
|
|
0caf508535 | ||
|
|
ab9d11f165 | ||
|
|
5540f1c042 | ||
|
|
d7fbc6e93b | ||
|
|
00671c00ff | ||
|
|
fea2b5ea22 | ||
|
|
8333e832a2 | ||
|
|
4292ea266f |
+19
-1
@@ -12,7 +12,25 @@
|
||||
<attribute name="gradle_used_by_scope" value="main,test"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21/"/>
|
||||
<classpathentry kind="src" output="bin/graphics" path="src/graphics/java">
|
||||
<attributes>
|
||||
<attribute name="gradle_scope" value="graphics"/>
|
||||
<attribute name="gradle_used_by_scope" value="graphics"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="bin/math" path="src/math/java">
|
||||
<attributes>
|
||||
<attribute name="gradle_scope" value="math"/>
|
||||
<attribute name="gradle_used_by_scope" value="main,graphics,math"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="bin/assets" path="src/assets/java">
|
||||
<attributes>
|
||||
<attribute name="gradle_scope" value="assets"/>
|
||||
<attribute name="gradle_used_by_scope" value="assets"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
||||
<classpathentry kind="output" path="bin/default"/>
|
||||
</classpath>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>GameProject-SimpleJavaEngine</name>
|
||||
<name>SimpleJavaEngine</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
|
||||
@@ -5,9 +5,9 @@ connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
|
||||
connection.project.dir=
|
||||
eclipse.preferences.version=1
|
||||
gradle.user.home=
|
||||
java.home=
|
||||
java.home=C\:/Program Files/Java/jdk25
|
||||
jvm.arguments=
|
||||
offline.mode=false
|
||||
override.workspace.settings=false
|
||||
override.workspace.settings=true
|
||||
show.console.view=false
|
||||
show.executions.view=false
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# Tests that should be done.
|
||||
|
||||
- Test starting animations with delays of each other to see if they act properly.
|
||||
- Reafactor the GL_TEXTURE_FORMAT because it's in desperate need of an refactor.
|
||||
+65
-23
@@ -1,10 +1,13 @@
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(25)
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
|
||||
eclipse {
|
||||
classpath {
|
||||
downloadJavadoc = true
|
||||
@@ -12,7 +15,33 @@ eclipse {
|
||||
}
|
||||
}
|
||||
|
||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaLanguageVersion.of(21)
|
||||
sourceSets {
|
||||
math {
|
||||
java {}
|
||||
}
|
||||
assets {
|
||||
java {}
|
||||
}
|
||||
graphics {
|
||||
java {}
|
||||
}
|
||||
main {
|
||||
compileClasspath += sourceSets.math.output
|
||||
runtimeClasspath += sourceSets.math.output
|
||||
}
|
||||
graphics {
|
||||
compileClasspath += sourceSets.math.output
|
||||
runtimeClasspath += sourceSets.math.output
|
||||
java {}
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
graphics.extendsFrom implementation
|
||||
graphics.extendsFrom runtime
|
||||
graphics.extendsFrom mathRuntime
|
||||
implementation.extendsFrom mathRuntime
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -20,29 +49,9 @@ repositories {
|
||||
name = "Speiger Maven"
|
||||
url = "https://maven.speiger.com/repository/main"
|
||||
}
|
||||
maven { url "https://central.sonatype.com/repository/maven-snapshots" }
|
||||
}
|
||||
|
||||
task srcJar(type: Jar) {
|
||||
from sourceSets.main.allSource
|
||||
archiveClassifier = 'sources'
|
||||
from {
|
||||
configurations.runtimeClasspath.collect {
|
||||
it.isDirectory() ? it : zipTree(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives srcJar
|
||||
}
|
||||
|
||||
jar {
|
||||
from {
|
||||
configurations.runtimeClasspath.collect {
|
||||
it.isDirectory() ? it : zipTree(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
//LWJGL 3
|
||||
@@ -55,6 +64,8 @@ dependencies {
|
||||
implementation "org.lwjgl:lwjgl-opengl"
|
||||
implementation "org.lwjgl:lwjgl-stb"
|
||||
implementation "org.lwjgl:lwjgl-nfd"
|
||||
implementation "org.lwjgl:lwjgl-freetype"
|
||||
implementation "org.lwjgl:lwjgl-harfbuzz"
|
||||
implementation "org.lwjgl:lwjgl-nanovg"
|
||||
implementation "org.lwjgl:lwjgl::$lwjglNatives"
|
||||
implementation "org.lwjgl:lwjgl-glfw::$lwjglNatives"
|
||||
@@ -63,11 +74,42 @@ dependencies {
|
||||
implementation "org.lwjgl:lwjgl-opengl::$lwjglNatives"
|
||||
implementation "org.lwjgl:lwjgl-stb::$lwjglNatives"
|
||||
implementation "org.lwjgl:lwjgl-nfd::$lwjglNatives"
|
||||
implementation "org.lwjgl:lwjgl-freetype::$lwjglNatives"
|
||||
implementation "org.lwjgl:lwjgl-harfbuzz::$lwjglNatives"
|
||||
implementation "org.lwjgl:lwjgl-nanovg::$lwjglNatives"
|
||||
implementation "org.jspecify:jspecify:1.0.0"
|
||||
|
||||
//Gson
|
||||
implementation 'com.google.code.gson:gson:2.8.6'
|
||||
|
||||
//Primitive Collections
|
||||
implementation 'de.speiger:Primitive-Collections:0.9.0'
|
||||
implementation 'de.speiger:Primitive-Collections:1.0.0'
|
||||
mathImplementation 'de.speiger:Primitive-Collections:1.0.0'
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes "Main-Class": 'speiger.src.coreengine.NewInputTest'
|
||||
}
|
||||
from {
|
||||
configurations.runtimeClasspath.collect {
|
||||
it.isDirectory() ? it : zipTree(it)
|
||||
}
|
||||
}
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
}
|
||||
|
||||
task srcJar(type: Jar) {
|
||||
from sourceSets.main.allSource
|
||||
archiveClassifier = 'sources'
|
||||
from {
|
||||
configurations.runtimeClasspath.collect {
|
||||
it.isDirectory() ? it : zipTree(it)
|
||||
}
|
||||
}
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives srcJar
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx2G
|
||||
|
||||
lwjglVersion = 3.3.3
|
||||
lwjglVersion = 3.3.4
|
||||
lwjglNatives = natives-windows
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -1,926 +0,0 @@
|
||||
#
|
||||
# A fatal error has been detected by the Java Runtime Environment:
|
||||
#
|
||||
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff8b13cc79d, pid=10428, tid=8228
|
||||
#
|
||||
# JRE version: Java(TM) SE Runtime Environment (19.0.2+7) (build 19.0.2+7-44)
|
||||
# Java VM: Java HotSpot(TM) 64-Bit Server VM (19.0.2+7-44, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
|
||||
# Problematic frame:
|
||||
# C [lwjgl_opengl.dll+0xc79d]
|
||||
#
|
||||
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
|
||||
#
|
||||
# If you would like to submit a bug report, please visit:
|
||||
# https://bugreport.java.com/bugreport/crash.jsp
|
||||
# The crash happened outside the Java Virtual Machine in native code.
|
||||
# See problematic frame for where to report the bug.
|
||||
#
|
||||
|
||||
--------------- S U M M A R Y ------------
|
||||
|
||||
Command Line: -XX:+ShowCodeDetailsInExceptionMessages -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:63099 -javaagent:C:\Users\Speiger\eclipse\java-2022-12\eclipse\configuration\org.eclipse.osgi\636\0\.cp\lib\javaagent-shaded.jar -Dfile.encoding=UTF-8 speiger.src.coreengine.Testing
|
||||
|
||||
Host: AMD Ryzen 9 7900 12-Core Processor , 24 cores, 31G, Windows 10 , 64 bit Build 19041 (10.0.19041.3031)
|
||||
Time: Mon Jun 19 04:06:52 2023 Mitteleuropäische Sommerzeit elapsed time: 0.310107 seconds (0d 0h 0m 0s)
|
||||
|
||||
--------------- T H R E A D ---------------
|
||||
|
||||
Current thread (0x0000023453c10460): JavaThread "main" [_thread_in_native, id=8228, stack(0x0000008f88700000,0x0000008f88800000)]
|
||||
|
||||
Stack: [0x0000008f88700000,0x0000008f88800000], sp=0x0000008f887ff4e8, free space=1021k
|
||||
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
|
||||
C [lwjgl_opengl.dll+0xc79d]
|
||||
|
||||
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
|
||||
j org.lwjgl.opengl.GL11C.nglGetBooleanv(IJ)V+0
|
||||
j org.lwjgl.opengl.GL11C.glGetBoolean(I)Z+20
|
||||
j org.lwjgl.opengl.GL11.glGetBoolean(I)Z+1
|
||||
j speiger.src.coreengine.Testing.main([Ljava/lang/String;)V+14
|
||||
v ~StubRoutines::call_stub 0x0000023462fd10e8
|
||||
|
||||
siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x00000000000002f0
|
||||
|
||||
|
||||
Registers:
|
||||
RAX=0x00000234062e9c50, RBX=0x00000234025b1728, RCX=0x000000000000809d, RDX=0x0000023406349008
|
||||
RSP=0x0000008f887ff4e8, RBP=0x0000008f887ff578, RSI=0x00000234022fff90, RDI=0x0000000000000001
|
||||
R8 =0x000000000000809d, R9 =0x0000023406349008, R10=0x0000000000000000, R11=0x000000062bb40c80
|
||||
R12=0x0000000000000000, R13=0x00000234025b1728, R14=0x0000008f887ff5a8, R15=0x0000023453c10460
|
||||
RIP=0x00007ff8b13cc79d, EFLAGS=0x0000000000010206
|
||||
|
||||
|
||||
Register to memory mapping:
|
||||
|
||||
RIP=0x00007ff8b13cc79d lwjgl_opengl.dll
|
||||
RAX=0x00000234062e9c50 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00
|
||||
RBX={method} {0x00000234025b1730} 'nglGetBooleanv' '(IJ)V' in 'org/lwjgl/opengl/GL11C'
|
||||
RCX=0x000000000000809d is an unknown value
|
||||
RDX=0x0000023406349008 points into unknown readable memory: 0x006200657a690000 | 00 00 69 7a 65 00 62 00
|
||||
RSP=0x0000008f887ff4e8 is pointing into the stack for thread: 0x0000023453c10460
|
||||
RBP=0x0000008f887ff578 is pointing into the stack for thread: 0x0000023453c10460
|
||||
RSI=0x00000234022fff90 is pointing into metadata
|
||||
RDI=0x0000000000000001 is an unknown value
|
||||
R8 =0x000000000000809d is an unknown value
|
||||
R9 =0x0000023406349008 points into unknown readable memory: 0x006200657a690000 | 00 00 69 7a 65 00 62 00
|
||||
R10=0x0 is NULL
|
||||
R11=0x000000062bb40c80 is an oop: java.lang.Class
|
||||
{0x000000062bb40c80} - klass: 'java/lang/Class'
|
||||
- ---- fields (total size 116 words):
|
||||
- private volatile transient 'classRedefinedCount' 'I' @12 0
|
||||
- abstract internal 'klass' 'J' @16 34376635896 (101d5f8 8)
|
||||
- abstract internal 'array_klass' 'J' @24 0 (0 0)
|
||||
- abstract internal 'oop_size' 'I' @32 116 (74)
|
||||
- abstract internal 'static_oop_field_count' 'I' @36 0
|
||||
- private volatile transient 'cachedConstructor' 'Ljava/lang/reflect/Constructor;' @40 NULL (0)
|
||||
- private transient 'name' 'Ljava/lang/String;' @44 "org.lwjgl.opengl.GL11C"{0x000000062bb41030} (c5768206)
|
||||
- private transient 'module' 'Ljava/lang/Module;' @48 a 'java/lang/Module'{0x000000062c86c9c8} (c590d939)
|
||||
- private final 'classLoader' 'Ljava/lang/ClassLoader;' @52 a 'jdk/internal/loader/ClassLoaders$AppClassLoader'{0x000000062c86c808} (c590d901)
|
||||
- private transient 'classData' 'Ljava/lang/Object;' @56 NULL (0)
|
||||
- private transient 'packageName' 'Ljava/lang/String;' @60 "org.lwjgl.opengl"{0x000000062c198a70} (c583314e)
|
||||
- private final 'componentType' 'Ljava/lang/Class;' @64 NULL (0)
|
||||
- private volatile transient 'reflectionData' 'Ljava/lang/ref/SoftReference;' @68 NULL (0)
|
||||
- private volatile transient 'genericInfo' 'Lsun/reflect/generics/repository/ClassRepository;' @72 NULL (0)
|
||||
- private volatile transient 'enumConstants' '[Ljava/lang/Object;' @76 NULL (0)
|
||||
- private volatile transient 'enumConstantDirectory' 'Ljava/util/Map;' @80 NULL (0)
|
||||
- private volatile transient 'annotationData' 'Ljava/lang/Class$AnnotationData;' @84 NULL (0)
|
||||
- private volatile transient 'annotationType' 'Lsun/reflect/annotation/AnnotationType;' @88 NULL (0)
|
||||
- transient 'classValueMap' 'Ljava/lang/ClassValue$ClassValueMap;' @92 NULL (0)
|
||||
- abstract internal 'protection_domain' 'Ljava/lang/Object;' @96 a 'java/security/ProtectionDomain'{0x000000062c1a5658} (c5834acb)
|
||||
- abstract internal 'signers_name' 'Ljava/lang/Object;' @100 NULL (0)
|
||||
- abstract internal 'source_file' 'Ljava/lang/Object;' @104 NULL (0)
|
||||
- signature: Lorg/lwjgl/opengl/GL11C;
|
||||
- ---- static fields (0):
|
||||
- public static final 'GL_NEVER' 'I' @112 512 (200)
|
||||
- public static final 'GL_LESS' 'I' @116 513 (201)
|
||||
- public static final 'GL_EQUAL' 'I' @120 514 (202)
|
||||
- public static final 'GL_LEQUAL' 'I' @124 515 (203)
|
||||
- public static final 'GL_GREATER' 'I' @128 516 (204)
|
||||
- public static final 'GL_NOTEQUAL' 'I' @132 517 (205)
|
||||
- public static final 'GL_GEQUAL' 'I' @136 518 (206)
|
||||
- public static final 'GL_ALWAYS' 'I' @140 519 (207)
|
||||
- public static final 'GL_DEPTH_BUFFER_BIT' 'I' @144 256 (100)
|
||||
- public static final 'GL_STENCIL_BUFFER_BIT' 'I' @148 1024 (400)
|
||||
- public static final 'GL_COLOR_BUFFER_BIT' 'I' @152 16384 (4000)
|
||||
- public static final 'GL_POINTS' 'I' @156 0
|
||||
- public static final 'GL_LINES' 'I' @160 1
|
||||
- public static final 'GL_LINE_LOOP' 'I' @164 2
|
||||
- public static final 'GL_LINE_STRIP' 'I' @168 3
|
||||
- public static final 'GL_TRIANGLES' 'I' @172 4
|
||||
- public static final 'GL_TRIANGLE_STRIP' 'I' @176 5
|
||||
- public static final 'GL_TRIANGLE_FAN' 'I' @180 6
|
||||
- public static final 'GL_QUADS' 'I' @184 7
|
||||
- public static final 'GL_ZERO' 'I' @188 0
|
||||
- public static final 'GL_ONE' 'I' @192 1
|
||||
- public static final 'GL_SRC_COLOR' 'I' @196 768 (300)
|
||||
- public static final 'GL_ONE_MINUS_SRC_COLOR' 'I' @200 769 (301)
|
||||
- public static final 'GL_SRC_ALPHA' 'I' @204 770 (302)
|
||||
- public static final 'GL_ONE_MINUS_SRC_ALPHA' 'I' @208 771 (303)
|
||||
- public static final 'GL_DST_ALPHA' 'I' @212 772 (304)
|
||||
- public static final 'GL_ONE_MINUS_DST_ALPHA' 'I' @216 773 (305)
|
||||
- public static final 'GL_DST_COLOR' 'I' @220 774 (306)
|
||||
- public static final 'GL_ONE_MINUS_DST_COLOR' 'I' @224 775 (307)
|
||||
- public static final 'GL_SRC_ALPHA_SATURATE' 'I' @228 776 (308)
|
||||
- public static final 'GL_TRUE' 'I' @232 1
|
||||
- public static final 'GL_FALSE' 'I' @236 0
|
||||
- public static final 'GL_BYTE' 'I' @240 5120 (1400)
|
||||
- public static final 'GL_UNSIGNED_BYTE' 'I' @244 5121 (1401)
|
||||
- public static final 'GL_SHORT' 'I' @248 5122 (1402)
|
||||
- public static final 'GL_UNSIGNED_SHORT' 'I' @252 5123 (1403)
|
||||
- public static final 'GL_INT' 'I' @256 5124 (1404)
|
||||
- public static final 'GL_UNSIGNED_INT' 'I' @260 5125 (1405)
|
||||
- public static final 'GL_FLOAT' 'I' @264 5126 (1406)
|
||||
- public static final 'GL_DOUBLE' 'I' @268 5130 (140a)
|
||||
- public static final 'GL_NONE' 'I' @272 0
|
||||
- public static final 'GL_FRONT_LEFT' 'I' @276 1024 (400)
|
||||
- public static final 'GL_FRONT_RIGHT' 'I' @280 1025 (401)
|
||||
- public static final 'GL_BACK_LEFT' 'I' @284 1026 (402)
|
||||
- public static final 'GL_BACK_RIGHT' 'I' @288 1027 (403)
|
||||
- public static final 'GL_FRONT' 'I' @292 1028 (404)
|
||||
- public static final 'GL_BACK' 'I' @296 1029 (405)
|
||||
- public static final 'GL_LEFT' 'I' @300 1030 (406)
|
||||
- public static final 'GL_RIGHT' 'I' @304 1031 (407)
|
||||
- public static final 'GL_FRONT_AND_BACK' 'I' @308 1032 (408)
|
||||
- public static final 'GL_NO_ERROR' 'I' @312 0
|
||||
- public static final 'GL_INVALID_ENUM' 'I' @316 1280 (500)
|
||||
- public static final 'GL_INVALID_VALUE' 'I' @320 1281 (501)
|
||||
- public static final 'GL_INVALID_OPERATION' 'I' @324 1282 (502)
|
||||
- public static final 'GL_STACK_OVERFLOW' 'I' @328 1283 (503)
|
||||
- public static final 'GL_STACK_UNDERFLOW' 'I' @332 1284 (504)
|
||||
- public static final 'GL_OUT_OF_MEMORY' 'I' @336 1285 (505)
|
||||
- public static final 'GL_CW' 'I' @340 2304 (900)
|
||||
- public static final 'GL_CCW' 'I' @344 2305 (901)
|
||||
- public static final 'GL_POINT_SIZE' 'I' @348 2833 (b11)
|
||||
- public static final 'GL_POINT_SIZE_RANGE' 'I' @352 2834 (b12)
|
||||
- public static final 'GL_POINT_SIZE_GRANULARITY' 'I' @356 2835 (b13)
|
||||
- public static final 'GL_LINE_SMOOTH' 'I' @360 2848 (b20)
|
||||
- public static final 'GL_LINE_WIDTH' 'I' @364 2849 (b21)
|
||||
- public static final 'GL_LINE_WIDTH_RANGE' 'I' @368 2850 (b22)
|
||||
- public static final 'GL_LINE_WIDTH_GRANULARITY' 'I' @372 2851 (b23)
|
||||
- public static final 'GL_POLYGON_MODE' 'I' @376 2880 (b40)
|
||||
- public static final 'GL_POLYGON_SMOOTH' 'I' @380 2881 (b41)
|
||||
- public static final 'GL_CULL_FACE' 'I' @384 2884 (b44)
|
||||
- public static final 'GL_CULL_FACE_MODE' 'I' @388 2885 (b45)
|
||||
- public static final 'GL_FRONT_FACE' 'I' @392 2886 (b46)
|
||||
- public static final 'GL_DEPTH_RANGE' 'I' @396 2928 (b70)
|
||||
- public static final 'GL_DEPTH_TEST' 'I' @400 2929 (b71)
|
||||
- public static final 'GL_DEPTH_WRITEMASK' 'I' @404 2930 (b72)
|
||||
- public static final 'GL_DEPTH_CLEAR_VALUE' 'I' @408 2931 (b73)
|
||||
- public static final 'GL_DEPTH_FUNC' 'I' @412 2932 (b74)
|
||||
- public static final 'GL_STENCIL_TEST' 'I' @416 2960 (b90)
|
||||
- public static final 'GL_STENCIL_CLEAR_VALUE' 'I' @420 2961 (b91)
|
||||
- public static final 'GL_STENCIL_FUNC' 'I' @424 2962 (b92)
|
||||
- public static final 'GL_STENCIL_VALUE_MASK' 'I' @428 2963 (b93)
|
||||
- public static final 'GL_STENCIL_FAIL' 'I' @432 2964 (b94)
|
||||
- public static final 'GL_STENCIL_PASS_DEPTH_FAIL' 'I' @436 2965 (b95)
|
||||
- public static final 'GL_STENCIL_PASS_DEPTH_PASS' 'I' @440 2966 (b96)
|
||||
- public static final 'GL_STENCIL_REF' 'I' @444 2967 (b97)
|
||||
- public static final 'GL_STENCIL_WRITEMASK' 'I' @448 2968 (b98)
|
||||
- public static final 'GL_VIEWPORT' 'I' @452 2978 (ba2)
|
||||
- public static final 'GL_DITHER' 'I' @456 3024 (bd0)
|
||||
- public static final 'GL_BLEND_DST' 'I' @460 3040 (be0)
|
||||
- public static final 'GL_BLEND_SRC' 'I' @464 3041 (be1)
|
||||
- public static final 'GL_BLEND' 'I' @468 3042 (be2)
|
||||
- public static final 'GL_LOGIC_OP_MODE' 'I' @472 3056 (bf0)
|
||||
- public static final 'GL_COLOR_LOGIC_OP' 'I' @476 3058 (bf2)
|
||||
- public static final 'GL_DRAW_BUFFER' 'I' @480 3073 (c01)
|
||||
- public static final 'GL_READ_BUFFER' 'I' @484 3074 (c02)
|
||||
- public static final 'GL_SCISSOR_BOX' 'I' @488 3088 (c10)
|
||||
- public static final 'GL_SCISSOR_TEST' 'I' @492 3089 (c11)
|
||||
- public static final 'GL_COLOR_CLEAR_VALUE' 'I' @496 3106 (c22)
|
||||
- public static final 'GL_COLOR_WRITEMASK' 'I' @500 3107 (c23)
|
||||
- public static final 'GL_DOUBLEBUFFER' 'I' @504 3122 (c32)
|
||||
- public static final 'GL_STEREO' 'I' @508 3123 (c33)
|
||||
- public static final 'GL_LINE_SMOOTH_HINT' 'I' @512 3154 (c52)
|
||||
- public static final 'GL_POLYGON_SMOOTH_HINT' 'I' @516 3155 (c53)
|
||||
- public static final 'GL_UNPACK_SWAP_BYTES' 'I' @520 3312 (cf0)
|
||||
- public static final 'GL_UNPACK_LSB_FIRST' 'I' @524 3313 (cf1)
|
||||
- public static final 'GL_UNPACK_ROW_LENGTH' 'I' @528 3314 (cf2)
|
||||
- public static final 'GL_UNPACK_SKIP_ROWS' 'I' @532 3315 (cf3)
|
||||
- public static final 'GL_UNPACK_SKIP_PIXELS' 'I' @536 3316 (cf4)
|
||||
- public static final 'GL_UNPACK_ALIGNMENT' 'I' @540 3317 (cf5)
|
||||
- public static final 'GL_PACK_SWAP_BYTES' 'I' @544 3328 (d00)
|
||||
- public static final 'GL_PACK_LSB_FIRST' 'I' @548 3329 (d01)
|
||||
- public static final 'GL_PACK_ROW_LENGTH' 'I' @552 3330 (d02)
|
||||
- public static final 'GL_PACK_SKIP_ROWS' 'I' @556 3331 (d03)
|
||||
- public static final 'GL_PACK_SKIP_PIXELS' 'I' @560 3332 (d04)
|
||||
- public static final 'GL_PACK_ALIGNMENT' 'I' @564 3333 (d05)
|
||||
- public static final 'GL_MAX_TEXTURE_SIZE' 'I' @568 3379 (d33)
|
||||
- public static final 'GL_MAX_VIEWPORT_DIMS' 'I' @572 3386 (d3a)
|
||||
- public static final 'GL_SUBPIXEL_BITS' 'I' @576 3408 (d50)
|
||||
- public static final 'GL_TEXTURE_1D' 'I' @580 3552 (de0)
|
||||
- public static final 'GL_TEXTURE_2D' 'I' @584 3553 (de1)
|
||||
- public static final 'GL_TEXTURE_WIDTH' 'I' @588 4096 (1000)
|
||||
- public static final 'GL_TEXTURE_HEIGHT' 'I' @592 4097 (1001)
|
||||
- public static final 'GL_TEXTURE_INTERNAL_FORMAT' 'I' @596 4099 (1003)
|
||||
- public static final 'GL_TEXTURE_BORDER_COLOR' 'I' @600 4100 (1004)
|
||||
- public static final 'GL_DONT_CARE' 'I' @604 4352 (1100)
|
||||
- public static final 'GL_FASTEST' 'I' @608 4353 (1101)
|
||||
- public static final 'GL_NICEST' 'I' @612 4354 (1102)
|
||||
- public static final 'GL_CLEAR' 'I' @616 5376 (1500)
|
||||
- public static final 'GL_AND' 'I' @620 5377 (1501)
|
||||
- public static final 'GL_AND_REVERSE' 'I' @624 5378 (1502)
|
||||
- public static final 'GL_COPY' 'I' @628 5379 (1503)
|
||||
- public static final 'GL_AND_INVERTED' 'I' @632 5380 (1504)
|
||||
- public static final 'GL_NOOP' 'I' @636 5381 (1505)
|
||||
- public static final 'GL_XOR' 'I' @640 5382 (1506)
|
||||
- public static final 'GL_OR' 'I' @644 5383 (1507)
|
||||
- public static final 'GL_NOR' 'I' @648 5384 (1508)
|
||||
- public static final 'GL_EQUIV' 'I' @652 5385 (1509)
|
||||
- public static final 'GL_INVERT' 'I' @656 5386 (150a)
|
||||
- public static final 'GL_OR_REVERSE' 'I' @660 5387 (150b)
|
||||
- public static final 'GL_COPY_INVERTED' 'I' @664 5388 (150c)
|
||||
- public static final 'GL_OR_INVERTED' 'I' @668 5389 (150d)
|
||||
- public static final 'GL_NAND' 'I' @672 5390 (150e)
|
||||
- public static final 'GL_SET' 'I' @676 5391 (150f)
|
||||
- public static final 'GL_TEXTURE' 'I' @680 5890 (1702)
|
||||
- public static final 'GL_COLOR' 'I' @684 6144 (1800)
|
||||
- public static final 'GL_DEPTH' 'I' @688 6145 (1801)
|
||||
- public static final 'GL_STENCIL' 'I' @692 6146 (1802)
|
||||
- public static final 'GL_STENCIL_INDEX' 'I' @696 6401 (1901)
|
||||
- public static final 'GL_DEPTH_COMPONENT' 'I' @700 6402 (1902)
|
||||
- public static final 'GL_RED' 'I' @704 6403 (1903)
|
||||
- public static final 'GL_GREEN' 'I' @708 6404 (1904)
|
||||
- public static final 'GL_BLUE' 'I' @712 6405 (1905)
|
||||
- public static final 'GL_ALPHA' 'I' @716 6406 (1906)
|
||||
- public static final 'GL_RGB' 'I' @720 6407 (1907)
|
||||
- public static final 'GL_RGBA' 'I' @724 6408 (1908)
|
||||
- public static final 'GL_POINT' 'I' @728 6912 (1b00)
|
||||
- public static final 'GL_LINE' 'I' @732 6913 (1b01)
|
||||
- public static final 'GL_FILL' 'I' @736 6914 (1b02)
|
||||
- public static final 'GL_KEEP' 'I' @740 7680 (1e00)
|
||||
- public static final 'GL_REPLACE' 'I' @744 7681 (1e01)
|
||||
- public static final 'GL_INCR' 'I' @748 7682 (1e02)
|
||||
- public static final 'GL_DECR' 'I' @752 7683 (1e03)
|
||||
- public static final 'GL_VENDOR' 'I' @756 7936 (1f00)
|
||||
- public static final 'GL_RENDERER' 'I' @760 7937 (1f01)
|
||||
- public static final 'GL_VERSION' 'I' @764 7938 (1f02)
|
||||
- public static final 'GL_EXTENSIONS' 'I' @768 7939 (1f03)
|
||||
- public static final 'GL_NEAREST' 'I' @772 9728 (2600)
|
||||
- public static final 'GL_LINEAR' 'I' @776 9729 (2601)
|
||||
- public static final 'GL_NEAREST_MIPMAP_NEAREST' 'I' @780 9984 (2700)
|
||||
- public static final 'GL_LINEAR_MIPMAP_NEAREST' 'I' @784 9985 (2701)
|
||||
- public static final 'GL_NEAREST_MIPMAP_LINEAR' 'I' @788 9986 (2702)
|
||||
- public static final 'GL_LINEAR_MIPMAP_LINEAR' 'I' @792 9987 (2703)
|
||||
- public static final 'GL_TEXTURE_MAG_FILTER' 'I' @796 10240 (2800)
|
||||
- public static final 'GL_TEXTURE_MIN_FILTER' 'I' @800 10241 (2801)
|
||||
- public static final 'GL_TEXTURE_WRAP_S' 'I' @804 10242 (2802)
|
||||
- public static final 'GL_TEXTURE_WRAP_T' 'I' @808 10243 (2803)
|
||||
- public static final 'GL_REPEAT' 'I' @812 10497 (2901)
|
||||
- public static final 'GL_POLYGON_OFFSET_FACTOR' 'I' @816 32824 (8038)
|
||||
- public static final 'GL_POLYGON_OFFSET_UNITS' 'I' @820 10752 (2a00)
|
||||
- public static final 'GL_POLYGON_OFFSET_POINT' 'I' @824 10753 (2a01)
|
||||
- public static final 'GL_POLYGON_OFFSET_LINE' 'I' @828 10754 (2a02)
|
||||
- public static final 'GL_POLYGON_OFFSET_FILL' 'I' @832 32823 (8037)
|
||||
- public static final 'GL_R3_G3_B2' 'I' @836 10768 (2a10)
|
||||
- public static final 'GL_RGB4' 'I' @840 32847 (804f)
|
||||
- public static final 'GL_RGB5' 'I' @844 32848 (8050)
|
||||
- public static final 'GL_RGB8' 'I' @848 32849 (8051)
|
||||
- public static final 'GL_RGB10' 'I' @852 32850 (8052)
|
||||
- public static final 'GL_RGB12' 'I' @856 32851 (8053)
|
||||
- public static final 'GL_RGB16' 'I' @860 32852 (8054)
|
||||
- public static final 'GL_RGBA2' 'I' @864 32853 (8055)
|
||||
- public static final 'GL_RGBA4' 'I' @868 32854 (8056)
|
||||
- public static final 'GL_RGB5_A1' 'I' @872 32855 (8057)
|
||||
- public static final 'GL_RGBA8' 'I' @876 32856 (8058)
|
||||
- public static final 'GL_RGB10_A2' 'I' @880 32857 (8059)
|
||||
- public static final 'GL_RGBA12' 'I' @884 32858 (805a)
|
||||
- public static final 'GL_RGBA16' 'I' @888 32859 (805b)
|
||||
- public static final 'GL_TEXTURE_RED_SIZE' 'I' @892 32860 (805c)
|
||||
- public static final 'GL_TEXTURE_GREEN_SIZE' 'I' @896 32861 (805d)
|
||||
- public static final 'GL_TEXTURE_BLUE_SIZE' 'I' @900 32862 (805e)
|
||||
- public static final 'GL_TEXTURE_ALPHA_SIZE' 'I' @904 32863 (805f)
|
||||
- public static final 'GL_PROXY_TEXTURE_1D' 'I' @908 32867 (8063)
|
||||
- public static final 'GL_PROXY_TEXTURE_2D' 'I' @912 32868 (8064)
|
||||
- public static final 'GL_TEXTURE_BINDING_1D' 'I' @916 32872 (8068)
|
||||
- public static final 'GL_TEXTURE_BINDING_2D' 'I' @920 32873 (8069)
|
||||
- public static final 'GL_VERTEX_ARRAY' 'I' @924 32884 (8074)
|
||||
R12=0x0 is NULL
|
||||
R13={method} {0x00000234025b1730} 'nglGetBooleanv' '(IJ)V' in 'org/lwjgl/opengl/GL11C'
|
||||
R14=0x0000008f887ff5a8 is pointing into the stack for thread: 0x0000023453c10460
|
||||
R15=0x0000023453c10460 is a thread
|
||||
|
||||
|
||||
Top of Stack: (sp=0x0000008f887ff4e8)
|
||||
0x0000008f887ff4e8: 0000023462ff3478 0000000000000001
|
||||
0x0000008f887ff4f8: 0000023462ff2dba 00000234025b1728
|
||||
0x0000008f887ff508: 00000234022fff90 0000000000000000
|
||||
0x0000008f887ff518: 0000008f887ff530 0000008f887ff590
|
||||
0x0000008f887ff528: 0000023462ff2d76 0000008f887ff530
|
||||
0x0000008f887ff538: 00000234025b1728 0000008f887ff5a8
|
||||
0x0000008f887ff548: 00000234025bb7d8 0000000000000000
|
||||
0x0000008f887ff558: 000000062bb40c80 00000234025b1728
|
||||
0x0000008f887ff568: 0000000000000000 0000008f887ff598
|
||||
0x0000008f887ff578: 0000008f887ff5f8 0000023462fec11a
|
||||
0x0000008f887ff588: 000000062bb40c80 0000023462fef557
|
||||
0x0000008f887ff598: 0000023406349008 0000000000000000
|
||||
0x0000008f887ff5a8: 000000000000809d 0000008f887ff5b0
|
||||
0x0000008f887ff5b8: 00000234025b18dc 0000008f887ff630
|
||||
0x0000008f887ff5c8: 00000234025bb7d8 0000000000000000
|
||||
0x0000008f887ff5d8: 000000062bb40c80 00000234025b1968
|
||||
|
||||
Instructions: (pc=0x00007ff8b13cc79d)
|
||||
0x00007ff8b13cc69d: cc cc cc 48 8b 01 45 8b d8 44 8b 44 24 28 41 8b
|
||||
0x00007ff8b13cc6ad: d1 41 8b cb 4c 8b 50 18 49 ff a2 e8 01 00 00 cc
|
||||
0x00007ff8b13cc6bd: cc cc cc 48 8b 01 41 8b c8 48 8b 50 18 48 ff a2
|
||||
0x00007ff8b13cc6cd: f0 01 00 00 cc cc cc cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc6dd: cc cc cc 40 53 48 8b 01 41 8b d8 44 8b 44 24 30
|
||||
0x00007ff8b13cc6ed: 41 8b d1 4c 8b 4c 24 38 8b cb 4c 8b 50 18 5b 49
|
||||
0x00007ff8b13cc6fd: ff a2 f8 01 00 00 cc cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc70d: cc cc cc 48 8b 01 48 8b 48 18 48 ff a1 98 02 00
|
||||
0x00007ff8b13cc71d: 00 cc cc 48 8b 01 48 8b 48 18 48 ff a1 a0 02 00
|
||||
0x00007ff8b13cc72d: 00 cc cc 48 8b 01 41 8b c8 48 8b 50 18 48 ff a2
|
||||
0x00007ff8b13cc73d: c8 02 00 00 cc cc cc cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc74d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc75d: 49 ff a2 d8 02 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc76d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc77d: 49 ff a2 e0 02 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc78d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc79d: 49 ff a2 f0 02 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc7ad: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc7bd: 49 ff a2 f8 02 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc7cd: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc7dd: 49 ff a2 00 03 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc7ed: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc7fd: 49 ff a2 08 03 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc80d: cc cc cc 48 8b 01 48 8b 48 18 48 8b 81 10 03 00
|
||||
0x00007ff8b13cc81d: 00 48 ff e0 cc cc cc cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc82d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc83d: 49 ff a2 68 03 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc84d: cc cc cc 48 8b 01 48 8b 48 18 48 8b 81 78 03 00
|
||||
0x00007ff8b13cc85d: 00 41 8b c8 48 ff e0 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc86d: cc cc cc 40 53 48 8b 01 41 8b d8 44 8b 44 24 30
|
||||
0x00007ff8b13cc87d: 41 8b d1 44 8b 4c 24 38 8b cb 4c 8b 50 18 48 8b
|
||||
0x00007ff8b13cc88d: 44 24 40 48 89 44 24 30 5b 49 ff a2 a8 03 00 00
|
||||
|
||||
|
||||
Stack slot to memory mapping:
|
||||
stack at sp + 0 slots: 0x0000023462ff3478 is at code_begin+1976 in an Interpreter codelet
|
||||
method entry point (kind = native) [0x0000023462ff2cc0, 0x0000023462ff4000] 4928 bytes
|
||||
stack at sp + 1 slots: 0x0000000000000001 is an unknown value
|
||||
stack at sp + 2 slots: 0x0000023462ff2dba is at code_begin+250 in an Interpreter codelet
|
||||
method entry point (kind = native) [0x0000023462ff2cc0, 0x0000023462ff4000] 4928 bytes
|
||||
stack at sp + 3 slots: {method} {0x00000234025b1730} 'nglGetBooleanv' '(IJ)V' in 'org/lwjgl/opengl/GL11C'
|
||||
stack at sp + 4 slots: 0x00000234022fff90 is pointing into metadata
|
||||
stack at sp + 5 slots: 0x0 is NULL
|
||||
stack at sp + 6 slots: 0x0000008f887ff530 is pointing into the stack for thread: 0x0000023453c10460
|
||||
stack at sp + 7 slots: 0x0000008f887ff590 is pointing into the stack for thread: 0x0000023453c10460
|
||||
|
||||
|
||||
--------------- P R O C E S S ---------------
|
||||
|
||||
Threads class SMR info:
|
||||
_java_thread_list=0x000002347fb81600, length=18, elements={
|
||||
0x0000023453c10460, 0x000002347e65ecb0, 0x000002347e660120, 0x000002347e6625a0,
|
||||
0x000002347e664ee0, 0x000002347e6682e0, 0x000002347e66cbf0, 0x000002347e673540,
|
||||
0x000002347e677fd0, 0x000002347e68cd10, 0x000002347e68c270, 0x000002347f904e70,
|
||||
0x000002347f907810, 0x000002347f9b69e0, 0x000002347fabebd0, 0x000002347fabf520,
|
||||
0x000002347fb8ae70, 0x000002347e68b280
|
||||
}
|
||||
|
||||
Java Threads: ( => current thread )
|
||||
=>0x0000023453c10460 JavaThread "main" [_thread_in_native, id=8228, stack(0x0000008f88700000,0x0000008f88800000)]
|
||||
0x000002347e65ecb0 JavaThread "Reference Handler" daemon [_thread_blocked, id=4572, stack(0x0000008f88e00000,0x0000008f88f00000)]
|
||||
0x000002347e660120 JavaThread "Finalizer" daemon [_thread_blocked, id=14964, stack(0x0000008f88f00000,0x0000008f89000000)]
|
||||
0x000002347e6625a0 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=13492, stack(0x0000008f89000000,0x0000008f89100000)]
|
||||
0x000002347e664ee0 JavaThread "Attach Listener" daemon [_thread_blocked, id=6888, stack(0x0000008f89100000,0x0000008f89200000)]
|
||||
0x000002347e6682e0 JavaThread "Service Thread" daemon [_thread_blocked, id=728, stack(0x0000008f89200000,0x0000008f89300000)]
|
||||
0x000002347e66cbf0 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=18136, stack(0x0000008f89300000,0x0000008f89400000)]
|
||||
0x000002347e673540 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=9016, stack(0x0000008f89400000,0x0000008f89500000)]
|
||||
0x000002347e677fd0 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=13344, stack(0x0000008f89500000,0x0000008f89600000)]
|
||||
0x000002347e68cd10 JavaThread "Sweeper thread" daemon [_thread_blocked, id=1584, stack(0x0000008f89600000,0x0000008f89700000)]
|
||||
0x000002347e68c270 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=14728, stack(0x0000008f89700000,0x0000008f89800000)]
|
||||
0x000002347f904e70 JavaThread "C1 CompilerThread1" daemon [_thread_blocked, id=6828, stack(0x0000008f89800000,0x0000008f89900000)]
|
||||
0x000002347f907810 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=8444, stack(0x0000008f89900000,0x0000008f89a00000)]
|
||||
0x000002347f9b69e0 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=3880, stack(0x0000008f89a00000,0x0000008f89b00000)]
|
||||
0x000002347fabebd0 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=19600, stack(0x0000008f89b00000,0x0000008f89c00000)]
|
||||
0x000002347fabf520 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=19804, stack(0x0000008f89c00000,0x0000008f89d00000)]
|
||||
0x000002347fb8ae70 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=7232, stack(0x0000008f89d00000,0x0000008f89e00000)]
|
||||
0x000002347e68b280 JavaThread "Notification Thread" daemon [_thread_blocked, id=10452, stack(0x0000008f89e00000,0x0000008f89f00000)]
|
||||
|
||||
Other Threads:
|
||||
0x0000023453c336a0 VMThread "VM Thread" [stack: 0x0000008f88d00000,0x0000008f88e00000] [id=16992]
|
||||
0x00000234061a4250 WatcherThread "VM Periodic Task Thread" [stack: 0x0000008f89f00000,0x0000008f8a000000] [id=7680]
|
||||
0x0000023453c344b0 WorkerThread "GC Thread#0" [stack: 0x0000008f88800000,0x0000008f88900000] [id=4880]
|
||||
0x0000023453cd3340 ConcurrentGCThread "G1 Main Marker" [stack: 0x0000008f88900000,0x0000008f88a00000] [id=12608]
|
||||
0x0000023453c333d0 WorkerThread "G1 Conc#0" [stack: 0x0000008f88a00000,0x0000008f88b00000] [id=4216]
|
||||
0x000002347e580c20 ConcurrentGCThread "G1 Refine#0" [stack: 0x0000008f88b00000,0x0000008f88c00000] [id=12096]
|
||||
0x000002347e582520 ConcurrentGCThread "G1 Service" [stack: 0x0000008f88c00000,0x0000008f88d00000] [id=2688]
|
||||
|
||||
Threads with active compile tasks:
|
||||
|
||||
VM state: not at safepoint (normal execution)
|
||||
|
||||
VM Mutex/Monitor currently owned by a thread: None
|
||||
|
||||
Heap address: 0x000000060d800000, size: 7976 MB, Compressed Oops mode: Zero based, Oop shift amount: 3
|
||||
|
||||
CDS archive(s) mapped at: [0x0000000800000000-0x0000000800c40000-0x0000000800c40000), size 12845056, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 0.
|
||||
Compressed class space mapped at: 0x0000000801000000-0x0000000841000000, reserved size: 1073741824
|
||||
Narrow klass base: 0x0000000800000000, Narrow klass shift: 0, Narrow klass range: 0x100000000
|
||||
|
||||
GC Precious Log:
|
||||
CardTable entry size: 512
|
||||
Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 32 size 80 Howl #buckets 8 coarsen threshold 7372 Howl Bitmap #cards 1024 size 144 coarsen threshold 921 Card regions per heap region 1 cards per card region 8192
|
||||
CPUs: 24 total, 24 available
|
||||
Memory: 31894M
|
||||
Large Page Support: Disabled
|
||||
NUMA Support: Disabled
|
||||
Compressed Oops: Enabled (Zero based)
|
||||
Heap Region Size: 4M
|
||||
Heap Min Capacity: 8M
|
||||
Heap Initial Capacity: 500M
|
||||
Heap Max Capacity: 7976M
|
||||
Pre-touch: Disabled
|
||||
Parallel Workers: 18
|
||||
Concurrent Workers: 5
|
||||
Concurrent Refinement Workers: 18
|
||||
Periodic GC: Disabled
|
||||
|
||||
Heap:
|
||||
garbage-first heap total 512000K, used 16384K [0x000000060d800000, 0x0000000800000000)
|
||||
region size 4096K, 5 young (20480K), 0 survivors (0K)
|
||||
Metaspace used 5191K, committed 5376K, reserved 1114112K
|
||||
class space used 367K, committed 448K, reserved 1048576K
|
||||
|
||||
Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, OA=open archive, CA=closed archive, TAMS=top-at-mark-start (previous, next)
|
||||
| 0|0x000000060d800000, 0x000000060d800000, 0x000000060dc00000| 0%| F| |TAMS 0x000000060d800000, 0x000000060d800000| Untracked
|
||||
| 1|0x000000060dc00000, 0x000000060dc00000, 0x000000060e000000| 0%| F| |TAMS 0x000000060dc00000, 0x000000060dc00000| Untracked
|
||||
| 2|0x000000060e000000, 0x000000060e000000, 0x000000060e400000| 0%| F| |TAMS 0x000000060e000000, 0x000000060e000000| Untracked
|
||||
| 3|0x000000060e400000, 0x000000060e400000, 0x000000060e800000| 0%| F| |TAMS 0x000000060e400000, 0x000000060e400000| Untracked
|
||||
| 4|0x000000060e800000, 0x000000060e800000, 0x000000060ec00000| 0%| F| |TAMS 0x000000060e800000, 0x000000060e800000| Untracked
|
||||
| 5|0x000000060ec00000, 0x000000060ec00000, 0x000000060f000000| 0%| F| |TAMS 0x000000060ec00000, 0x000000060ec00000| Untracked
|
||||
| 6|0x000000060f000000, 0x000000060f000000, 0x000000060f400000| 0%| F| |TAMS 0x000000060f000000, 0x000000060f000000| Untracked
|
||||
| 7|0x000000060f400000, 0x000000060f400000, 0x000000060f800000| 0%| F| |TAMS 0x000000060f400000, 0x000000060f400000| Untracked
|
||||
| 8|0x000000060f800000, 0x000000060f800000, 0x000000060fc00000| 0%| F| |TAMS 0x000000060f800000, 0x000000060f800000| Untracked
|
||||
| 9|0x000000060fc00000, 0x000000060fc00000, 0x0000000610000000| 0%| F| |TAMS 0x000000060fc00000, 0x000000060fc00000| Untracked
|
||||
| 10|0x0000000610000000, 0x0000000610000000, 0x0000000610400000| 0%| F| |TAMS 0x0000000610000000, 0x0000000610000000| Untracked
|
||||
| 11|0x0000000610400000, 0x0000000610400000, 0x0000000610800000| 0%| F| |TAMS 0x0000000610400000, 0x0000000610400000| Untracked
|
||||
| 12|0x0000000610800000, 0x0000000610800000, 0x0000000610c00000| 0%| F| |TAMS 0x0000000610800000, 0x0000000610800000| Untracked
|
||||
| 13|0x0000000610c00000, 0x0000000610c00000, 0x0000000611000000| 0%| F| |TAMS 0x0000000610c00000, 0x0000000610c00000| Untracked
|
||||
| 14|0x0000000611000000, 0x0000000611000000, 0x0000000611400000| 0%| F| |TAMS 0x0000000611000000, 0x0000000611000000| Untracked
|
||||
| 15|0x0000000611400000, 0x0000000611400000, 0x0000000611800000| 0%| F| |TAMS 0x0000000611400000, 0x0000000611400000| Untracked
|
||||
| 16|0x0000000611800000, 0x0000000611800000, 0x0000000611c00000| 0%| F| |TAMS 0x0000000611800000, 0x0000000611800000| Untracked
|
||||
| 17|0x0000000611c00000, 0x0000000611c00000, 0x0000000612000000| 0%| F| |TAMS 0x0000000611c00000, 0x0000000611c00000| Untracked
|
||||
| 18|0x0000000612000000, 0x0000000612000000, 0x0000000612400000| 0%| F| |TAMS 0x0000000612000000, 0x0000000612000000| Untracked
|
||||
| 19|0x0000000612400000, 0x0000000612400000, 0x0000000612800000| 0%| F| |TAMS 0x0000000612400000, 0x0000000612400000| Untracked
|
||||
| 20|0x0000000612800000, 0x0000000612800000, 0x0000000612c00000| 0%| F| |TAMS 0x0000000612800000, 0x0000000612800000| Untracked
|
||||
| 21|0x0000000612c00000, 0x0000000612c00000, 0x0000000613000000| 0%| F| |TAMS 0x0000000612c00000, 0x0000000612c00000| Untracked
|
||||
| 22|0x0000000613000000, 0x0000000613000000, 0x0000000613400000| 0%| F| |TAMS 0x0000000613000000, 0x0000000613000000| Untracked
|
||||
| 23|0x0000000613400000, 0x0000000613400000, 0x0000000613800000| 0%| F| |TAMS 0x0000000613400000, 0x0000000613400000| Untracked
|
||||
| 24|0x0000000613800000, 0x0000000613800000, 0x0000000613c00000| 0%| F| |TAMS 0x0000000613800000, 0x0000000613800000| Untracked
|
||||
| 25|0x0000000613c00000, 0x0000000613c00000, 0x0000000614000000| 0%| F| |TAMS 0x0000000613c00000, 0x0000000613c00000| Untracked
|
||||
| 26|0x0000000614000000, 0x0000000614000000, 0x0000000614400000| 0%| F| |TAMS 0x0000000614000000, 0x0000000614000000| Untracked
|
||||
| 27|0x0000000614400000, 0x0000000614400000, 0x0000000614800000| 0%| F| |TAMS 0x0000000614400000, 0x0000000614400000| Untracked
|
||||
| 28|0x0000000614800000, 0x0000000614800000, 0x0000000614c00000| 0%| F| |TAMS 0x0000000614800000, 0x0000000614800000| Untracked
|
||||
| 29|0x0000000614c00000, 0x0000000614c00000, 0x0000000615000000| 0%| F| |TAMS 0x0000000614c00000, 0x0000000614c00000| Untracked
|
||||
| 30|0x0000000615000000, 0x0000000615000000, 0x0000000615400000| 0%| F| |TAMS 0x0000000615000000, 0x0000000615000000| Untracked
|
||||
| 31|0x0000000615400000, 0x0000000615400000, 0x0000000615800000| 0%| F| |TAMS 0x0000000615400000, 0x0000000615400000| Untracked
|
||||
| 32|0x0000000615800000, 0x0000000615800000, 0x0000000615c00000| 0%| F| |TAMS 0x0000000615800000, 0x0000000615800000| Untracked
|
||||
| 33|0x0000000615c00000, 0x0000000615c00000, 0x0000000616000000| 0%| F| |TAMS 0x0000000615c00000, 0x0000000615c00000| Untracked
|
||||
| 34|0x0000000616000000, 0x0000000616000000, 0x0000000616400000| 0%| F| |TAMS 0x0000000616000000, 0x0000000616000000| Untracked
|
||||
| 35|0x0000000616400000, 0x0000000616400000, 0x0000000616800000| 0%| F| |TAMS 0x0000000616400000, 0x0000000616400000| Untracked
|
||||
| 36|0x0000000616800000, 0x0000000616800000, 0x0000000616c00000| 0%| F| |TAMS 0x0000000616800000, 0x0000000616800000| Untracked
|
||||
| 37|0x0000000616c00000, 0x0000000616c00000, 0x0000000617000000| 0%| F| |TAMS 0x0000000616c00000, 0x0000000616c00000| Untracked
|
||||
| 38|0x0000000617000000, 0x0000000617000000, 0x0000000617400000| 0%| F| |TAMS 0x0000000617000000, 0x0000000617000000| Untracked
|
||||
| 39|0x0000000617400000, 0x0000000617400000, 0x0000000617800000| 0%| F| |TAMS 0x0000000617400000, 0x0000000617400000| Untracked
|
||||
| 40|0x0000000617800000, 0x0000000617800000, 0x0000000617c00000| 0%| F| |TAMS 0x0000000617800000, 0x0000000617800000| Untracked
|
||||
| 41|0x0000000617c00000, 0x0000000617c00000, 0x0000000618000000| 0%| F| |TAMS 0x0000000617c00000, 0x0000000617c00000| Untracked
|
||||
| 42|0x0000000618000000, 0x0000000618000000, 0x0000000618400000| 0%| F| |TAMS 0x0000000618000000, 0x0000000618000000| Untracked
|
||||
| 43|0x0000000618400000, 0x0000000618400000, 0x0000000618800000| 0%| F| |TAMS 0x0000000618400000, 0x0000000618400000| Untracked
|
||||
| 44|0x0000000618800000, 0x0000000618800000, 0x0000000618c00000| 0%| F| |TAMS 0x0000000618800000, 0x0000000618800000| Untracked
|
||||
| 45|0x0000000618c00000, 0x0000000618c00000, 0x0000000619000000| 0%| F| |TAMS 0x0000000618c00000, 0x0000000618c00000| Untracked
|
||||
| 46|0x0000000619000000, 0x0000000619000000, 0x0000000619400000| 0%| F| |TAMS 0x0000000619000000, 0x0000000619000000| Untracked
|
||||
| 47|0x0000000619400000, 0x0000000619400000, 0x0000000619800000| 0%| F| |TAMS 0x0000000619400000, 0x0000000619400000| Untracked
|
||||
| 48|0x0000000619800000, 0x0000000619800000, 0x0000000619c00000| 0%| F| |TAMS 0x0000000619800000, 0x0000000619800000| Untracked
|
||||
| 49|0x0000000619c00000, 0x0000000619c00000, 0x000000061a000000| 0%| F| |TAMS 0x0000000619c00000, 0x0000000619c00000| Untracked
|
||||
| 50|0x000000061a000000, 0x000000061a000000, 0x000000061a400000| 0%| F| |TAMS 0x000000061a000000, 0x000000061a000000| Untracked
|
||||
| 51|0x000000061a400000, 0x000000061a400000, 0x000000061a800000| 0%| F| |TAMS 0x000000061a400000, 0x000000061a400000| Untracked
|
||||
| 52|0x000000061a800000, 0x000000061a800000, 0x000000061ac00000| 0%| F| |TAMS 0x000000061a800000, 0x000000061a800000| Untracked
|
||||
| 53|0x000000061ac00000, 0x000000061ac00000, 0x000000061b000000| 0%| F| |TAMS 0x000000061ac00000, 0x000000061ac00000| Untracked
|
||||
| 54|0x000000061b000000, 0x000000061b000000, 0x000000061b400000| 0%| F| |TAMS 0x000000061b000000, 0x000000061b000000| Untracked
|
||||
| 55|0x000000061b400000, 0x000000061b400000, 0x000000061b800000| 0%| F| |TAMS 0x000000061b400000, 0x000000061b400000| Untracked
|
||||
| 56|0x000000061b800000, 0x000000061b800000, 0x000000061bc00000| 0%| F| |TAMS 0x000000061b800000, 0x000000061b800000| Untracked
|
||||
| 57|0x000000061bc00000, 0x000000061bc00000, 0x000000061c000000| 0%| F| |TAMS 0x000000061bc00000, 0x000000061bc00000| Untracked
|
||||
| 58|0x000000061c000000, 0x000000061c000000, 0x000000061c400000| 0%| F| |TAMS 0x000000061c000000, 0x000000061c000000| Untracked
|
||||
| 59|0x000000061c400000, 0x000000061c400000, 0x000000061c800000| 0%| F| |TAMS 0x000000061c400000, 0x000000061c400000| Untracked
|
||||
| 60|0x000000061c800000, 0x000000061c800000, 0x000000061cc00000| 0%| F| |TAMS 0x000000061c800000, 0x000000061c800000| Untracked
|
||||
| 61|0x000000061cc00000, 0x000000061cc00000, 0x000000061d000000| 0%| F| |TAMS 0x000000061cc00000, 0x000000061cc00000| Untracked
|
||||
| 62|0x000000061d000000, 0x000000061d000000, 0x000000061d400000| 0%| F| |TAMS 0x000000061d000000, 0x000000061d000000| Untracked
|
||||
| 63|0x000000061d400000, 0x000000061d400000, 0x000000061d800000| 0%| F| |TAMS 0x000000061d400000, 0x000000061d400000| Untracked
|
||||
| 64|0x000000061d800000, 0x000000061d800000, 0x000000061dc00000| 0%| F| |TAMS 0x000000061d800000, 0x000000061d800000| Untracked
|
||||
| 65|0x000000061dc00000, 0x000000061dc00000, 0x000000061e000000| 0%| F| |TAMS 0x000000061dc00000, 0x000000061dc00000| Untracked
|
||||
| 66|0x000000061e000000, 0x000000061e000000, 0x000000061e400000| 0%| F| |TAMS 0x000000061e000000, 0x000000061e000000| Untracked
|
||||
| 67|0x000000061e400000, 0x000000061e400000, 0x000000061e800000| 0%| F| |TAMS 0x000000061e400000, 0x000000061e400000| Untracked
|
||||
| 68|0x000000061e800000, 0x000000061e800000, 0x000000061ec00000| 0%| F| |TAMS 0x000000061e800000, 0x000000061e800000| Untracked
|
||||
| 69|0x000000061ec00000, 0x000000061ec00000, 0x000000061f000000| 0%| F| |TAMS 0x000000061ec00000, 0x000000061ec00000| Untracked
|
||||
| 70|0x000000061f000000, 0x000000061f000000, 0x000000061f400000| 0%| F| |TAMS 0x000000061f000000, 0x000000061f000000| Untracked
|
||||
| 71|0x000000061f400000, 0x000000061f400000, 0x000000061f800000| 0%| F| |TAMS 0x000000061f400000, 0x000000061f400000| Untracked
|
||||
| 72|0x000000061f800000, 0x000000061f800000, 0x000000061fc00000| 0%| F| |TAMS 0x000000061f800000, 0x000000061f800000| Untracked
|
||||
| 73|0x000000061fc00000, 0x000000061fc00000, 0x0000000620000000| 0%| F| |TAMS 0x000000061fc00000, 0x000000061fc00000| Untracked
|
||||
| 74|0x0000000620000000, 0x0000000620000000, 0x0000000620400000| 0%| F| |TAMS 0x0000000620000000, 0x0000000620000000| Untracked
|
||||
| 75|0x0000000620400000, 0x0000000620400000, 0x0000000620800000| 0%| F| |TAMS 0x0000000620400000, 0x0000000620400000| Untracked
|
||||
| 76|0x0000000620800000, 0x0000000620800000, 0x0000000620c00000| 0%| F| |TAMS 0x0000000620800000, 0x0000000620800000| Untracked
|
||||
| 77|0x0000000620c00000, 0x0000000620c00000, 0x0000000621000000| 0%| F| |TAMS 0x0000000620c00000, 0x0000000620c00000| Untracked
|
||||
| 78|0x0000000621000000, 0x0000000621000000, 0x0000000621400000| 0%| F| |TAMS 0x0000000621000000, 0x0000000621000000| Untracked
|
||||
| 79|0x0000000621400000, 0x0000000621400000, 0x0000000621800000| 0%| F| |TAMS 0x0000000621400000, 0x0000000621400000| Untracked
|
||||
| 80|0x0000000621800000, 0x0000000621800000, 0x0000000621c00000| 0%| F| |TAMS 0x0000000621800000, 0x0000000621800000| Untracked
|
||||
| 81|0x0000000621c00000, 0x0000000621c00000, 0x0000000622000000| 0%| F| |TAMS 0x0000000621c00000, 0x0000000621c00000| Untracked
|
||||
| 82|0x0000000622000000, 0x0000000622000000, 0x0000000622400000| 0%| F| |TAMS 0x0000000622000000, 0x0000000622000000| Untracked
|
||||
| 83|0x0000000622400000, 0x0000000622400000, 0x0000000622800000| 0%| F| |TAMS 0x0000000622400000, 0x0000000622400000| Untracked
|
||||
| 84|0x0000000622800000, 0x0000000622800000, 0x0000000622c00000| 0%| F| |TAMS 0x0000000622800000, 0x0000000622800000| Untracked
|
||||
| 85|0x0000000622c00000, 0x0000000622c00000, 0x0000000623000000| 0%| F| |TAMS 0x0000000622c00000, 0x0000000622c00000| Untracked
|
||||
| 86|0x0000000623000000, 0x0000000623000000, 0x0000000623400000| 0%| F| |TAMS 0x0000000623000000, 0x0000000623000000| Untracked
|
||||
| 87|0x0000000623400000, 0x0000000623400000, 0x0000000623800000| 0%| F| |TAMS 0x0000000623400000, 0x0000000623400000| Untracked
|
||||
| 88|0x0000000623800000, 0x0000000623800000, 0x0000000623c00000| 0%| F| |TAMS 0x0000000623800000, 0x0000000623800000| Untracked
|
||||
| 89|0x0000000623c00000, 0x0000000623c00000, 0x0000000624000000| 0%| F| |TAMS 0x0000000623c00000, 0x0000000623c00000| Untracked
|
||||
| 90|0x0000000624000000, 0x0000000624000000, 0x0000000624400000| 0%| F| |TAMS 0x0000000624000000, 0x0000000624000000| Untracked
|
||||
| 91|0x0000000624400000, 0x0000000624400000, 0x0000000624800000| 0%| F| |TAMS 0x0000000624400000, 0x0000000624400000| Untracked
|
||||
| 92|0x0000000624800000, 0x0000000624800000, 0x0000000624c00000| 0%| F| |TAMS 0x0000000624800000, 0x0000000624800000| Untracked
|
||||
| 93|0x0000000624c00000, 0x0000000624c00000, 0x0000000625000000| 0%| F| |TAMS 0x0000000624c00000, 0x0000000624c00000| Untracked
|
||||
| 94|0x0000000625000000, 0x0000000625000000, 0x0000000625400000| 0%| F| |TAMS 0x0000000625000000, 0x0000000625000000| Untracked
|
||||
| 95|0x0000000625400000, 0x0000000625400000, 0x0000000625800000| 0%| F| |TAMS 0x0000000625400000, 0x0000000625400000| Untracked
|
||||
| 96|0x0000000625800000, 0x0000000625800000, 0x0000000625c00000| 0%| F| |TAMS 0x0000000625800000, 0x0000000625800000| Untracked
|
||||
| 97|0x0000000625c00000, 0x0000000625c00000, 0x0000000626000000| 0%| F| |TAMS 0x0000000625c00000, 0x0000000625c00000| Untracked
|
||||
| 98|0x0000000626000000, 0x0000000626000000, 0x0000000626400000| 0%| F| |TAMS 0x0000000626000000, 0x0000000626000000| Untracked
|
||||
| 99|0x0000000626400000, 0x0000000626400000, 0x0000000626800000| 0%| F| |TAMS 0x0000000626400000, 0x0000000626400000| Untracked
|
||||
| 100|0x0000000626800000, 0x0000000626800000, 0x0000000626c00000| 0%| F| |TAMS 0x0000000626800000, 0x0000000626800000| Untracked
|
||||
| 101|0x0000000626c00000, 0x0000000626c00000, 0x0000000627000000| 0%| F| |TAMS 0x0000000626c00000, 0x0000000626c00000| Untracked
|
||||
| 102|0x0000000627000000, 0x0000000627000000, 0x0000000627400000| 0%| F| |TAMS 0x0000000627000000, 0x0000000627000000| Untracked
|
||||
| 103|0x0000000627400000, 0x0000000627400000, 0x0000000627800000| 0%| F| |TAMS 0x0000000627400000, 0x0000000627400000| Untracked
|
||||
| 104|0x0000000627800000, 0x0000000627800000, 0x0000000627c00000| 0%| F| |TAMS 0x0000000627800000, 0x0000000627800000| Untracked
|
||||
| 105|0x0000000627c00000, 0x0000000627c00000, 0x0000000628000000| 0%| F| |TAMS 0x0000000627c00000, 0x0000000627c00000| Untracked
|
||||
| 106|0x0000000628000000, 0x0000000628000000, 0x0000000628400000| 0%| F| |TAMS 0x0000000628000000, 0x0000000628000000| Untracked
|
||||
| 107|0x0000000628400000, 0x0000000628400000, 0x0000000628800000| 0%| F| |TAMS 0x0000000628400000, 0x0000000628400000| Untracked
|
||||
| 108|0x0000000628800000, 0x0000000628800000, 0x0000000628c00000| 0%| F| |TAMS 0x0000000628800000, 0x0000000628800000| Untracked
|
||||
| 109|0x0000000628c00000, 0x0000000628c00000, 0x0000000629000000| 0%| F| |TAMS 0x0000000628c00000, 0x0000000628c00000| Untracked
|
||||
| 110|0x0000000629000000, 0x0000000629000000, 0x0000000629400000| 0%| F| |TAMS 0x0000000629000000, 0x0000000629000000| Untracked
|
||||
| 111|0x0000000629400000, 0x0000000629400000, 0x0000000629800000| 0%| F| |TAMS 0x0000000629400000, 0x0000000629400000| Untracked
|
||||
| 112|0x0000000629800000, 0x0000000629800000, 0x0000000629c00000| 0%| F| |TAMS 0x0000000629800000, 0x0000000629800000| Untracked
|
||||
| 113|0x0000000629c00000, 0x0000000629c00000, 0x000000062a000000| 0%| F| |TAMS 0x0000000629c00000, 0x0000000629c00000| Untracked
|
||||
| 114|0x000000062a000000, 0x000000062a000000, 0x000000062a400000| 0%| F| |TAMS 0x000000062a000000, 0x000000062a000000| Untracked
|
||||
| 115|0x000000062a400000, 0x000000062a400000, 0x000000062a800000| 0%| F| |TAMS 0x000000062a400000, 0x000000062a400000| Untracked
|
||||
| 116|0x000000062a800000, 0x000000062a800000, 0x000000062ac00000| 0%| F| |TAMS 0x000000062a800000, 0x000000062a800000| Untracked
|
||||
| 117|0x000000062ac00000, 0x000000062ac00000, 0x000000062b000000| 0%| F| |TAMS 0x000000062ac00000, 0x000000062ac00000| Untracked
|
||||
| 118|0x000000062b000000, 0x000000062b000000, 0x000000062b400000| 0%| F| |TAMS 0x000000062b000000, 0x000000062b000000| Untracked
|
||||
| 119|0x000000062b400000, 0x000000062b400000, 0x000000062b800000| 0%| F| |TAMS 0x000000062b400000, 0x000000062b400000| Untracked
|
||||
| 120|0x000000062b800000, 0x000000062bb7fc80, 0x000000062bc00000| 87%| E| |TAMS 0x000000062b800000, 0x000000062b800000| Complete
|
||||
| 121|0x000000062bc00000, 0x000000062c000000, 0x000000062c000000|100%| E|CS|TAMS 0x000000062bc00000, 0x000000062bc00000| Complete
|
||||
| 122|0x000000062c000000, 0x000000062c400000, 0x000000062c400000|100%| E|CS|TAMS 0x000000062c000000, 0x000000062c000000| Complete
|
||||
| 123|0x000000062c400000, 0x000000062c800000, 0x000000062c800000|100%| E|CS|TAMS 0x000000062c400000, 0x000000062c400000| Complete
|
||||
| 124|0x000000062c800000, 0x000000062cc00000, 0x000000062cc00000|100%| E|CS|TAMS 0x000000062c800000, 0x000000062c800000| Complete
|
||||
|
||||
Card table byte_map: [0x000002346c8f0000,0x000002346d890000] _byte_map_base: 0x0000023469884000
|
||||
|
||||
Marking Bits (Prev, Next): (CMBitMap*) 0x0000023453cc26f0, (CMBitMap*) 0x0000023453cc2730
|
||||
Prev Bits: [0x000002346e830000, 0x00000234764d0000)
|
||||
Next Bits: [0x00000234764d0000, 0x000002347e170000)
|
||||
|
||||
Polling page: 0x0000023451ab0000
|
||||
|
||||
Metaspace:
|
||||
|
||||
Usage:
|
||||
Non-class: 4.71 MB used.
|
||||
Class: 367.62 KB used.
|
||||
Both: 5.07 MB used.
|
||||
|
||||
Virtual space:
|
||||
Non-class space: 64.00 MB reserved, 4.81 MB ( 8%) committed, 1 nodes.
|
||||
Class space: 1.00 GB reserved, 448.00 KB ( <1%) committed, 1 nodes.
|
||||
Both: 1.06 GB reserved, 5.25 MB ( <1%) committed.
|
||||
|
||||
Chunk freelists:
|
||||
Non-Class: 2.25 MB
|
||||
Class: 3.51 MB
|
||||
Both: 5.76 MB
|
||||
|
||||
MaxMetaspaceSize: unlimited
|
||||
CompressedClassSpaceSize: 1.00 GB
|
||||
Initial GC threshold: 21.00 MB
|
||||
Current GC threshold: 21.00 MB
|
||||
CDS: on
|
||||
MetaspaceReclaimPolicy: balanced
|
||||
- commit_granule_bytes: 65536.
|
||||
- commit_granule_words: 8192.
|
||||
- virtual_space_node_default_size: 8388608.
|
||||
- enlarge_chunks_in_place: 1.
|
||||
- new_chunks_are_fully_committed: 0.
|
||||
- uncommit_free_chunks: 1.
|
||||
- use_allocation_guard: 0.
|
||||
|
||||
|
||||
Internal statistics:
|
||||
|
||||
num_allocs_failed_limit: 0.
|
||||
num_arena_births: 84.
|
||||
num_arena_deaths: 0.
|
||||
num_vsnodes_births: 2.
|
||||
num_vsnodes_deaths: 0.
|
||||
num_space_committed: 84.
|
||||
num_space_uncommitted: 0.
|
||||
num_chunks_returned_to_freelist: 0.
|
||||
num_chunks_taken_from_freelist: 166.
|
||||
num_chunk_merges: 0.
|
||||
num_chunk_splits: 118.
|
||||
num_chunks_enlarged: 83.
|
||||
num_inconsistent_stats: 0.
|
||||
|
||||
CodeHeap 'non-profiled nmethods': size=119168Kb used=290Kb max_used=290Kb free=118878Kb
|
||||
bounds [0x0000023463720000, 0x0000023463990000, 0x000002346ab80000]
|
||||
CodeHeap 'profiled nmethods': size=119104Kb used=1485Kb max_used=1485Kb free=117618Kb
|
||||
bounds [0x000002345bb80000, 0x000002345bdf0000, 0x0000023462fd0000]
|
||||
CodeHeap 'non-nmethods': size=7488Kb used=2889Kb max_used=2902Kb free=4598Kb
|
||||
bounds [0x0000023462fd0000, 0x00000234632b0000, 0x0000023463720000]
|
||||
total_blobs=1942 nmethods=912 adapters=939
|
||||
compilation: enabled
|
||||
stopped_count=0, restarted_count=0
|
||||
full_count=0
|
||||
|
||||
Compilation events (20 events):
|
||||
Event: 0.301 Thread 0x000002347f904e70 901 3 java.lang.Integer::toUnsignedLong (7 bytes)
|
||||
Event: 0.301 Thread 0x000002347e677fd0 902 3 org.lwjgl.system.MemoryUtil::write8 (19 bytes)
|
||||
Event: 0.301 Thread 0x000002347f904e70 nmethod 901 0x000002345bcf1090 code [0x000002345bcf1220, 0x000002345bcf1318]
|
||||
Event: 0.301 Thread 0x000002347f907810 903 3 sun.misc.Unsafe::putByte (11 bytes)
|
||||
Event: 0.301 Thread 0x000002347f907810 nmethod 903 0x000002345bcf1390 code [0x000002345bcf1520, 0x000002345bcf1638]
|
||||
Event: 0.301 Thread 0x000002347e677fd0 nmethod 902 0x000002345bcf1710 code [0x000002345bcf18c0, 0x000002345bcf1b18]
|
||||
Event: 0.302 Thread 0x000002347fb8ae70 905 4 org.eclipse.jdt.launching.internal.org.objectweb.asm.ByteVector::putShort (52 bytes)
|
||||
Event: 0.303 Thread 0x000002347fb8ae70 nmethod 905 0x0000023463767c90 code [0x0000023463767e20, 0x0000023463767fc8]
|
||||
Event: 0.305 Thread 0x000002347e677fd0 906 3 java.lang.String::indexOf (64 bytes)
|
||||
Event: 0.305 Thread 0x000002347f907810 907 3 java.lang.StringLatin1::indexOf (25 bytes)
|
||||
Event: 0.305 Thread 0x000002347f907810 nmethod 907 0x000002345bcf1c10 code [0x000002345bcf1dc0, 0x000002345bcf1fe8]
|
||||
Event: 0.305 Thread 0x000002347e677fd0 nmethod 906 0x000002345bcf2110 code [0x000002345bcf2320, 0x000002345bcf2808]
|
||||
Event: 0.306 Thread 0x000002347f907810 909 3 sun.misc.Unsafe::putLong (11 bytes)
|
||||
Event: 0.306 Thread 0x000002347f904e70 910 3 org.lwjgl.system.MemoryUtil::memPutAddress (29 bytes)
|
||||
Event: 0.306 Thread 0x000002347fb8ae70 911 4 java.lang.Integer::toUnsignedLong (7 bytes)
|
||||
Event: 0.306 Thread 0x000002347f907810 nmethod 909 0x000002345bcf2990 code [0x000002345bcf2b20, 0x000002345bcf2c38]
|
||||
Event: 0.306 Thread 0x000002347f904e70 nmethod 910 0x000002345bcf2d10 code [0x000002345bcf2ec0, 0x000002345bcf30b8]
|
||||
Event: 0.306 Thread 0x000002347fb8ae70 nmethod 911 0x0000023463768510 code [0x0000023463768680, 0x00000234637686d8]
|
||||
Event: 0.306 Thread 0x000002347f904e70 912 3 java.lang.ref.PhantomReference::<init> (7 bytes)
|
||||
Event: 0.306 Thread 0x000002347f904e70 nmethod 912 0x000002345bcf3190 code [0x000002345bcf3340, 0x000002345bcf3638]
|
||||
|
||||
GC Heap History (0 events):
|
||||
No events
|
||||
|
||||
Dll operation events (11 events):
|
||||
Event: 0.004 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\java.dll
|
||||
Event: 0.009 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\jsvml.dll
|
||||
Event: 0.151 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\zip.dll
|
||||
Event: 0.152 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\instrument.dll
|
||||
Event: 0.155 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\net.dll
|
||||
Event: 0.155 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\nio.dll
|
||||
Event: 0.157 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\zip.dll
|
||||
Event: 0.194 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\jimage.dll
|
||||
Event: 0.215 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\verify.dll
|
||||
Event: 0.270 Loaded shared library C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl.dll
|
||||
Event: 0.280 Loaded shared library C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl_opengl.dll
|
||||
|
||||
Deoptimization events (20 events):
|
||||
Event: 0.223 Thread 0x0000023453c10460 DEOPT PACKING pc=0x000002345bc168f3 sp=0x0000008f887fbd10
|
||||
Event: 0.223 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303b0e3 sp=0x0000008f887fb178 mode 0
|
||||
Event: 0.224 Thread 0x0000023453c10460 DEOPT PACKING pc=0x000002345bc168f3 sp=0x0000008f887fbde0
|
||||
Event: 0.224 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303b0e3 sp=0x0000008f887fb248 mode 0
|
||||
Event: 0.225 Thread 0x0000023453c10460 DEOPT PACKING pc=0x000002345bc168f3 sp=0x0000008f887f7f90
|
||||
Event: 0.225 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303b0e3 sp=0x0000008f887f73f8 mode 0
|
||||
Event: 0.226 Thread 0x0000023453c10460 DEOPT PACKING pc=0x000002345bc168f3 sp=0x0000008f887f7f90
|
||||
Event: 0.226 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303b0e3 sp=0x0000008f887f73f8 mode 0
|
||||
Event: 0.240 Thread 0x0000023453c10460 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000023463750608 relative=0x00000000000002c8
|
||||
Event: 0.240 Thread 0x0000023453c10460 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000023463750608 method=org.eclipse.jdt.launching.internal.org.objectweb.asm.ClassReader.readUTF8(I[C)Ljava/lang/String; @ 11 c2
|
||||
Event: 0.240 Thread 0x0000023453c10460 DEOPT PACKING pc=0x0000023463750608 sp=0x0000008f887fc150
|
||||
Event: 0.240 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303a5a3 sp=0x0000008f887fc158 mode 2
|
||||
Event: 0.253 Thread 0x0000023453c10460 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000023463750d18 relative=0x00000000000000f8
|
||||
Event: 0.253 Thread 0x0000023453c10460 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000023463750d18 method=org.eclipse.jdt.launching.internal.org.objectweb.asm.ByteVector.putShort(I)Lorg/eclipse/jdt/launching/internal/org/objectweb/asm/ByteVector; @ 13 c2
|
||||
Event: 0.253 Thread 0x0000023453c10460 DEOPT PACKING pc=0x0000023463750d18 sp=0x0000008f887fb060
|
||||
Event: 0.253 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303a5a3 sp=0x0000008f887faff8 mode 2
|
||||
Event: 0.264 Thread 0x0000023453c10460 Uncommon trap: trap_request=0xffffff45 fr.pc=0x000002346375e008 relative=0x0000000000000068
|
||||
Event: 0.264 Thread 0x0000023453c10460 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000002346375e008 method=java.io.WinNTFileSystem.isSlash(C)Z @ 9 c2
|
||||
Event: 0.264 Thread 0x0000023453c10460 DEOPT PACKING pc=0x000002346375e008 sp=0x0000008f887fcc70
|
||||
Event: 0.264 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303a5a3 sp=0x0000008f887fcc08 mode 2
|
||||
|
||||
Classes loaded (20 events):
|
||||
Event: 0.286 Loading class sun/misc/Unsafe
|
||||
Event: 0.286 Loading class sun/misc/Unsafe done
|
||||
Event: 0.286 Loading class java/lang/invoke/DirectMethodHandle$StaticAccessor
|
||||
Event: 0.286 Loading class java/lang/invoke/DirectMethodHandle$StaticAccessor done
|
||||
Event: 0.288 Loading class java/util/function/LongPredicate
|
||||
Event: 0.288 Loading class java/util/function/LongPredicate done
|
||||
Event: 0.288 Loading class java/lang/foreign/MemorySegment
|
||||
Event: 0.289 Loading class java/lang/foreign/Addressable
|
||||
Event: 0.289 Loading class java/lang/foreign/Addressable done
|
||||
Event: 0.289 Loading class java/lang/foreign/MemorySegment done
|
||||
Event: 0.290 Loading class java/nio/InvalidMarkException
|
||||
Event: 0.291 Loading class java/nio/InvalidMarkException done
|
||||
Event: 0.291 Loading class java/nio/BufferUnderflowException
|
||||
Event: 0.291 Loading class java/nio/BufferUnderflowException done
|
||||
Event: 0.301 Loading class jdk/internal/foreign/MemorySessionImpl
|
||||
Event: 0.301 Loading class java/lang/foreign/MemorySession
|
||||
Event: 0.301 Loading class java/lang/foreign/SegmentAllocator
|
||||
Event: 0.301 Loading class java/lang/foreign/SegmentAllocator done
|
||||
Event: 0.301 Loading class java/lang/foreign/MemorySession done
|
||||
Event: 0.301 Loading class jdk/internal/foreign/MemorySessionImpl done
|
||||
|
||||
Classes unloaded (0 events):
|
||||
No events
|
||||
|
||||
Classes redefined (0 events):
|
||||
No events
|
||||
|
||||
Internal exceptions (20 events):
|
||||
Event: 0.276 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf80f98}> (0x000000062bf80f98)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.276 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf818f8}> (0x000000062bf818f8)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.276 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf8a610}> (0x000000062bf8a610)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.278 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf8d3f0}> (0x000000062bf8d3f0)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.278 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf8d7b0}> (0x000000062bf8d7b0)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.282 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf99658}> (0x000000062bf99658)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.282 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf99950}> (0x000000062bf99950)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.284 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b83b910}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object)'> (0x000000062b83b910)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.288 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b88f0f0}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, int, long)'> (0x000000062b88f0f0)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.288 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b8949c0}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.newInvokeSpecial(java.lang.Object, java.lang.Object, int)'> (0x000000062b8949c0)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.289 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b8b36a8}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, long, long)'> (0x000000062b8b36a8)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.289 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b8b97c0}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.newInvokeSpecial(java.lang.Object, java.lang.Object, long)'> (0x000000062b8b97c0)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.290 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b8bdad0}: 'java.lang.Object java.lang.invoke.Invokers$Holder.linkToTargetMethod(java.lang.Object, long, java.lang.Object)'> (0x000000062b8bdad0)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.290 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b8c5058}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, java.lang.Object, long)'> (0x000000062b8c5058)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.295 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062b9a95b8}> (0x000000062b9a95b8)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.296 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062b9a98b0}> (0x000000062b9a98b0)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.296 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062b9aa4c0}> (0x000000062b9aa4c0)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.296 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062b9b1250}> (0x000000062b9b1250)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.299 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062b9b4030}> (0x000000062b9b4030)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.299 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062b9b43e0}> (0x000000062b9b43e0)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
|
||||
VM Operations (10 events):
|
||||
Event: 0.031 Executing VM operation: HandshakeAllThreads
|
||||
Event: 0.031 Executing VM operation: HandshakeAllThreads done
|
||||
Event: 0.040 Executing VM operation: ChangeBreakpoints
|
||||
Event: 0.040 Executing VM operation: ChangeBreakpoints done
|
||||
Event: 0.137 Executing VM operation: ChangeBreakpoints
|
||||
Event: 0.137 Executing VM operation: ChangeBreakpoints done
|
||||
Event: 0.259 Executing VM operation: HandshakeAllThreads
|
||||
Event: 0.259 Executing VM operation: HandshakeAllThreads done
|
||||
Event: 0.264 Executing VM operation: HandshakeAllThreads
|
||||
Event: 0.264 Executing VM operation: HandshakeAllThreads done
|
||||
|
||||
Events (18 events):
|
||||
Event: 0.009 Thread 0x0000023453c10460 Thread added: 0x0000023453c10460
|
||||
Event: 0.014 Thread 0x000002347e65ecb0 Thread added: 0x000002347e65ecb0
|
||||
Event: 0.015 Thread 0x000002347e660120 Thread added: 0x000002347e660120
|
||||
Event: 0.015 Thread 0x000002347e6625a0 Thread added: 0x000002347e6625a0
|
||||
Event: 0.015 Thread 0x000002347e664ee0 Thread added: 0x000002347e664ee0
|
||||
Event: 0.015 Thread 0x000002347e6682e0 Thread added: 0x000002347e6682e0
|
||||
Event: 0.015 Thread 0x000002347e66cbf0 Thread added: 0x000002347e66cbf0
|
||||
Event: 0.015 Thread 0x000002347e673540 Thread added: 0x000002347e673540
|
||||
Event: 0.015 Thread 0x000002347e677fd0 Thread added: 0x000002347e677fd0
|
||||
Event: 0.015 Thread 0x000002347e68cd10 Thread added: 0x000002347e68cd10
|
||||
Event: 0.029 Thread 0x000002347e68c270 Thread added: 0x000002347e68c270
|
||||
Event: 0.031 Thread 0x000002347f904e70 Thread added: 0x000002347f904e70
|
||||
Event: 0.032 Thread 0x000002347f907810 Thread added: 0x000002347f907810
|
||||
Event: 0.040 Thread 0x000002347f9b69e0 Thread added: 0x000002347f9b69e0
|
||||
Event: 0.040 Thread 0x000002347fabebd0 Thread added: 0x000002347fabebd0
|
||||
Event: 0.040 Thread 0x000002347fabf520 Thread added: 0x000002347fabf520
|
||||
Event: 0.200 Thread 0x000002347fb8ae70 Thread added: 0x000002347fb8ae70
|
||||
Event: 0.212 Thread 0x000002347e68b280 Thread added: 0x000002347e68b280
|
||||
|
||||
|
||||
Dynamic libraries:
|
||||
0x00007ff636b50000 - 0x00007ff636b60000 C:\Program Files\Java\jdk-19.0.2\bin\javaw.exe
|
||||
0x00007ff935510000 - 0x00007ff935708000 C:\Windows\SYSTEM32\ntdll.dll
|
||||
0x00007ff934e50000 - 0x00007ff934f0f000 C:\Windows\System32\KERNEL32.DLL
|
||||
0x00007ff932bf0000 - 0x00007ff932ee6000 C:\Windows\System32\KERNELBASE.dll
|
||||
0x00007ff932f20000 - 0x00007ff933020000 C:\Windows\System32\ucrtbase.dll
|
||||
0x00007ff91a600000 - 0x00007ff91a618000 C:\Program Files\Java\jdk-19.0.2\bin\jli.dll
|
||||
0x00007ff91a700000 - 0x00007ff91a71b000 C:\Program Files\Java\jdk-19.0.2\bin\VCRUNTIME140.dll
|
||||
0x00007ff934720000 - 0x00007ff9347cf000 C:\Windows\System32\ADVAPI32.dll
|
||||
0x00007ff934bb0000 - 0x00007ff934c4e000 C:\Windows\System32\msvcrt.dll
|
||||
0x00007ff9353a0000 - 0x00007ff93543c000 C:\Windows\System32\sechost.dll
|
||||
0x00007ff934a80000 - 0x00007ff934ba6000 C:\Windows\System32\RPCRT4.dll
|
||||
0x00007ff933570000 - 0x00007ff93370d000 C:\Windows\System32\USER32.dll
|
||||
0x00007ff9334a0000 - 0x00007ff9334c2000 C:\Windows\System32\win32u.dll
|
||||
0x00007ff925810000 - 0x00007ff925aaa000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll
|
||||
0x00007ff934c80000 - 0x00007ff934cac000 C:\Windows\System32\GDI32.dll
|
||||
0x00007ff933380000 - 0x00007ff933495000 C:\Windows\System32\gdi32full.dll
|
||||
0x00007ff9334d0000 - 0x00007ff93356d000 C:\Windows\System32\msvcp_win.dll
|
||||
0x00007ff92b1d0000 - 0x00007ff92b1da000 C:\Windows\SYSTEM32\VERSION.dll
|
||||
0x00007ff934c50000 - 0x00007ff934c80000 C:\Windows\System32\IMM32.DLL
|
||||
0x00007ff92f6f0000 - 0x00007ff92f6fc000 C:\Program Files\Java\jdk-19.0.2\bin\vcruntime140_1.dll
|
||||
0x00007ff8fde20000 - 0x00007ff8fdeae000 C:\Program Files\Java\jdk-19.0.2\bin\msvcp140.dll
|
||||
0x00007ff8884e0000 - 0x00007ff8891a0000 C:\Program Files\Java\jdk-19.0.2\bin\server\jvm.dll
|
||||
0x00007ff8cf580000 - 0x00007ff8cf589000 C:\Windows\SYSTEM32\WSOCK32.dll
|
||||
0x00007ff925d90000 - 0x00007ff925db7000 C:\Windows\SYSTEM32\WINMM.dll
|
||||
0x00007ff934990000 - 0x00007ff9349fb000 C:\Windows\System32\WS2_32.dll
|
||||
0x00007ff930ac0000 - 0x00007ff930ad2000 C:\Windows\SYSTEM32\kernel.appcore.dll
|
||||
0x00007ff92f6d0000 - 0x00007ff92f6da000 C:\Program Files\Java\jdk-19.0.2\bin\jimage.dll
|
||||
0x00007ff929560000 - 0x00007ff929744000 C:\Windows\SYSTEM32\DBGHELP.DLL
|
||||
0x00007ff9154a0000 - 0x00007ff9154d4000 C:\Windows\SYSTEM32\dbgcore.DLL
|
||||
0x00007ff933280000 - 0x00007ff933302000 C:\Windows\System32\bcryptPrimitives.dll
|
||||
0x00007ff90cd20000 - 0x00007ff90cd5c000 C:\Program Files\Java\jdk-19.0.2\bin\jdwp.dll
|
||||
0x00007ff91a5f0000 - 0x00007ff91a5fe000 C:\Program Files\Java\jdk-19.0.2\bin\instrument.dll
|
||||
0x00007ff911b60000 - 0x00007ff911b86000 C:\Program Files\Java\jdk-19.0.2\bin\java.dll
|
||||
0x00007ff8a3af0000 - 0x00007ff8a3bc7000 C:\Program Files\Java\jdk-19.0.2\bin\jsvml.dll
|
||||
0x00007ff933710000 - 0x00007ff933e54000 C:\Windows\System32\SHELL32.dll
|
||||
0x00007ff930cc0000 - 0x00007ff931453000 C:\Windows\SYSTEM32\windows.storage.dll
|
||||
0x00007ff934f10000 - 0x00007ff935264000 C:\Windows\System32\combase.dll
|
||||
0x00007ff932640000 - 0x00007ff93266e000 C:\Windows\SYSTEM32\Wldp.dll
|
||||
0x00007ff9352d0000 - 0x00007ff93537d000 C:\Windows\System32\SHCORE.dll
|
||||
0x00007ff935270000 - 0x00007ff9352c5000 C:\Windows\System32\shlwapi.dll
|
||||
0x00007ff932b30000 - 0x00007ff932b4f000 C:\Windows\SYSTEM32\profapi.dll
|
||||
0x00007ff919f00000 - 0x00007ff919f0c000 C:\Program Files\Java\jdk-19.0.2\bin\dt_socket.dll
|
||||
0x00007ff932040000 - 0x00007ff93207c000 C:\Windows\SYSTEM32\IPHLPAPI.DLL
|
||||
0x00007ff9323a0000 - 0x00007ff93240a000 C:\Windows\system32\mswsock.dll
|
||||
0x00007ff932090000 - 0x00007ff93215a000 C:\Windows\SYSTEM32\DNSAPI.dll
|
||||
0x00007ff934e40000 - 0x00007ff934e48000 C:\Windows\System32\NSI.dll
|
||||
0x00007ff92a320000 - 0x00007ff92a32a000 C:\Windows\System32\rasadhlp.dll
|
||||
0x00007ff9279b0000 - 0x00007ff927a32000 C:\Windows\System32\fwpuclnt.dll
|
||||
0x00007ff932ef0000 - 0x00007ff932f17000 C:\Windows\System32\bcrypt.dll
|
||||
0x00007ff919c40000 - 0x00007ff919c58000 C:\Program Files\Java\jdk-19.0.2\bin\zip.dll
|
||||
0x00007ff916970000 - 0x00007ff916983000 C:\Program Files\Java\jdk-19.0.2\bin\net.dll
|
||||
0x00007ff92bf70000 - 0x00007ff92c07a000 C:\Windows\SYSTEM32\WINHTTP.dll
|
||||
0x00007ff912fa0000 - 0x00007ff912fb6000 C:\Program Files\Java\jdk-19.0.2\bin\nio.dll
|
||||
0x00007ff919ef0000 - 0x00007ff919f00000 C:\Program Files\Java\jdk-19.0.2\bin\verify.dll
|
||||
0x00007ff8a45d0000 - 0x00007ff8a464a000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl.dll
|
||||
0x00007ff8b13c0000 - 0x00007ff8b141e000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl_opengl.dll
|
||||
0x00007ff8c8fb0000 - 0x00007ff8c90d5000 C:\Windows\SYSTEM32\opengl32.dll
|
||||
0x00007ff8c8a90000 - 0x00007ff8c8abc000 C:\Windows\SYSTEM32\GLU32.dll
|
||||
0x00007ff8a2190000 - 0x00007ff8a2400000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\jemalloc.dll
|
||||
|
||||
dbghelp: loaded successfully - version: 4.0.5 - missing functions: none
|
||||
symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\Java\jdk-19.0.2\bin;C:\Windows\SYSTEM32;C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e;C:\Program Files\Java\jdk-19.0.2\bin\server;C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64
|
||||
|
||||
VM Arguments:
|
||||
jvm_args: -XX:+ShowCodeDetailsInExceptionMessages -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:63099 -javaagent:C:\Users\Speiger\eclipse\java-2022-12\eclipse\configuration\org.eclipse.osgi\636\0\.cp\lib\javaagent-shaded.jar -Dfile.encoding=UTF-8
|
||||
java_command: speiger.src.coreengine.Testing
|
||||
java_class_path (initial): D:\Projects\GameProject\SimpleJavaEngine\bin\main;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-glfw\3.3.2\757920418805fb90bfebb3d46b1d9e7669fca2eb\lwjgl-glfw-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-glfw\3.3.2\1251e3cb7e5d6159334cfb9244f789ce992f03b\lwjgl-glfw-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-jemalloc\3.3.2\877e17e39ebcd58a9c956dc3b5b777813de0873a\lwjgl-jemalloc-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-jemalloc\3.3.2\db886c1f9e313c3fa2a25543b99ccd250d3f9fb5\lwjgl-jemalloc-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-nfd\3.3.2\ec66452fad5bf48707cbe96c573c6cc3dd8a7a82\lwjgl-nfd-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-nfd\3.3.2\12c0041066a97f0c74d0f72db1423ac9ea124275\lwjgl-nfd-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-openal\3.3.2\ae5357ed6d934546d3533993ea84c0cfb75eed95\lwjgl-openal-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-openal\3.3.2\e74f299a602192faaf14b917632e4cbbb493c940\lwjgl-openal-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-opengl\3.3.2\ee8e95be0b438602038bc1f02dc5e3d011b1b216\lwjgl-opengl-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-opengl\3.3.2\83cd34469d4e0bc335bf74c7f62206530a9480bf\lwjgl-opengl-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-stb\3.3.2\a2550795014d622b686e9caac50b14baa87d2c70\lwjgl-stb-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-stb\3.3.2\1c4f4b8353bdb78c5264ab921436f03fc9aa1ba5\lwjgl-stb-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl\3.3.2\4421d94af68e35dcaa31737a6fc59136a1e61b94\lwjgl-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl\3.3.2\a55169ced70ffcd15f2162daf4a9c968578f6cd5\lwjgl-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\com.google.code.gson\gson\2.8.6\9180733b7df8542621dc12e21e87557e8c99b8cb\gson-2.8.6.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\de.speiger\Primitive-Collections\0.8.0\333b9d587940fc34ad68f3d7d6bace4646dd02ec\Primitive-Collections-0.8.0.jar
|
||||
Launcher Type: SUN_STANDARD
|
||||
|
||||
[Global flags]
|
||||
intx CICompilerCount = 12 {product} {ergonomic}
|
||||
uint ConcGCThreads = 5 {product} {ergonomic}
|
||||
uint G1ConcRefinementThreads = 18 {product} {ergonomic}
|
||||
size_t G1HeapRegionSize = 4194304 {product} {ergonomic}
|
||||
uintx GCDrainStackTargetSize = 64 {product} {ergonomic}
|
||||
size_t InitialHeapSize = 524288000 {product} {ergonomic}
|
||||
size_t MarkStackSize = 4194304 {product} {ergonomic}
|
||||
size_t MaxHeapSize = 8363442176 {product} {ergonomic}
|
||||
size_t MaxNewSize = 5016387584 {product} {ergonomic}
|
||||
size_t MinHeapDeltaBytes = 4194304 {product} {ergonomic}
|
||||
size_t MinHeapSize = 8388608 {product} {ergonomic}
|
||||
uintx NonNMethodCodeHeapSize = 7602480 {pd product} {ergonomic}
|
||||
uintx NonProfiledCodeHeapSize = 122027880 {pd product} {ergonomic}
|
||||
uintx ProfiledCodeHeapSize = 122027880 {pd product} {ergonomic}
|
||||
uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic}
|
||||
bool SegmentedCodeCache = true {product} {ergonomic}
|
||||
bool ShowCodeDetailsInExceptionMessages = true {manageable} {command line}
|
||||
size_t SoftMaxHeapSize = 8363442176 {manageable} {ergonomic}
|
||||
bool UseCompressedClassPointers = true {product lp64_product} {ergonomic}
|
||||
bool UseCompressedOops = true {product lp64_product} {ergonomic}
|
||||
bool UseG1GC = true {product} {ergonomic}
|
||||
bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic}
|
||||
|
||||
Logging:
|
||||
Log output configuration:
|
||||
#0: stdout all=warning uptime,level,tags foldmultilines=false
|
||||
#1: stderr all=off uptime,level,tags foldmultilines=false
|
||||
|
||||
Environment Variables:
|
||||
PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\Speiger\AppData\Local\Microsoft\WindowsApps;
|
||||
USERNAME=Speiger
|
||||
OS=Windows_NT
|
||||
PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD
|
||||
TMP=C:\Users\Speiger\AppData\Local\Temp
|
||||
TEMP=C:\Users\Speiger\AppData\Local\Temp
|
||||
|
||||
|
||||
|
||||
--------------- S Y S T E M ---------------
|
||||
|
||||
OS:
|
||||
Windows 10 , 64 bit Build 19041 (10.0.19041.3031)
|
||||
OS uptime: 0 days 3:11 hours
|
||||
|
||||
CPU: total 24 (initial active 24) (24 cores per cpu, 2 threads per core) family 25 model 97 stepping 2 microcode 0x0, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, avx512f, avx512dq, avx512cd, avx512bw, avx512vl, sha, fma, vzeroupper, avx512_vpopcntdq, avx512_vpclmulqdq, avx512_vaes, avx512_vnni, clflush, clflushopt, avx512_vbmi2, avx512_vbmi, rdtscp, rdpid, fsrm, gfni, avx512_bitalg
|
||||
|
||||
Memory: 4k page, system-wide physical 31894M (21103M free)
|
||||
TotalPageFile size 36502M (AvailPageFile size 20303M)
|
||||
current process WorkingSet (physical memory assigned to process): 66M, peak: 66M
|
||||
current process commit charge ("private bytes"): 639M, peak: 639M
|
||||
|
||||
vm_info: Java HotSpot(TM) 64-Bit Server VM (19.0.2+7-44) for windows-amd64 JRE (19.0.2+7-44), built on 2022-11-30T18:02:09Z by "mach5one" with MS VC++ 17.1 (VS2022)
|
||||
|
||||
END.
|
||||
@@ -1,943 +0,0 @@
|
||||
#
|
||||
# A fatal error has been detected by the Java Runtime Environment:
|
||||
#
|
||||
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff8b13cc79d, pid=9584, tid=6384
|
||||
#
|
||||
# JRE version: Java(TM) SE Runtime Environment (19.0.2+7) (build 19.0.2+7-44)
|
||||
# Java VM: Java HotSpot(TM) 64-Bit Server VM (19.0.2+7-44, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
|
||||
# Problematic frame:
|
||||
# C [lwjgl_opengl.dll+0xc79d]
|
||||
#
|
||||
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
|
||||
#
|
||||
# If you would like to submit a bug report, please visit:
|
||||
# https://bugreport.java.com/bugreport/crash.jsp
|
||||
# The crash happened outside the Java Virtual Machine in native code.
|
||||
# See problematic frame for where to report the bug.
|
||||
#
|
||||
|
||||
--------------- S U M M A R Y ------------
|
||||
|
||||
Command Line: -XX:+ShowCodeDetailsInExceptionMessages -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:63110 -javaagent:C:\Users\Speiger\eclipse\java-2022-12\eclipse\configuration\org.eclipse.osgi\636\0\.cp\lib\javaagent-shaded.jar -Dfile.encoding=UTF-8 speiger.src.coreengine.Testing
|
||||
|
||||
Host: AMD Ryzen 9 7900 12-Core Processor , 24 cores, 31G, Windows 10 , 64 bit Build 19041 (10.0.19041.3031)
|
||||
Time: Mon Jun 19 04:07:01 2023 Mitteleuropäische Sommerzeit elapsed time: 0.291177 seconds (0d 0h 0m 0s)
|
||||
|
||||
--------------- T H R E A D ---------------
|
||||
|
||||
Current thread (0x000001b7f7801df0): JavaThread "main" [_thread_in_native, id=6384, stack(0x000000549c500000,0x000000549c600000)]
|
||||
|
||||
Stack: [0x000000549c500000,0x000000549c600000], sp=0x000000549c5ff6d8, free space=1021k
|
||||
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
|
||||
C [lwjgl_opengl.dll+0xc79d]
|
||||
|
||||
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
|
||||
j org.lwjgl.opengl.GL11C.nglGetBooleanv(IJ)V+0
|
||||
j org.lwjgl.opengl.GL11C.glGetBoolean(I)Z+20
|
||||
j org.lwjgl.opengl.GL11.glGetBoolean(I)Z+1
|
||||
j speiger.src.coreengine.Testing.main([Ljava/lang/String;)V+18
|
||||
v ~StubRoutines::call_stub 0x000001b7874510e8
|
||||
|
||||
siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x00000000000002f0
|
||||
|
||||
|
||||
Registers:
|
||||
RAX=0x000001b7a9f46800, RBX=0x000001b7a5dcdd48, RCX=0x000000000000809d, RDX=0x000001b7aa035008
|
||||
RSP=0x000000549c5ff6d8, RBP=0x000000549c5ff768, RSI=0x000001b7a5afb998, RDI=0x0000000000000001
|
||||
R8 =0x000000000000809d, R9 =0x000001b7aa035008, R10=0x0000000000000000, R11=0x000000062b44f290
|
||||
R12=0x0000000000000000, R13=0x000001b7a5dcdd48, R14=0x000000549c5ff798, R15=0x000001b7f7801df0
|
||||
RIP=0x00007ff8b13cc79d, EFLAGS=0x0000000000010206
|
||||
|
||||
|
||||
Register to memory mapping:
|
||||
|
||||
RIP=0x00007ff8b13cc79d lwjgl_opengl.dll
|
||||
RAX=0x000001b7a9f46800 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00
|
||||
RBX={method} {0x000001b7a5dcdd50} 'nglGetBooleanv' '(IJ)V' in 'org/lwjgl/opengl/GL11C'
|
||||
RCX=0x000000000000809d is an unknown value
|
||||
RDX=0x000001b7aa035008 points into unknown readable memory: 0x006200657a690000 | 00 00 69 7a 65 00 62 00
|
||||
RSP=0x000000549c5ff6d8 is pointing into the stack for thread: 0x000001b7f7801df0
|
||||
RBP=0x000000549c5ff768 is pointing into the stack for thread: 0x000001b7f7801df0
|
||||
RSI=0x000001b7a5afb998 is pointing into metadata
|
||||
RDI=0x0000000000000001 is an unknown value
|
||||
R8 =0x000000000000809d is an unknown value
|
||||
R9 =0x000001b7aa035008 points into unknown readable memory: 0x006200657a690000 | 00 00 69 7a 65 00 62 00
|
||||
R10=0x0 is NULL
|
||||
R11=0x000000062b44f290 is an oop: java.lang.Class
|
||||
{0x000000062b44f290} - klass: 'java/lang/Class'
|
||||
- ---- fields (total size 116 words):
|
||||
- private volatile transient 'classRedefinedCount' 'I' @12 0
|
||||
- abstract internal 'klass' 'J' @16 34376626080 (101afa0 8)
|
||||
- abstract internal 'array_klass' 'J' @24 0 (0 0)
|
||||
- abstract internal 'oop_size' 'I' @32 116 (74)
|
||||
- abstract internal 'static_oop_field_count' 'I' @36 0
|
||||
- private volatile transient 'cachedConstructor' 'Ljava/lang/reflect/Constructor;' @40 NULL (0)
|
||||
- private transient 'name' 'Ljava/lang/String;' @44 "org.lwjgl.opengl.GL11C"{0x000000062b44f640} (c5689ec8)
|
||||
- private transient 'module' 'Ljava/lang/Module;' @48 a 'java/lang/Module'{0x000000062c86c9c8} (c590d939)
|
||||
- private final 'classLoader' 'Ljava/lang/ClassLoader;' @52 a 'jdk/internal/loader/ClassLoaders$AppClassLoader'{0x000000062c86c808} (c590d901)
|
||||
- private transient 'classData' 'Ljava/lang/Object;' @56 NULL (0)
|
||||
- private transient 'packageName' 'Ljava/lang/String;' @60 "org.lwjgl.opengl"{0x000000062bff7af0} (c57fef5e)
|
||||
- private final 'componentType' 'Ljava/lang/Class;' @64 NULL (0)
|
||||
- private volatile transient 'reflectionData' 'Ljava/lang/ref/SoftReference;' @68 NULL (0)
|
||||
- private volatile transient 'genericInfo' 'Lsun/reflect/generics/repository/ClassRepository;' @72 NULL (0)
|
||||
- private volatile transient 'enumConstants' '[Ljava/lang/Object;' @76 NULL (0)
|
||||
- private volatile transient 'enumConstantDirectory' 'Ljava/util/Map;' @80 NULL (0)
|
||||
- private volatile transient 'annotationData' 'Ljava/lang/Class$AnnotationData;' @84 NULL (0)
|
||||
- private volatile transient 'annotationType' 'Lsun/reflect/annotation/AnnotationType;' @88 NULL (0)
|
||||
- transient 'classValueMap' 'Ljava/lang/ClassValue$ClassValueMap;' @92 NULL (0)
|
||||
- abstract internal 'protection_domain' 'Ljava/lang/Object;' @96 a 'java/security/ProtectionDomain'{0x000000062b810610} (c57020c2)
|
||||
- abstract internal 'signers_name' 'Ljava/lang/Object;' @100 NULL (0)
|
||||
- abstract internal 'source_file' 'Ljava/lang/Object;' @104 NULL (0)
|
||||
- signature: Lorg/lwjgl/opengl/GL11C;
|
||||
- ---- static fields (0):
|
||||
- public static final 'GL_NEVER' 'I' @112 512 (200)
|
||||
- public static final 'GL_LESS' 'I' @116 513 (201)
|
||||
- public static final 'GL_EQUAL' 'I' @120 514 (202)
|
||||
- public static final 'GL_LEQUAL' 'I' @124 515 (203)
|
||||
- public static final 'GL_GREATER' 'I' @128 516 (204)
|
||||
- public static final 'GL_NOTEQUAL' 'I' @132 517 (205)
|
||||
- public static final 'GL_GEQUAL' 'I' @136 518 (206)
|
||||
- public static final 'GL_ALWAYS' 'I' @140 519 (207)
|
||||
- public static final 'GL_DEPTH_BUFFER_BIT' 'I' @144 256 (100)
|
||||
- public static final 'GL_STENCIL_BUFFER_BIT' 'I' @148 1024 (400)
|
||||
- public static final 'GL_COLOR_BUFFER_BIT' 'I' @152 16384 (4000)
|
||||
- public static final 'GL_POINTS' 'I' @156 0
|
||||
- public static final 'GL_LINES' 'I' @160 1
|
||||
- public static final 'GL_LINE_LOOP' 'I' @164 2
|
||||
- public static final 'GL_LINE_STRIP' 'I' @168 3
|
||||
- public static final 'GL_TRIANGLES' 'I' @172 4
|
||||
- public static final 'GL_TRIANGLE_STRIP' 'I' @176 5
|
||||
- public static final 'GL_TRIANGLE_FAN' 'I' @180 6
|
||||
- public static final 'GL_QUADS' 'I' @184 7
|
||||
- public static final 'GL_ZERO' 'I' @188 0
|
||||
- public static final 'GL_ONE' 'I' @192 1
|
||||
- public static final 'GL_SRC_COLOR' 'I' @196 768 (300)
|
||||
- public static final 'GL_ONE_MINUS_SRC_COLOR' 'I' @200 769 (301)
|
||||
- public static final 'GL_SRC_ALPHA' 'I' @204 770 (302)
|
||||
- public static final 'GL_ONE_MINUS_SRC_ALPHA' 'I' @208 771 (303)
|
||||
- public static final 'GL_DST_ALPHA' 'I' @212 772 (304)
|
||||
- public static final 'GL_ONE_MINUS_DST_ALPHA' 'I' @216 773 (305)
|
||||
- public static final 'GL_DST_COLOR' 'I' @220 774 (306)
|
||||
- public static final 'GL_ONE_MINUS_DST_COLOR' 'I' @224 775 (307)
|
||||
- public static final 'GL_SRC_ALPHA_SATURATE' 'I' @228 776 (308)
|
||||
- public static final 'GL_TRUE' 'I' @232 1
|
||||
- public static final 'GL_FALSE' 'I' @236 0
|
||||
- public static final 'GL_BYTE' 'I' @240 5120 (1400)
|
||||
- public static final 'GL_UNSIGNED_BYTE' 'I' @244 5121 (1401)
|
||||
- public static final 'GL_SHORT' 'I' @248 5122 (1402)
|
||||
- public static final 'GL_UNSIGNED_SHORT' 'I' @252 5123 (1403)
|
||||
- public static final 'GL_INT' 'I' @256 5124 (1404)
|
||||
- public static final 'GL_UNSIGNED_INT' 'I' @260 5125 (1405)
|
||||
- public static final 'GL_FLOAT' 'I' @264 5126 (1406)
|
||||
- public static final 'GL_DOUBLE' 'I' @268 5130 (140a)
|
||||
- public static final 'GL_NONE' 'I' @272 0
|
||||
- public static final 'GL_FRONT_LEFT' 'I' @276 1024 (400)
|
||||
- public static final 'GL_FRONT_RIGHT' 'I' @280 1025 (401)
|
||||
- public static final 'GL_BACK_LEFT' 'I' @284 1026 (402)
|
||||
- public static final 'GL_BACK_RIGHT' 'I' @288 1027 (403)
|
||||
- public static final 'GL_FRONT' 'I' @292 1028 (404)
|
||||
- public static final 'GL_BACK' 'I' @296 1029 (405)
|
||||
- public static final 'GL_LEFT' 'I' @300 1030 (406)
|
||||
- public static final 'GL_RIGHT' 'I' @304 1031 (407)
|
||||
- public static final 'GL_FRONT_AND_BACK' 'I' @308 1032 (408)
|
||||
- public static final 'GL_NO_ERROR' 'I' @312 0
|
||||
- public static final 'GL_INVALID_ENUM' 'I' @316 1280 (500)
|
||||
- public static final 'GL_INVALID_VALUE' 'I' @320 1281 (501)
|
||||
- public static final 'GL_INVALID_OPERATION' 'I' @324 1282 (502)
|
||||
- public static final 'GL_STACK_OVERFLOW' 'I' @328 1283 (503)
|
||||
- public static final 'GL_STACK_UNDERFLOW' 'I' @332 1284 (504)
|
||||
- public static final 'GL_OUT_OF_MEMORY' 'I' @336 1285 (505)
|
||||
- public static final 'GL_CW' 'I' @340 2304 (900)
|
||||
- public static final 'GL_CCW' 'I' @344 2305 (901)
|
||||
- public static final 'GL_POINT_SIZE' 'I' @348 2833 (b11)
|
||||
- public static final 'GL_POINT_SIZE_RANGE' 'I' @352 2834 (b12)
|
||||
- public static final 'GL_POINT_SIZE_GRANULARITY' 'I' @356 2835 (b13)
|
||||
- public static final 'GL_LINE_SMOOTH' 'I' @360 2848 (b20)
|
||||
- public static final 'GL_LINE_WIDTH' 'I' @364 2849 (b21)
|
||||
- public static final 'GL_LINE_WIDTH_RANGE' 'I' @368 2850 (b22)
|
||||
- public static final 'GL_LINE_WIDTH_GRANULARITY' 'I' @372 2851 (b23)
|
||||
- public static final 'GL_POLYGON_MODE' 'I' @376 2880 (b40)
|
||||
- public static final 'GL_POLYGON_SMOOTH' 'I' @380 2881 (b41)
|
||||
- public static final 'GL_CULL_FACE' 'I' @384 2884 (b44)
|
||||
- public static final 'GL_CULL_FACE_MODE' 'I' @388 2885 (b45)
|
||||
- public static final 'GL_FRONT_FACE' 'I' @392 2886 (b46)
|
||||
- public static final 'GL_DEPTH_RANGE' 'I' @396 2928 (b70)
|
||||
- public static final 'GL_DEPTH_TEST' 'I' @400 2929 (b71)
|
||||
- public static final 'GL_DEPTH_WRITEMASK' 'I' @404 2930 (b72)
|
||||
- public static final 'GL_DEPTH_CLEAR_VALUE' 'I' @408 2931 (b73)
|
||||
- public static final 'GL_DEPTH_FUNC' 'I' @412 2932 (b74)
|
||||
- public static final 'GL_STENCIL_TEST' 'I' @416 2960 (b90)
|
||||
- public static final 'GL_STENCIL_CLEAR_VALUE' 'I' @420 2961 (b91)
|
||||
- public static final 'GL_STENCIL_FUNC' 'I' @424 2962 (b92)
|
||||
- public static final 'GL_STENCIL_VALUE_MASK' 'I' @428 2963 (b93)
|
||||
- public static final 'GL_STENCIL_FAIL' 'I' @432 2964 (b94)
|
||||
- public static final 'GL_STENCIL_PASS_DEPTH_FAIL' 'I' @436 2965 (b95)
|
||||
- public static final 'GL_STENCIL_PASS_DEPTH_PASS' 'I' @440 2966 (b96)
|
||||
- public static final 'GL_STENCIL_REF' 'I' @444 2967 (b97)
|
||||
- public static final 'GL_STENCIL_WRITEMASK' 'I' @448 2968 (b98)
|
||||
- public static final 'GL_VIEWPORT' 'I' @452 2978 (ba2)
|
||||
- public static final 'GL_DITHER' 'I' @456 3024 (bd0)
|
||||
- public static final 'GL_BLEND_DST' 'I' @460 3040 (be0)
|
||||
- public static final 'GL_BLEND_SRC' 'I' @464 3041 (be1)
|
||||
- public static final 'GL_BLEND' 'I' @468 3042 (be2)
|
||||
- public static final 'GL_LOGIC_OP_MODE' 'I' @472 3056 (bf0)
|
||||
- public static final 'GL_COLOR_LOGIC_OP' 'I' @476 3058 (bf2)
|
||||
- public static final 'GL_DRAW_BUFFER' 'I' @480 3073 (c01)
|
||||
- public static final 'GL_READ_BUFFER' 'I' @484 3074 (c02)
|
||||
- public static final 'GL_SCISSOR_BOX' 'I' @488 3088 (c10)
|
||||
- public static final 'GL_SCISSOR_TEST' 'I' @492 3089 (c11)
|
||||
- public static final 'GL_COLOR_CLEAR_VALUE' 'I' @496 3106 (c22)
|
||||
- public static final 'GL_COLOR_WRITEMASK' 'I' @500 3107 (c23)
|
||||
- public static final 'GL_DOUBLEBUFFER' 'I' @504 3122 (c32)
|
||||
- public static final 'GL_STEREO' 'I' @508 3123 (c33)
|
||||
- public static final 'GL_LINE_SMOOTH_HINT' 'I' @512 3154 (c52)
|
||||
- public static final 'GL_POLYGON_SMOOTH_HINT' 'I' @516 3155 (c53)
|
||||
- public static final 'GL_UNPACK_SWAP_BYTES' 'I' @520 3312 (cf0)
|
||||
- public static final 'GL_UNPACK_LSB_FIRST' 'I' @524 3313 (cf1)
|
||||
- public static final 'GL_UNPACK_ROW_LENGTH' 'I' @528 3314 (cf2)
|
||||
- public static final 'GL_UNPACK_SKIP_ROWS' 'I' @532 3315 (cf3)
|
||||
- public static final 'GL_UNPACK_SKIP_PIXELS' 'I' @536 3316 (cf4)
|
||||
- public static final 'GL_UNPACK_ALIGNMENT' 'I' @540 3317 (cf5)
|
||||
- public static final 'GL_PACK_SWAP_BYTES' 'I' @544 3328 (d00)
|
||||
- public static final 'GL_PACK_LSB_FIRST' 'I' @548 3329 (d01)
|
||||
- public static final 'GL_PACK_ROW_LENGTH' 'I' @552 3330 (d02)
|
||||
- public static final 'GL_PACK_SKIP_ROWS' 'I' @556 3331 (d03)
|
||||
- public static final 'GL_PACK_SKIP_PIXELS' 'I' @560 3332 (d04)
|
||||
- public static final 'GL_PACK_ALIGNMENT' 'I' @564 3333 (d05)
|
||||
- public static final 'GL_MAX_TEXTURE_SIZE' 'I' @568 3379 (d33)
|
||||
- public static final 'GL_MAX_VIEWPORT_DIMS' 'I' @572 3386 (d3a)
|
||||
- public static final 'GL_SUBPIXEL_BITS' 'I' @576 3408 (d50)
|
||||
- public static final 'GL_TEXTURE_1D' 'I' @580 3552 (de0)
|
||||
- public static final 'GL_TEXTURE_2D' 'I' @584 3553 (de1)
|
||||
- public static final 'GL_TEXTURE_WIDTH' 'I' @588 4096 (1000)
|
||||
- public static final 'GL_TEXTURE_HEIGHT' 'I' @592 4097 (1001)
|
||||
- public static final 'GL_TEXTURE_INTERNAL_FORMAT' 'I' @596 4099 (1003)
|
||||
- public static final 'GL_TEXTURE_BORDER_COLOR' 'I' @600 4100 (1004)
|
||||
- public static final 'GL_DONT_CARE' 'I' @604 4352 (1100)
|
||||
- public static final 'GL_FASTEST' 'I' @608 4353 (1101)
|
||||
- public static final 'GL_NICEST' 'I' @612 4354 (1102)
|
||||
- public static final 'GL_CLEAR' 'I' @616 5376 (1500)
|
||||
- public static final 'GL_AND' 'I' @620 5377 (1501)
|
||||
- public static final 'GL_AND_REVERSE' 'I' @624 5378 (1502)
|
||||
- public static final 'GL_COPY' 'I' @628 5379 (1503)
|
||||
- public static final 'GL_AND_INVERTED' 'I' @632 5380 (1504)
|
||||
- public static final 'GL_NOOP' 'I' @636 5381 (1505)
|
||||
- public static final 'GL_XOR' 'I' @640 5382 (1506)
|
||||
- public static final 'GL_OR' 'I' @644 5383 (1507)
|
||||
- public static final 'GL_NOR' 'I' @648 5384 (1508)
|
||||
- public static final 'GL_EQUIV' 'I' @652 5385 (1509)
|
||||
- public static final 'GL_INVERT' 'I' @656 5386 (150a)
|
||||
- public static final 'GL_OR_REVERSE' 'I' @660 5387 (150b)
|
||||
- public static final 'GL_COPY_INVERTED' 'I' @664 5388 (150c)
|
||||
- public static final 'GL_OR_INVERTED' 'I' @668 5389 (150d)
|
||||
- public static final 'GL_NAND' 'I' @672 5390 (150e)
|
||||
- public static final 'GL_SET' 'I' @676 5391 (150f)
|
||||
- public static final 'GL_TEXTURE' 'I' @680 5890 (1702)
|
||||
- public static final 'GL_COLOR' 'I' @684 6144 (1800)
|
||||
- public static final 'GL_DEPTH' 'I' @688 6145 (1801)
|
||||
- public static final 'GL_STENCIL' 'I' @692 6146 (1802)
|
||||
- public static final 'GL_STENCIL_INDEX' 'I' @696 6401 (1901)
|
||||
- public static final 'GL_DEPTH_COMPONENT' 'I' @700 6402 (1902)
|
||||
- public static final 'GL_RED' 'I' @704 6403 (1903)
|
||||
- public static final 'GL_GREEN' 'I' @708 6404 (1904)
|
||||
- public static final 'GL_BLUE' 'I' @712 6405 (1905)
|
||||
- public static final 'GL_ALPHA' 'I' @716 6406 (1906)
|
||||
- public static final 'GL_RGB' 'I' @720 6407 (1907)
|
||||
- public static final 'GL_RGBA' 'I' @724 6408 (1908)
|
||||
- public static final 'GL_POINT' 'I' @728 6912 (1b00)
|
||||
- public static final 'GL_LINE' 'I' @732 6913 (1b01)
|
||||
- public static final 'GL_FILL' 'I' @736 6914 (1b02)
|
||||
- public static final 'GL_KEEP' 'I' @740 7680 (1e00)
|
||||
- public static final 'GL_REPLACE' 'I' @744 7681 (1e01)
|
||||
- public static final 'GL_INCR' 'I' @748 7682 (1e02)
|
||||
- public static final 'GL_DECR' 'I' @752 7683 (1e03)
|
||||
- public static final 'GL_VENDOR' 'I' @756 7936 (1f00)
|
||||
- public static final 'GL_RENDERER' 'I' @760 7937 (1f01)
|
||||
- public static final 'GL_VERSION' 'I' @764 7938 (1f02)
|
||||
- public static final 'GL_EXTENSIONS' 'I' @768 7939 (1f03)
|
||||
- public static final 'GL_NEAREST' 'I' @772 9728 (2600)
|
||||
- public static final 'GL_LINEAR' 'I' @776 9729 (2601)
|
||||
- public static final 'GL_NEAREST_MIPMAP_NEAREST' 'I' @780 9984 (2700)
|
||||
- public static final 'GL_LINEAR_MIPMAP_NEAREST' 'I' @784 9985 (2701)
|
||||
- public static final 'GL_NEAREST_MIPMAP_LINEAR' 'I' @788 9986 (2702)
|
||||
- public static final 'GL_LINEAR_MIPMAP_LINEAR' 'I' @792 9987 (2703)
|
||||
- public static final 'GL_TEXTURE_MAG_FILTER' 'I' @796 10240 (2800)
|
||||
- public static final 'GL_TEXTURE_MIN_FILTER' 'I' @800 10241 (2801)
|
||||
- public static final 'GL_TEXTURE_WRAP_S' 'I' @804 10242 (2802)
|
||||
- public static final 'GL_TEXTURE_WRAP_T' 'I' @808 10243 (2803)
|
||||
- public static final 'GL_REPEAT' 'I' @812 10497 (2901)
|
||||
- public static final 'GL_POLYGON_OFFSET_FACTOR' 'I' @816 32824 (8038)
|
||||
- public static final 'GL_POLYGON_OFFSET_UNITS' 'I' @820 10752 (2a00)
|
||||
- public static final 'GL_POLYGON_OFFSET_POINT' 'I' @824 10753 (2a01)
|
||||
- public static final 'GL_POLYGON_OFFSET_LINE' 'I' @828 10754 (2a02)
|
||||
- public static final 'GL_POLYGON_OFFSET_FILL' 'I' @832 32823 (8037)
|
||||
- public static final 'GL_R3_G3_B2' 'I' @836 10768 (2a10)
|
||||
- public static final 'GL_RGB4' 'I' @840 32847 (804f)
|
||||
- public static final 'GL_RGB5' 'I' @844 32848 (8050)
|
||||
- public static final 'GL_RGB8' 'I' @848 32849 (8051)
|
||||
- public static final 'GL_RGB10' 'I' @852 32850 (8052)
|
||||
- public static final 'GL_RGB12' 'I' @856 32851 (8053)
|
||||
- public static final 'GL_RGB16' 'I' @860 32852 (8054)
|
||||
- public static final 'GL_RGBA2' 'I' @864 32853 (8055)
|
||||
- public static final 'GL_RGBA4' 'I' @868 32854 (8056)
|
||||
- public static final 'GL_RGB5_A1' 'I' @872 32855 (8057)
|
||||
- public static final 'GL_RGBA8' 'I' @876 32856 (8058)
|
||||
- public static final 'GL_RGB10_A2' 'I' @880 32857 (8059)
|
||||
- public static final 'GL_RGBA12' 'I' @884 32858 (805a)
|
||||
- public static final 'GL_RGBA16' 'I' @888 32859 (805b)
|
||||
- public static final 'GL_TEXTURE_RED_SIZE' 'I' @892 32860 (805c)
|
||||
- public static final 'GL_TEXTURE_GREEN_SIZE' 'I' @896 32861 (805d)
|
||||
- public static final 'GL_TEXTURE_BLUE_SIZE' 'I' @900 32862 (805e)
|
||||
- public static final 'GL_TEXTURE_ALPHA_SIZE' 'I' @904 32863 (805f)
|
||||
- public static final 'GL_PROXY_TEXTURE_1D' 'I' @908 32867 (8063)
|
||||
- public static final 'GL_PROXY_TEXTURE_2D' 'I' @912 32868 (8064)
|
||||
- public static final 'GL_TEXTURE_BINDING_1D' 'I' @916 32872 (8068)
|
||||
- public static final 'GL_TEXTURE_BINDING_2D' 'I' @920 32873 (8069)
|
||||
- public static final 'GL_VERTEX_ARRAY' 'I' @924 32884 (8074)
|
||||
R12=0x0 is NULL
|
||||
R13={method} {0x000001b7a5dcdd50} 'nglGetBooleanv' '(IJ)V' in 'org/lwjgl/opengl/GL11C'
|
||||
R14=0x000000549c5ff798 is pointing into the stack for thread: 0x000001b7f7801df0
|
||||
R15=0x000001b7f7801df0 is a thread
|
||||
|
||||
|
||||
Top of Stack: (sp=0x000000549c5ff6d8)
|
||||
0x000000549c5ff6d8: 000001b787473478 0000000000000001
|
||||
0x000000549c5ff6e8: 000001b787472dba 000001b7a5dcdd48
|
||||
0x000000549c5ff6f8: 000001b7a5afb998 0000000000000000
|
||||
0x000000549c5ff708: 000000549c5ff720 000000549c5ff780
|
||||
0x000000549c5ff718: 000001b787472d76 000000549c5ff720
|
||||
0x000000549c5ff728: 000001b7a5dcdd48 000000549c5ff798
|
||||
0x000000549c5ff738: 000001b7a5dd8000 0000000000000000
|
||||
0x000000549c5ff748: 000000062b44f290 000001b7a5dcdd48
|
||||
0x000000549c5ff758: 0000000000000000 000000549c5ff788
|
||||
0x000000549c5ff768: 000000549c5ff7e8 000001b78746c11a
|
||||
0x000000549c5ff778: 000000062b44f290 000001b78746f557
|
||||
0x000000549c5ff788: 000001b7aa035008 0000000000000000
|
||||
0x000000549c5ff798: 000000000000809d 000000549c5ff7a0
|
||||
0x000000549c5ff7a8: 000001b7a5dcdefc 000000549c5ff820
|
||||
0x000000549c5ff7b8: 000001b7a5dd8000 0000000000000000
|
||||
0x000000549c5ff7c8: 000000062b44f290 000001b7a5dcdf88
|
||||
|
||||
Instructions: (pc=0x00007ff8b13cc79d)
|
||||
0x00007ff8b13cc69d: cc cc cc 48 8b 01 45 8b d8 44 8b 44 24 28 41 8b
|
||||
0x00007ff8b13cc6ad: d1 41 8b cb 4c 8b 50 18 49 ff a2 e8 01 00 00 cc
|
||||
0x00007ff8b13cc6bd: cc cc cc 48 8b 01 41 8b c8 48 8b 50 18 48 ff a2
|
||||
0x00007ff8b13cc6cd: f0 01 00 00 cc cc cc cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc6dd: cc cc cc 40 53 48 8b 01 41 8b d8 44 8b 44 24 30
|
||||
0x00007ff8b13cc6ed: 41 8b d1 4c 8b 4c 24 38 8b cb 4c 8b 50 18 5b 49
|
||||
0x00007ff8b13cc6fd: ff a2 f8 01 00 00 cc cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc70d: cc cc cc 48 8b 01 48 8b 48 18 48 ff a1 98 02 00
|
||||
0x00007ff8b13cc71d: 00 cc cc 48 8b 01 48 8b 48 18 48 ff a1 a0 02 00
|
||||
0x00007ff8b13cc72d: 00 cc cc 48 8b 01 41 8b c8 48 8b 50 18 48 ff a2
|
||||
0x00007ff8b13cc73d: c8 02 00 00 cc cc cc cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc74d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc75d: 49 ff a2 d8 02 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc76d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc77d: 49 ff a2 e0 02 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc78d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc79d: 49 ff a2 f0 02 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc7ad: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc7bd: 49 ff a2 f8 02 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc7cd: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc7dd: 49 ff a2 00 03 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc7ed: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc7fd: 49 ff a2 08 03 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc80d: cc cc cc 48 8b 01 48 8b 48 18 48 8b 81 10 03 00
|
||||
0x00007ff8b13cc81d: 00 48 ff e0 cc cc cc cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc82d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
|
||||
0x00007ff8b13cc83d: 49 ff a2 68 03 00 00 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc84d: cc cc cc 48 8b 01 48 8b 48 18 48 8b 81 78 03 00
|
||||
0x00007ff8b13cc85d: 00 41 8b c8 48 ff e0 cc cc cc cc cc cc cc cc cc
|
||||
0x00007ff8b13cc86d: cc cc cc 40 53 48 8b 01 41 8b d8 44 8b 44 24 30
|
||||
0x00007ff8b13cc87d: 41 8b d1 44 8b 4c 24 38 8b cb 4c 8b 50 18 48 8b
|
||||
0x00007ff8b13cc88d: 44 24 40 48 89 44 24 30 5b 49 ff a2 a8 03 00 00
|
||||
|
||||
|
||||
Stack slot to memory mapping:
|
||||
stack at sp + 0 slots: 0x000001b787473478 is at code_begin+1976 in an Interpreter codelet
|
||||
method entry point (kind = native) [0x000001b787472cc0, 0x000001b787474000] 4928 bytes
|
||||
stack at sp + 1 slots: 0x0000000000000001 is an unknown value
|
||||
stack at sp + 2 slots: 0x000001b787472dba is at code_begin+250 in an Interpreter codelet
|
||||
method entry point (kind = native) [0x000001b787472cc0, 0x000001b787474000] 4928 bytes
|
||||
stack at sp + 3 slots: {method} {0x000001b7a5dcdd50} 'nglGetBooleanv' '(IJ)V' in 'org/lwjgl/opengl/GL11C'
|
||||
stack at sp + 4 slots: 0x000001b7a5afb998 is pointing into metadata
|
||||
stack at sp + 5 slots: 0x0 is NULL
|
||||
stack at sp + 6 slots: 0x000000549c5ff720 is pointing into the stack for thread: 0x000001b7f7801df0
|
||||
stack at sp + 7 slots: 0x000000549c5ff780 is pointing into the stack for thread: 0x000001b7f7801df0
|
||||
|
||||
|
||||
--------------- P R O C E S S ---------------
|
||||
|
||||
Threads class SMR info:
|
||||
_java_thread_list=0x000001b7a55cc070, length=19, elements={
|
||||
0x000001b7f7801df0, 0x000001b7a4262ce0, 0x000001b7a4264270, 0x000001b7a4266200,
|
||||
0x000001b7a42684e0, 0x000001b7a426cfb0, 0x000001b7a426c5d0, 0x000001b7a4272110,
|
||||
0x000001b7a427eae0, 0x000001b7a4289060, 0x000001b7a55067f0, 0x000001b7a5507e80,
|
||||
0x000001b7a550c420, 0x000001b7a5525550, 0x000001b7a55c40c0, 0x000001b7a55ba2c0,
|
||||
0x000001b7a55ba810, 0x000001b7a9cb7650, 0x000001b7a9d4f890
|
||||
}
|
||||
|
||||
Java Threads: ( => current thread )
|
||||
=>0x000001b7f7801df0 JavaThread "main" [_thread_in_native, id=6384, stack(0x000000549c500000,0x000000549c600000)]
|
||||
0x000001b7a4262ce0 JavaThread "Reference Handler" daemon [_thread_blocked, id=17712, stack(0x000000549cc00000,0x000000549cd00000)]
|
||||
0x000001b7a4264270 JavaThread "Finalizer" daemon [_thread_blocked, id=13484, stack(0x000000549cd00000,0x000000549ce00000)]
|
||||
0x000001b7a4266200 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=13520, stack(0x000000549ce00000,0x000000549cf00000)]
|
||||
0x000001b7a42684e0 JavaThread "Attach Listener" daemon [_thread_blocked, id=4268, stack(0x000000549cf00000,0x000000549d000000)]
|
||||
0x000001b7a426cfb0 JavaThread "Service Thread" daemon [_thread_blocked, id=9864, stack(0x000000549d000000,0x000000549d100000)]
|
||||
0x000001b7a426c5d0 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=12076, stack(0x000000549d100000,0x000000549d200000)]
|
||||
0x000001b7a4272110 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=8124, stack(0x000000549d200000,0x000000549d300000)]
|
||||
0x000001b7a427eae0 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=11212, stack(0x000000549d300000,0x000000549d400000)]
|
||||
0x000001b7a4289060 JavaThread "Sweeper thread" daemon [_thread_blocked, id=7964, stack(0x000000549d400000,0x000000549d500000)]
|
||||
0x000001b7a55067f0 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=3064, stack(0x000000549d500000,0x000000549d600000)]
|
||||
0x000001b7a5507e80 JavaThread "C1 CompilerThread1" daemon [_thread_blocked, id=1292, stack(0x000000549d600000,0x000000549d700000)]
|
||||
0x000001b7a550c420 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=12712, stack(0x000000549d700000,0x000000549d800000)]
|
||||
0x000001b7a5525550 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=4864, stack(0x000000549d800000,0x000000549d900000)]
|
||||
0x000001b7a55c40c0 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=8996, stack(0x000000549d900000,0x000000549da00000)]
|
||||
0x000001b7a55ba2c0 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=20132, stack(0x000000549da00000,0x000000549db00000)]
|
||||
0x000001b7a55ba810 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=8152, stack(0x000000549db00000,0x000000549dc00000)]
|
||||
0x000001b7a9cb7650 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=13052, stack(0x000000549dc00000,0x000000549dd00000)]
|
||||
0x000001b7a9d4f890 JavaThread "Notification Thread" daemon [_thread_blocked, id=12976, stack(0x000000549dd00000,0x000000549de00000)]
|
||||
|
||||
Other Threads:
|
||||
0x000001b7f7825aa0 VMThread "VM Thread" [stack: 0x000000549cb00000,0x000000549cc00000] [id=1132]
|
||||
0x000001b7a9e14d40 WatcherThread "VM Periodic Task Thread" [stack: 0x000000549de00000,0x000000549df00000] [id=5172]
|
||||
0x000001b7f7825500 WorkerThread "GC Thread#0" [stack: 0x000000549c600000,0x000000549c700000] [id=9320]
|
||||
0x000001b7f78c5ce0 ConcurrentGCThread "G1 Main Marker" [stack: 0x000000549c700000,0x000000549c800000] [id=18060]
|
||||
0x000001b7f7825230 WorkerThread "G1 Conc#0" [stack: 0x000000549c800000,0x000000549c900000] [id=13100]
|
||||
0x000001b7a41838f0 ConcurrentGCThread "G1 Refine#0" [stack: 0x000000549c900000,0x000000549ca00000] [id=3660]
|
||||
0x000001b7a4184340 ConcurrentGCThread "G1 Service" [stack: 0x000000549ca00000,0x000000549cb00000] [id=3504]
|
||||
|
||||
Threads with active compile tasks:
|
||||
|
||||
VM state: not at safepoint (normal execution)
|
||||
|
||||
VM Mutex/Monitor currently owned by a thread: None
|
||||
|
||||
Heap address: 0x000000060d800000, size: 7976 MB, Compressed Oops mode: Zero based, Oop shift amount: 3
|
||||
|
||||
CDS archive(s) mapped at: [0x0000000800000000-0x0000000800c40000-0x0000000800c40000), size 12845056, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 0.
|
||||
Compressed class space mapped at: 0x0000000801000000-0x0000000841000000, reserved size: 1073741824
|
||||
Narrow klass base: 0x0000000800000000, Narrow klass shift: 0, Narrow klass range: 0x100000000
|
||||
|
||||
GC Precious Log:
|
||||
CardTable entry size: 512
|
||||
Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 32 size 80 Howl #buckets 8 coarsen threshold 7372 Howl Bitmap #cards 1024 size 144 coarsen threshold 921 Card regions per heap region 1 cards per card region 8192
|
||||
CPUs: 24 total, 24 available
|
||||
Memory: 31894M
|
||||
Large Page Support: Disabled
|
||||
NUMA Support: Disabled
|
||||
Compressed Oops: Enabled (Zero based)
|
||||
Heap Region Size: 4M
|
||||
Heap Min Capacity: 8M
|
||||
Heap Initial Capacity: 500M
|
||||
Heap Max Capacity: 7976M
|
||||
Pre-touch: Disabled
|
||||
Parallel Workers: 18
|
||||
Concurrent Workers: 5
|
||||
Concurrent Refinement Workers: 18
|
||||
Periodic GC: Disabled
|
||||
|
||||
Heap:
|
||||
garbage-first heap total 512000K, used 20480K [0x000000060d800000, 0x0000000800000000)
|
||||
region size 4096K, 6 young (24576K), 0 survivors (0K)
|
||||
Metaspace used 5386K, committed 5568K, reserved 1114112K
|
||||
class space used 375K, committed 448K, reserved 1048576K
|
||||
|
||||
Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, OA=open archive, CA=closed archive, TAMS=top-at-mark-start (previous, next)
|
||||
| 0|0x000000060d800000, 0x000000060d800000, 0x000000060dc00000| 0%| F| |TAMS 0x000000060d800000, 0x000000060d800000| Untracked
|
||||
| 1|0x000000060dc00000, 0x000000060dc00000, 0x000000060e000000| 0%| F| |TAMS 0x000000060dc00000, 0x000000060dc00000| Untracked
|
||||
| 2|0x000000060e000000, 0x000000060e000000, 0x000000060e400000| 0%| F| |TAMS 0x000000060e000000, 0x000000060e000000| Untracked
|
||||
| 3|0x000000060e400000, 0x000000060e400000, 0x000000060e800000| 0%| F| |TAMS 0x000000060e400000, 0x000000060e400000| Untracked
|
||||
| 4|0x000000060e800000, 0x000000060e800000, 0x000000060ec00000| 0%| F| |TAMS 0x000000060e800000, 0x000000060e800000| Untracked
|
||||
| 5|0x000000060ec00000, 0x000000060ec00000, 0x000000060f000000| 0%| F| |TAMS 0x000000060ec00000, 0x000000060ec00000| Untracked
|
||||
| 6|0x000000060f000000, 0x000000060f000000, 0x000000060f400000| 0%| F| |TAMS 0x000000060f000000, 0x000000060f000000| Untracked
|
||||
| 7|0x000000060f400000, 0x000000060f400000, 0x000000060f800000| 0%| F| |TAMS 0x000000060f400000, 0x000000060f400000| Untracked
|
||||
| 8|0x000000060f800000, 0x000000060f800000, 0x000000060fc00000| 0%| F| |TAMS 0x000000060f800000, 0x000000060f800000| Untracked
|
||||
| 9|0x000000060fc00000, 0x000000060fc00000, 0x0000000610000000| 0%| F| |TAMS 0x000000060fc00000, 0x000000060fc00000| Untracked
|
||||
| 10|0x0000000610000000, 0x0000000610000000, 0x0000000610400000| 0%| F| |TAMS 0x0000000610000000, 0x0000000610000000| Untracked
|
||||
| 11|0x0000000610400000, 0x0000000610400000, 0x0000000610800000| 0%| F| |TAMS 0x0000000610400000, 0x0000000610400000| Untracked
|
||||
| 12|0x0000000610800000, 0x0000000610800000, 0x0000000610c00000| 0%| F| |TAMS 0x0000000610800000, 0x0000000610800000| Untracked
|
||||
| 13|0x0000000610c00000, 0x0000000610c00000, 0x0000000611000000| 0%| F| |TAMS 0x0000000610c00000, 0x0000000610c00000| Untracked
|
||||
| 14|0x0000000611000000, 0x0000000611000000, 0x0000000611400000| 0%| F| |TAMS 0x0000000611000000, 0x0000000611000000| Untracked
|
||||
| 15|0x0000000611400000, 0x0000000611400000, 0x0000000611800000| 0%| F| |TAMS 0x0000000611400000, 0x0000000611400000| Untracked
|
||||
| 16|0x0000000611800000, 0x0000000611800000, 0x0000000611c00000| 0%| F| |TAMS 0x0000000611800000, 0x0000000611800000| Untracked
|
||||
| 17|0x0000000611c00000, 0x0000000611c00000, 0x0000000612000000| 0%| F| |TAMS 0x0000000611c00000, 0x0000000611c00000| Untracked
|
||||
| 18|0x0000000612000000, 0x0000000612000000, 0x0000000612400000| 0%| F| |TAMS 0x0000000612000000, 0x0000000612000000| Untracked
|
||||
| 19|0x0000000612400000, 0x0000000612400000, 0x0000000612800000| 0%| F| |TAMS 0x0000000612400000, 0x0000000612400000| Untracked
|
||||
| 20|0x0000000612800000, 0x0000000612800000, 0x0000000612c00000| 0%| F| |TAMS 0x0000000612800000, 0x0000000612800000| Untracked
|
||||
| 21|0x0000000612c00000, 0x0000000612c00000, 0x0000000613000000| 0%| F| |TAMS 0x0000000612c00000, 0x0000000612c00000| Untracked
|
||||
| 22|0x0000000613000000, 0x0000000613000000, 0x0000000613400000| 0%| F| |TAMS 0x0000000613000000, 0x0000000613000000| Untracked
|
||||
| 23|0x0000000613400000, 0x0000000613400000, 0x0000000613800000| 0%| F| |TAMS 0x0000000613400000, 0x0000000613400000| Untracked
|
||||
| 24|0x0000000613800000, 0x0000000613800000, 0x0000000613c00000| 0%| F| |TAMS 0x0000000613800000, 0x0000000613800000| Untracked
|
||||
| 25|0x0000000613c00000, 0x0000000613c00000, 0x0000000614000000| 0%| F| |TAMS 0x0000000613c00000, 0x0000000613c00000| Untracked
|
||||
| 26|0x0000000614000000, 0x0000000614000000, 0x0000000614400000| 0%| F| |TAMS 0x0000000614000000, 0x0000000614000000| Untracked
|
||||
| 27|0x0000000614400000, 0x0000000614400000, 0x0000000614800000| 0%| F| |TAMS 0x0000000614400000, 0x0000000614400000| Untracked
|
||||
| 28|0x0000000614800000, 0x0000000614800000, 0x0000000614c00000| 0%| F| |TAMS 0x0000000614800000, 0x0000000614800000| Untracked
|
||||
| 29|0x0000000614c00000, 0x0000000614c00000, 0x0000000615000000| 0%| F| |TAMS 0x0000000614c00000, 0x0000000614c00000| Untracked
|
||||
| 30|0x0000000615000000, 0x0000000615000000, 0x0000000615400000| 0%| F| |TAMS 0x0000000615000000, 0x0000000615000000| Untracked
|
||||
| 31|0x0000000615400000, 0x0000000615400000, 0x0000000615800000| 0%| F| |TAMS 0x0000000615400000, 0x0000000615400000| Untracked
|
||||
| 32|0x0000000615800000, 0x0000000615800000, 0x0000000615c00000| 0%| F| |TAMS 0x0000000615800000, 0x0000000615800000| Untracked
|
||||
| 33|0x0000000615c00000, 0x0000000615c00000, 0x0000000616000000| 0%| F| |TAMS 0x0000000615c00000, 0x0000000615c00000| Untracked
|
||||
| 34|0x0000000616000000, 0x0000000616000000, 0x0000000616400000| 0%| F| |TAMS 0x0000000616000000, 0x0000000616000000| Untracked
|
||||
| 35|0x0000000616400000, 0x0000000616400000, 0x0000000616800000| 0%| F| |TAMS 0x0000000616400000, 0x0000000616400000| Untracked
|
||||
| 36|0x0000000616800000, 0x0000000616800000, 0x0000000616c00000| 0%| F| |TAMS 0x0000000616800000, 0x0000000616800000| Untracked
|
||||
| 37|0x0000000616c00000, 0x0000000616c00000, 0x0000000617000000| 0%| F| |TAMS 0x0000000616c00000, 0x0000000616c00000| Untracked
|
||||
| 38|0x0000000617000000, 0x0000000617000000, 0x0000000617400000| 0%| F| |TAMS 0x0000000617000000, 0x0000000617000000| Untracked
|
||||
| 39|0x0000000617400000, 0x0000000617400000, 0x0000000617800000| 0%| F| |TAMS 0x0000000617400000, 0x0000000617400000| Untracked
|
||||
| 40|0x0000000617800000, 0x0000000617800000, 0x0000000617c00000| 0%| F| |TAMS 0x0000000617800000, 0x0000000617800000| Untracked
|
||||
| 41|0x0000000617c00000, 0x0000000617c00000, 0x0000000618000000| 0%| F| |TAMS 0x0000000617c00000, 0x0000000617c00000| Untracked
|
||||
| 42|0x0000000618000000, 0x0000000618000000, 0x0000000618400000| 0%| F| |TAMS 0x0000000618000000, 0x0000000618000000| Untracked
|
||||
| 43|0x0000000618400000, 0x0000000618400000, 0x0000000618800000| 0%| F| |TAMS 0x0000000618400000, 0x0000000618400000| Untracked
|
||||
| 44|0x0000000618800000, 0x0000000618800000, 0x0000000618c00000| 0%| F| |TAMS 0x0000000618800000, 0x0000000618800000| Untracked
|
||||
| 45|0x0000000618c00000, 0x0000000618c00000, 0x0000000619000000| 0%| F| |TAMS 0x0000000618c00000, 0x0000000618c00000| Untracked
|
||||
| 46|0x0000000619000000, 0x0000000619000000, 0x0000000619400000| 0%| F| |TAMS 0x0000000619000000, 0x0000000619000000| Untracked
|
||||
| 47|0x0000000619400000, 0x0000000619400000, 0x0000000619800000| 0%| F| |TAMS 0x0000000619400000, 0x0000000619400000| Untracked
|
||||
| 48|0x0000000619800000, 0x0000000619800000, 0x0000000619c00000| 0%| F| |TAMS 0x0000000619800000, 0x0000000619800000| Untracked
|
||||
| 49|0x0000000619c00000, 0x0000000619c00000, 0x000000061a000000| 0%| F| |TAMS 0x0000000619c00000, 0x0000000619c00000| Untracked
|
||||
| 50|0x000000061a000000, 0x000000061a000000, 0x000000061a400000| 0%| F| |TAMS 0x000000061a000000, 0x000000061a000000| Untracked
|
||||
| 51|0x000000061a400000, 0x000000061a400000, 0x000000061a800000| 0%| F| |TAMS 0x000000061a400000, 0x000000061a400000| Untracked
|
||||
| 52|0x000000061a800000, 0x000000061a800000, 0x000000061ac00000| 0%| F| |TAMS 0x000000061a800000, 0x000000061a800000| Untracked
|
||||
| 53|0x000000061ac00000, 0x000000061ac00000, 0x000000061b000000| 0%| F| |TAMS 0x000000061ac00000, 0x000000061ac00000| Untracked
|
||||
| 54|0x000000061b000000, 0x000000061b000000, 0x000000061b400000| 0%| F| |TAMS 0x000000061b000000, 0x000000061b000000| Untracked
|
||||
| 55|0x000000061b400000, 0x000000061b400000, 0x000000061b800000| 0%| F| |TAMS 0x000000061b400000, 0x000000061b400000| Untracked
|
||||
| 56|0x000000061b800000, 0x000000061b800000, 0x000000061bc00000| 0%| F| |TAMS 0x000000061b800000, 0x000000061b800000| Untracked
|
||||
| 57|0x000000061bc00000, 0x000000061bc00000, 0x000000061c000000| 0%| F| |TAMS 0x000000061bc00000, 0x000000061bc00000| Untracked
|
||||
| 58|0x000000061c000000, 0x000000061c000000, 0x000000061c400000| 0%| F| |TAMS 0x000000061c000000, 0x000000061c000000| Untracked
|
||||
| 59|0x000000061c400000, 0x000000061c400000, 0x000000061c800000| 0%| F| |TAMS 0x000000061c400000, 0x000000061c400000| Untracked
|
||||
| 60|0x000000061c800000, 0x000000061c800000, 0x000000061cc00000| 0%| F| |TAMS 0x000000061c800000, 0x000000061c800000| Untracked
|
||||
| 61|0x000000061cc00000, 0x000000061cc00000, 0x000000061d000000| 0%| F| |TAMS 0x000000061cc00000, 0x000000061cc00000| Untracked
|
||||
| 62|0x000000061d000000, 0x000000061d000000, 0x000000061d400000| 0%| F| |TAMS 0x000000061d000000, 0x000000061d000000| Untracked
|
||||
| 63|0x000000061d400000, 0x000000061d400000, 0x000000061d800000| 0%| F| |TAMS 0x000000061d400000, 0x000000061d400000| Untracked
|
||||
| 64|0x000000061d800000, 0x000000061d800000, 0x000000061dc00000| 0%| F| |TAMS 0x000000061d800000, 0x000000061d800000| Untracked
|
||||
| 65|0x000000061dc00000, 0x000000061dc00000, 0x000000061e000000| 0%| F| |TAMS 0x000000061dc00000, 0x000000061dc00000| Untracked
|
||||
| 66|0x000000061e000000, 0x000000061e000000, 0x000000061e400000| 0%| F| |TAMS 0x000000061e000000, 0x000000061e000000| Untracked
|
||||
| 67|0x000000061e400000, 0x000000061e400000, 0x000000061e800000| 0%| F| |TAMS 0x000000061e400000, 0x000000061e400000| Untracked
|
||||
| 68|0x000000061e800000, 0x000000061e800000, 0x000000061ec00000| 0%| F| |TAMS 0x000000061e800000, 0x000000061e800000| Untracked
|
||||
| 69|0x000000061ec00000, 0x000000061ec00000, 0x000000061f000000| 0%| F| |TAMS 0x000000061ec00000, 0x000000061ec00000| Untracked
|
||||
| 70|0x000000061f000000, 0x000000061f000000, 0x000000061f400000| 0%| F| |TAMS 0x000000061f000000, 0x000000061f000000| Untracked
|
||||
| 71|0x000000061f400000, 0x000000061f400000, 0x000000061f800000| 0%| F| |TAMS 0x000000061f400000, 0x000000061f400000| Untracked
|
||||
| 72|0x000000061f800000, 0x000000061f800000, 0x000000061fc00000| 0%| F| |TAMS 0x000000061f800000, 0x000000061f800000| Untracked
|
||||
| 73|0x000000061fc00000, 0x000000061fc00000, 0x0000000620000000| 0%| F| |TAMS 0x000000061fc00000, 0x000000061fc00000| Untracked
|
||||
| 74|0x0000000620000000, 0x0000000620000000, 0x0000000620400000| 0%| F| |TAMS 0x0000000620000000, 0x0000000620000000| Untracked
|
||||
| 75|0x0000000620400000, 0x0000000620400000, 0x0000000620800000| 0%| F| |TAMS 0x0000000620400000, 0x0000000620400000| Untracked
|
||||
| 76|0x0000000620800000, 0x0000000620800000, 0x0000000620c00000| 0%| F| |TAMS 0x0000000620800000, 0x0000000620800000| Untracked
|
||||
| 77|0x0000000620c00000, 0x0000000620c00000, 0x0000000621000000| 0%| F| |TAMS 0x0000000620c00000, 0x0000000620c00000| Untracked
|
||||
| 78|0x0000000621000000, 0x0000000621000000, 0x0000000621400000| 0%| F| |TAMS 0x0000000621000000, 0x0000000621000000| Untracked
|
||||
| 79|0x0000000621400000, 0x0000000621400000, 0x0000000621800000| 0%| F| |TAMS 0x0000000621400000, 0x0000000621400000| Untracked
|
||||
| 80|0x0000000621800000, 0x0000000621800000, 0x0000000621c00000| 0%| F| |TAMS 0x0000000621800000, 0x0000000621800000| Untracked
|
||||
| 81|0x0000000621c00000, 0x0000000621c00000, 0x0000000622000000| 0%| F| |TAMS 0x0000000621c00000, 0x0000000621c00000| Untracked
|
||||
| 82|0x0000000622000000, 0x0000000622000000, 0x0000000622400000| 0%| F| |TAMS 0x0000000622000000, 0x0000000622000000| Untracked
|
||||
| 83|0x0000000622400000, 0x0000000622400000, 0x0000000622800000| 0%| F| |TAMS 0x0000000622400000, 0x0000000622400000| Untracked
|
||||
| 84|0x0000000622800000, 0x0000000622800000, 0x0000000622c00000| 0%| F| |TAMS 0x0000000622800000, 0x0000000622800000| Untracked
|
||||
| 85|0x0000000622c00000, 0x0000000622c00000, 0x0000000623000000| 0%| F| |TAMS 0x0000000622c00000, 0x0000000622c00000| Untracked
|
||||
| 86|0x0000000623000000, 0x0000000623000000, 0x0000000623400000| 0%| F| |TAMS 0x0000000623000000, 0x0000000623000000| Untracked
|
||||
| 87|0x0000000623400000, 0x0000000623400000, 0x0000000623800000| 0%| F| |TAMS 0x0000000623400000, 0x0000000623400000| Untracked
|
||||
| 88|0x0000000623800000, 0x0000000623800000, 0x0000000623c00000| 0%| F| |TAMS 0x0000000623800000, 0x0000000623800000| Untracked
|
||||
| 89|0x0000000623c00000, 0x0000000623c00000, 0x0000000624000000| 0%| F| |TAMS 0x0000000623c00000, 0x0000000623c00000| Untracked
|
||||
| 90|0x0000000624000000, 0x0000000624000000, 0x0000000624400000| 0%| F| |TAMS 0x0000000624000000, 0x0000000624000000| Untracked
|
||||
| 91|0x0000000624400000, 0x0000000624400000, 0x0000000624800000| 0%| F| |TAMS 0x0000000624400000, 0x0000000624400000| Untracked
|
||||
| 92|0x0000000624800000, 0x0000000624800000, 0x0000000624c00000| 0%| F| |TAMS 0x0000000624800000, 0x0000000624800000| Untracked
|
||||
| 93|0x0000000624c00000, 0x0000000624c00000, 0x0000000625000000| 0%| F| |TAMS 0x0000000624c00000, 0x0000000624c00000| Untracked
|
||||
| 94|0x0000000625000000, 0x0000000625000000, 0x0000000625400000| 0%| F| |TAMS 0x0000000625000000, 0x0000000625000000| Untracked
|
||||
| 95|0x0000000625400000, 0x0000000625400000, 0x0000000625800000| 0%| F| |TAMS 0x0000000625400000, 0x0000000625400000| Untracked
|
||||
| 96|0x0000000625800000, 0x0000000625800000, 0x0000000625c00000| 0%| F| |TAMS 0x0000000625800000, 0x0000000625800000| Untracked
|
||||
| 97|0x0000000625c00000, 0x0000000625c00000, 0x0000000626000000| 0%| F| |TAMS 0x0000000625c00000, 0x0000000625c00000| Untracked
|
||||
| 98|0x0000000626000000, 0x0000000626000000, 0x0000000626400000| 0%| F| |TAMS 0x0000000626000000, 0x0000000626000000| Untracked
|
||||
| 99|0x0000000626400000, 0x0000000626400000, 0x0000000626800000| 0%| F| |TAMS 0x0000000626400000, 0x0000000626400000| Untracked
|
||||
| 100|0x0000000626800000, 0x0000000626800000, 0x0000000626c00000| 0%| F| |TAMS 0x0000000626800000, 0x0000000626800000| Untracked
|
||||
| 101|0x0000000626c00000, 0x0000000626c00000, 0x0000000627000000| 0%| F| |TAMS 0x0000000626c00000, 0x0000000626c00000| Untracked
|
||||
| 102|0x0000000627000000, 0x0000000627000000, 0x0000000627400000| 0%| F| |TAMS 0x0000000627000000, 0x0000000627000000| Untracked
|
||||
| 103|0x0000000627400000, 0x0000000627400000, 0x0000000627800000| 0%| F| |TAMS 0x0000000627400000, 0x0000000627400000| Untracked
|
||||
| 104|0x0000000627800000, 0x0000000627800000, 0x0000000627c00000| 0%| F| |TAMS 0x0000000627800000, 0x0000000627800000| Untracked
|
||||
| 105|0x0000000627c00000, 0x0000000627c00000, 0x0000000628000000| 0%| F| |TAMS 0x0000000627c00000, 0x0000000627c00000| Untracked
|
||||
| 106|0x0000000628000000, 0x0000000628000000, 0x0000000628400000| 0%| F| |TAMS 0x0000000628000000, 0x0000000628000000| Untracked
|
||||
| 107|0x0000000628400000, 0x0000000628400000, 0x0000000628800000| 0%| F| |TAMS 0x0000000628400000, 0x0000000628400000| Untracked
|
||||
| 108|0x0000000628800000, 0x0000000628800000, 0x0000000628c00000| 0%| F| |TAMS 0x0000000628800000, 0x0000000628800000| Untracked
|
||||
| 109|0x0000000628c00000, 0x0000000628c00000, 0x0000000629000000| 0%| F| |TAMS 0x0000000628c00000, 0x0000000628c00000| Untracked
|
||||
| 110|0x0000000629000000, 0x0000000629000000, 0x0000000629400000| 0%| F| |TAMS 0x0000000629000000, 0x0000000629000000| Untracked
|
||||
| 111|0x0000000629400000, 0x0000000629400000, 0x0000000629800000| 0%| F| |TAMS 0x0000000629400000, 0x0000000629400000| Untracked
|
||||
| 112|0x0000000629800000, 0x0000000629800000, 0x0000000629c00000| 0%| F| |TAMS 0x0000000629800000, 0x0000000629800000| Untracked
|
||||
| 113|0x0000000629c00000, 0x0000000629c00000, 0x000000062a000000| 0%| F| |TAMS 0x0000000629c00000, 0x0000000629c00000| Untracked
|
||||
| 114|0x000000062a000000, 0x000000062a000000, 0x000000062a400000| 0%| F| |TAMS 0x000000062a000000, 0x000000062a000000| Untracked
|
||||
| 115|0x000000062a400000, 0x000000062a400000, 0x000000062a800000| 0%| F| |TAMS 0x000000062a400000, 0x000000062a400000| Untracked
|
||||
| 116|0x000000062a800000, 0x000000062a800000, 0x000000062ac00000| 0%| F| |TAMS 0x000000062a800000, 0x000000062a800000| Untracked
|
||||
| 117|0x000000062ac00000, 0x000000062ac00000, 0x000000062b000000| 0%| F| |TAMS 0x000000062ac00000, 0x000000062ac00000| Untracked
|
||||
| 118|0x000000062b000000, 0x000000062b000000, 0x000000062b400000| 0%| F| |TAMS 0x000000062b000000, 0x000000062b000000| Untracked
|
||||
| 119|0x000000062b400000, 0x000000062b495768, 0x000000062b800000| 14%| E| |TAMS 0x000000062b400000, 0x000000062b400000| Complete
|
||||
| 120|0x000000062b800000, 0x000000062bc00000, 0x000000062bc00000|100%| E|CS|TAMS 0x000000062b800000, 0x000000062b800000| Complete
|
||||
| 121|0x000000062bc00000, 0x000000062c000000, 0x000000062c000000|100%| E|CS|TAMS 0x000000062bc00000, 0x000000062bc00000| Complete
|
||||
| 122|0x000000062c000000, 0x000000062c400000, 0x000000062c400000|100%| E|CS|TAMS 0x000000062c000000, 0x000000062c000000| Complete
|
||||
| 123|0x000000062c400000, 0x000000062c800000, 0x000000062c800000|100%| E|CS|TAMS 0x000000062c400000, 0x000000062c400000| Complete
|
||||
| 124|0x000000062c800000, 0x000000062cc00000, 0x000000062cc00000|100%| E|CS|TAMS 0x000000062c800000, 0x000000062c800000| Complete
|
||||
|
||||
Card table byte_map: [0x000001b7904f0000,0x000001b791490000] _byte_map_base: 0x000001b78d484000
|
||||
|
||||
Marking Bits (Prev, Next): (CMBitMap*) 0x000001b7f78b5090, (CMBitMap*) 0x000001b7f78b50d0
|
||||
Prev Bits: [0x000001b792430000, 0x000001b79a0d0000)
|
||||
Next Bits: [0x000001b79a0d0000, 0x000001b7a1d70000)
|
||||
|
||||
Polling page: 0x000001b7f5550000
|
||||
|
||||
Metaspace:
|
||||
|
||||
Usage:
|
||||
Non-class: 4.89 MB used.
|
||||
Class: 375.18 KB used.
|
||||
Both: 5.26 MB used.
|
||||
|
||||
Virtual space:
|
||||
Non-class space: 64.00 MB reserved, 5.00 MB ( 8%) committed, 1 nodes.
|
||||
Class space: 1.00 GB reserved, 448.00 KB ( <1%) committed, 1 nodes.
|
||||
Both: 1.06 GB reserved, 5.44 MB ( <1%) committed.
|
||||
|
||||
Chunk freelists:
|
||||
Non-Class: 2.14 MB
|
||||
Class: 3.51 MB
|
||||
Both: 5.66 MB
|
||||
|
||||
MaxMetaspaceSize: unlimited
|
||||
CompressedClassSpaceSize: 1.00 GB
|
||||
Initial GC threshold: 21.00 MB
|
||||
Current GC threshold: 21.00 MB
|
||||
CDS: on
|
||||
MetaspaceReclaimPolicy: balanced
|
||||
- commit_granule_bytes: 65536.
|
||||
- commit_granule_words: 8192.
|
||||
- virtual_space_node_default_size: 8388608.
|
||||
- enlarge_chunks_in_place: 1.
|
||||
- new_chunks_are_fully_committed: 0.
|
||||
- uncommit_free_chunks: 1.
|
||||
- use_allocation_guard: 0.
|
||||
|
||||
|
||||
Internal statistics:
|
||||
|
||||
num_allocs_failed_limit: 0.
|
||||
num_arena_births: 84.
|
||||
num_arena_deaths: 0.
|
||||
num_vsnodes_births: 2.
|
||||
num_vsnodes_deaths: 0.
|
||||
num_space_committed: 87.
|
||||
num_space_uncommitted: 0.
|
||||
num_chunks_returned_to_freelist: 0.
|
||||
num_chunks_taken_from_freelist: 168.
|
||||
num_chunk_merges: 0.
|
||||
num_chunk_splits: 121.
|
||||
num_chunks_enlarged: 90.
|
||||
num_inconsistent_stats: 0.
|
||||
|
||||
CodeHeap 'non-profiled nmethods': size=119168Kb used=297Kb max_used=297Kb free=118870Kb
|
||||
bounds [0x000001b787ba0000, 0x000001b787e10000, 0x000001b78f000000]
|
||||
CodeHeap 'profiled nmethods': size=119104Kb used=1574Kb max_used=1574Kb free=117529Kb
|
||||
bounds [0x000001b780000000, 0x000001b780270000, 0x000001b787450000]
|
||||
CodeHeap 'non-nmethods': size=7488Kb used=3456Kb max_used=3470Kb free=4031Kb
|
||||
bounds [0x000001b787450000, 0x000001b7877c0000, 0x000001b787ba0000]
|
||||
total_blobs=1984 nmethods=949 adapters=943
|
||||
compilation: enabled
|
||||
stopped_count=0, restarted_count=0
|
||||
full_count=0
|
||||
|
||||
Compilation events (20 events):
|
||||
Event: 0.286 Thread 0x000001b7a5525550 nmethod 937 0x000001b780183f10 code [0x000001b7801840e0, 0x000001b7801844a8]
|
||||
Event: 0.286 Thread 0x000001b7a550c420 940 1 org.lwjgl.system.Pointer$Default::address (5 bytes)
|
||||
Event: 0.286 Thread 0x000001b7a5507e80 nmethod 939 0x000001b780184690 code [0x000001b7801848e0, 0x000001b780185498]
|
||||
Event: 0.286 Thread 0x000001b7a550c420 nmethod 940 0x000001b787be9990 code [0x000001b787be9b20, 0x000001b787be9bd8]
|
||||
Event: 0.287 Thread 0x000001b7a5507e80 941 1 java.net.URLStreamHandler::getDefaultPort (2 bytes)
|
||||
Event: 0.287 Thread 0x000001b7a5507e80 nmethod 941 0x000001b787be9c90 code [0x000001b787be9e20, 0x000001b787be9ef8]
|
||||
Event: 0.287 Thread 0x000001b7a5507e80 942 3 java.net.URL::isBuiltinStreamHandler (32 bytes)
|
||||
Event: 0.287 Thread 0x000001b7a427eae0 943 3 java.net.URL::isBuiltinStreamHandler (8 bytes)
|
||||
Event: 0.287 Thread 0x000001b7a550c420 944 3 sun.net.util.IPAddressUtil::checkHostString (53 bytes)
|
||||
Event: 0.287 Thread 0x000001b7a5525550 945 3 sun.net.util.IPAddressUtil::scan (92 bytes)
|
||||
Event: 0.287 Thread 0x000001b7a427eae0 nmethod 943 0x000001b780185910 code [0x000001b780185ac0, 0x000001b780185c88]
|
||||
Event: 0.287 Thread 0x000001b7a427eae0 947 3 sun.misc.Unsafe::putLong (11 bytes)
|
||||
Event: 0.287 Thread 0x000001b7a5507e80 nmethod 942 0x000001b780185d90 code [0x000001b780185fe0, 0x000001b780186898]
|
||||
Event: 0.287 Thread 0x000001b7a427eae0 nmethod 947 0x000001b780186c10 code [0x000001b780186da0, 0x000001b780186eb8]
|
||||
Event: 0.287 Thread 0x000001b7a5507e80 948 3 org.lwjgl.system.MemoryUtil::memPutAddress (29 bytes)
|
||||
Event: 0.287 Thread 0x000001b7a550c420 nmethod 944 0x000001b780186f90 code [0x000001b780187220, 0x000001b780187cf8]
|
||||
Event: 0.287 Thread 0x000001b7a5525550 nmethod 945 0x000001b780188190 code [0x000001b780188400, 0x000001b780188fb8]
|
||||
Event: 0.287 Thread 0x000001b7a9cb7650 949 4 sun.misc.Unsafe::putLong (11 bytes)
|
||||
Event: 0.287 Thread 0x000001b7a5507e80 nmethod 948 0x000001b780189510 code [0x000001b7801896c0, 0x000001b7801898b8]
|
||||
Event: 0.288 Thread 0x000001b7a9cb7650 nmethod 949 0x000001b787bea390 code [0x000001b787bea520, 0x000001b787bea5d8]
|
||||
|
||||
GC Heap History (0 events):
|
||||
No events
|
||||
|
||||
Dll operation events (11 events):
|
||||
Event: 0.004 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\java.dll
|
||||
Event: 0.009 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\jsvml.dll
|
||||
Event: 0.109 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\zip.dll
|
||||
Event: 0.110 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\instrument.dll
|
||||
Event: 0.113 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\net.dll
|
||||
Event: 0.113 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\nio.dll
|
||||
Event: 0.115 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\zip.dll
|
||||
Event: 0.154 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\jimage.dll
|
||||
Event: 0.175 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\verify.dll
|
||||
Event: 0.227 Loaded shared library C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl.dll
|
||||
Event: 0.278 Loaded shared library C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl_opengl.dll
|
||||
|
||||
Deoptimization events (20 events):
|
||||
Event: 0.181 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b78009c6f3 sp=0x000000549c5f8590
|
||||
Event: 0.181 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874bb0e3 sp=0x000000549c5f79f8 mode 0
|
||||
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b78009c6f3 sp=0x000000549c5f8590
|
||||
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874bb0e3 sp=0x000000549c5f79f8 mode 0
|
||||
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b78009c6f3 sp=0x000000549c5fbfd0
|
||||
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874bb0e3 sp=0x000000549c5fb438 mode 0
|
||||
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b78009c6f3 sp=0x000000549c5fbfd0
|
||||
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874bb0e3 sp=0x000000549c5fb438 mode 0
|
||||
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b78009c6f3 sp=0x000000549c5fbfd0
|
||||
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874bb0e3 sp=0x000000549c5fb438 mode 0
|
||||
Event: 0.201 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b78006f49f sp=0x000000549c5fad50
|
||||
Event: 0.201 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874bb0e3 sp=0x000000549c5fa1e8 mode 0
|
||||
Event: 0.223 Thread 0x000001b7f7801df0 Uncommon trap: trap_request=0xffffff45 fr.pc=0x000001b787bdb488 relative=0x0000000000000068
|
||||
Event: 0.223 Thread 0x000001b7f7801df0 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000001b787bdb488 method=java.io.WinNTFileSystem.isSlash(C)Z @ 9 c2
|
||||
Event: 0.223 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b787bdb488 sp=0x000000549c5fd9b0
|
||||
Event: 0.223 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874ba5a3 sp=0x000000549c5fd948 mode 2
|
||||
Event: 0.288 Thread 0x000001b7f7801df0 Uncommon trap: trap_request=0xffffff54 fr.pc=0x000001b787bea58c relative=0x000000000000006c
|
||||
Event: 0.288 Thread 0x000001b7f7801df0 Uncommon trap: reason=speculate_null_assert action=make_not_entrant pc=0x000001b787bea58c method=sun.misc.Unsafe.putLong(Ljava/lang/Object;JJ)V @ 7 c2
|
||||
Event: 0.288 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b787bea58c sp=0x000000549c5ff620
|
||||
Event: 0.289 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874ba5a3 sp=0x000000549c5ff5b8 mode 2
|
||||
|
||||
Classes loaded (20 events):
|
||||
Event: 0.244 Loading class sun/misc/Unsafe
|
||||
Event: 0.244 Loading class sun/misc/Unsafe done
|
||||
Event: 0.244 Loading class java/lang/invoke/DirectMethodHandle$StaticAccessor
|
||||
Event: 0.244 Loading class java/lang/invoke/DirectMethodHandle$StaticAccessor done
|
||||
Event: 0.245 Loading class java/util/function/LongPredicate
|
||||
Event: 0.245 Loading class java/util/function/LongPredicate done
|
||||
Event: 0.246 Loading class java/lang/foreign/MemorySegment
|
||||
Event: 0.246 Loading class java/lang/foreign/Addressable
|
||||
Event: 0.246 Loading class java/lang/foreign/Addressable done
|
||||
Event: 0.246 Loading class java/lang/foreign/MemorySegment done
|
||||
Event: 0.248 Loading class java/nio/InvalidMarkException
|
||||
Event: 0.248 Loading class java/nio/InvalidMarkException done
|
||||
Event: 0.248 Loading class java/nio/BufferUnderflowException
|
||||
Event: 0.248 Loading class java/nio/BufferUnderflowException done
|
||||
Event: 0.284 Loading class jdk/internal/foreign/MemorySessionImpl
|
||||
Event: 0.284 Loading class java/lang/foreign/MemorySession
|
||||
Event: 0.284 Loading class java/lang/foreign/SegmentAllocator
|
||||
Event: 0.284 Loading class java/lang/foreign/SegmentAllocator done
|
||||
Event: 0.284 Loading class java/lang/foreign/MemorySession done
|
||||
Event: 0.284 Loading class jdk/internal/foreign/MemorySessionImpl done
|
||||
|
||||
Classes unloaded (0 events):
|
||||
No events
|
||||
|
||||
Classes redefined (0 events):
|
||||
No events
|
||||
|
||||
Internal exceptions (20 events):
|
||||
Event: 0.236 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bcff6d8}> (0x000000062bcff6d8)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.236 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bd001a8}> (0x000000062bd001a8)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.237 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bd07b00}> (0x000000062bd07b00)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.239 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bd0a958}> (0x000000062bd0a958)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.239 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bd0acd8}> (0x000000062bd0acd8)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.243 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062bdb1b80}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object)'> (0x000000062bdb1b80)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.245 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062be051f8}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, int, long)'> (0x000000062be051f8)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.245 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062be0aac8}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.newInvokeSpecial(java.lang.Object, java.lang.Object, int)'> (0x000000062be0aac8)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.246 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062be297b0}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, long, long)'> (0x000000062be297b0)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.247 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062be2f8c8}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.newInvokeSpecial(java.lang.Object, java.lang.Object, long)'> (0x000000062be2f8c8)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.247 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062be33928}: 'java.lang.Object java.lang.invoke.Invokers$Holder.linkToTargetMethod(java.lang.Object, long, java.lang.Object)'> (0x000000062be33928)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.247 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062be3aeb0}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, java.lang.Object, long)'> (0x000000062be3aeb0)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.275 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062bb43dd8}: 'void java.lang.System.load(java.lang.String, java.lang.Class)'> (0x000000062bb43dd8)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.275 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062bb46be0}: 'void java.lang.System.loadLibrary(java.lang.String, java.lang.Class)'> (0x000000062bb46be0)
|
||||
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
|
||||
Event: 0.277 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bb56610}> (0x000000062bb56610)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.277 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bb569d0}> (0x000000062bb569d0)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.280 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bb62730}> (0x000000062bb62730)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.280 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bb62a28}> (0x000000062bb62a28)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.284 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bbc3e78}> (0x000000062bbc3e78)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
Event: 0.284 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bbc4228}> (0x000000062bbc4228)
|
||||
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
|
||||
|
||||
VM Operations (10 events):
|
||||
Event: 0.032 Executing VM operation: HandshakeAllThreads
|
||||
Event: 0.032 Executing VM operation: HandshakeAllThreads done
|
||||
Event: 0.041 Executing VM operation: ChangeBreakpoints
|
||||
Event: 0.041 Executing VM operation: ChangeBreakpoints done
|
||||
Event: 0.103 Executing VM operation: ChangeBreakpoints
|
||||
Event: 0.103 Executing VM operation: ChangeBreakpoints done
|
||||
Event: 0.223 Executing VM operation: HandshakeAllThreads
|
||||
Event: 0.223 Executing VM operation: HandshakeAllThreads done
|
||||
Event: 0.227 Executing VM operation: HandshakeAllThreads
|
||||
Event: 0.227 Executing VM operation: HandshakeAllThreads done
|
||||
|
||||
Events (19 events):
|
||||
Event: 0.009 Thread 0x000001b7f7801df0 Thread added: 0x000001b7f7801df0
|
||||
Event: 0.015 Thread 0x000001b7a4262ce0 Thread added: 0x000001b7a4262ce0
|
||||
Event: 0.015 Thread 0x000001b7a4264270 Thread added: 0x000001b7a4264270
|
||||
Event: 0.015 Thread 0x000001b7a4266200 Thread added: 0x000001b7a4266200
|
||||
Event: 0.015 Thread 0x000001b7a42684e0 Thread added: 0x000001b7a42684e0
|
||||
Event: 0.015 Thread 0x000001b7a426cfb0 Thread added: 0x000001b7a426cfb0
|
||||
Event: 0.015 Thread 0x000001b7a426c5d0 Thread added: 0x000001b7a426c5d0
|
||||
Event: 0.016 Thread 0x000001b7a4272110 Thread added: 0x000001b7a4272110
|
||||
Event: 0.016 Thread 0x000001b7a427eae0 Thread added: 0x000001b7a427eae0
|
||||
Event: 0.016 Thread 0x000001b7a4289060 Thread added: 0x000001b7a4289060
|
||||
Event: 0.029 Thread 0x000001b7a55067f0 Thread added: 0x000001b7a55067f0
|
||||
Event: 0.032 Thread 0x000001b7a5507e80 Thread added: 0x000001b7a5507e80
|
||||
Event: 0.032 Thread 0x000001b7a550c420 Thread added: 0x000001b7a550c420
|
||||
Event: 0.033 Thread 0x000001b7a5525550 Thread added: 0x000001b7a5525550
|
||||
Event: 0.041 Thread 0x000001b7a55c40c0 Thread added: 0x000001b7a55c40c0
|
||||
Event: 0.041 Thread 0x000001b7a55ba2c0 Thread added: 0x000001b7a55ba2c0
|
||||
Event: 0.041 Thread 0x000001b7a55ba810 Thread added: 0x000001b7a55ba810
|
||||
Event: 0.160 Thread 0x000001b7a9cb7650 Thread added: 0x000001b7a9cb7650
|
||||
Event: 0.173 Thread 0x000001b7a9d4f890 Thread added: 0x000001b7a9d4f890
|
||||
|
||||
|
||||
Dynamic libraries:
|
||||
0x00007ff636b50000 - 0x00007ff636b60000 C:\Program Files\Java\jdk-19.0.2\bin\javaw.exe
|
||||
0x00007ff935510000 - 0x00007ff935708000 C:\Windows\SYSTEM32\ntdll.dll
|
||||
0x00007ff934e50000 - 0x00007ff934f0f000 C:\Windows\System32\KERNEL32.DLL
|
||||
0x00007ff932bf0000 - 0x00007ff932ee6000 C:\Windows\System32\KERNELBASE.dll
|
||||
0x00007ff932f20000 - 0x00007ff933020000 C:\Windows\System32\ucrtbase.dll
|
||||
0x00007ff91a700000 - 0x00007ff91a718000 C:\Program Files\Java\jdk-19.0.2\bin\jli.dll
|
||||
0x00007ff91a600000 - 0x00007ff91a61b000 C:\Program Files\Java\jdk-19.0.2\bin\VCRUNTIME140.dll
|
||||
0x00007ff934720000 - 0x00007ff9347cf000 C:\Windows\System32\ADVAPI32.dll
|
||||
0x00007ff934bb0000 - 0x00007ff934c4e000 C:\Windows\System32\msvcrt.dll
|
||||
0x00007ff9353a0000 - 0x00007ff93543c000 C:\Windows\System32\sechost.dll
|
||||
0x00007ff934a80000 - 0x00007ff934ba6000 C:\Windows\System32\RPCRT4.dll
|
||||
0x00007ff933570000 - 0x00007ff93370d000 C:\Windows\System32\USER32.dll
|
||||
0x00007ff9334a0000 - 0x00007ff9334c2000 C:\Windows\System32\win32u.dll
|
||||
0x00007ff934c80000 - 0x00007ff934cac000 C:\Windows\System32\GDI32.dll
|
||||
0x00007ff925810000 - 0x00007ff925aaa000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll
|
||||
0x00007ff933380000 - 0x00007ff933495000 C:\Windows\System32\gdi32full.dll
|
||||
0x00007ff9334d0000 - 0x00007ff93356d000 C:\Windows\System32\msvcp_win.dll
|
||||
0x00007ff92b1d0000 - 0x00007ff92b1da000 C:\Windows\SYSTEM32\VERSION.dll
|
||||
0x00007ff934c50000 - 0x00007ff934c80000 C:\Windows\System32\IMM32.DLL
|
||||
0x00007ff92f6f0000 - 0x00007ff92f6fc000 C:\Program Files\Java\jdk-19.0.2\bin\vcruntime140_1.dll
|
||||
0x00007ff8fde20000 - 0x00007ff8fdeae000 C:\Program Files\Java\jdk-19.0.2\bin\msvcp140.dll
|
||||
0x00007ff8884e0000 - 0x00007ff8891a0000 C:\Program Files\Java\jdk-19.0.2\bin\server\jvm.dll
|
||||
0x00007ff8cf580000 - 0x00007ff8cf589000 C:\Windows\SYSTEM32\WSOCK32.dll
|
||||
0x00007ff925d90000 - 0x00007ff925db7000 C:\Windows\SYSTEM32\WINMM.dll
|
||||
0x00007ff934990000 - 0x00007ff9349fb000 C:\Windows\System32\WS2_32.dll
|
||||
0x00007ff930ac0000 - 0x00007ff930ad2000 C:\Windows\SYSTEM32\kernel.appcore.dll
|
||||
0x00007ff92f6d0000 - 0x00007ff92f6da000 C:\Program Files\Java\jdk-19.0.2\bin\jimage.dll
|
||||
0x00007ff929560000 - 0x00007ff929744000 C:\Windows\SYSTEM32\DBGHELP.DLL
|
||||
0x00007ff9154a0000 - 0x00007ff9154d4000 C:\Windows\SYSTEM32\dbgcore.DLL
|
||||
0x00007ff933280000 - 0x00007ff933302000 C:\Windows\System32\bcryptPrimitives.dll
|
||||
0x00007ff90cd20000 - 0x00007ff90cd5c000 C:\Program Files\Java\jdk-19.0.2\bin\jdwp.dll
|
||||
0x00007ff91a5f0000 - 0x00007ff91a5fe000 C:\Program Files\Java\jdk-19.0.2\bin\instrument.dll
|
||||
0x00007ff911b60000 - 0x00007ff911b86000 C:\Program Files\Java\jdk-19.0.2\bin\java.dll
|
||||
0x00007ff8a3af0000 - 0x00007ff8a3bc7000 C:\Program Files\Java\jdk-19.0.2\bin\jsvml.dll
|
||||
0x00007ff933710000 - 0x00007ff933e54000 C:\Windows\System32\SHELL32.dll
|
||||
0x00007ff930cc0000 - 0x00007ff931453000 C:\Windows\SYSTEM32\windows.storage.dll
|
||||
0x00007ff934f10000 - 0x00007ff935264000 C:\Windows\System32\combase.dll
|
||||
0x00007ff932640000 - 0x00007ff93266e000 C:\Windows\SYSTEM32\Wldp.dll
|
||||
0x00007ff9352d0000 - 0x00007ff93537d000 C:\Windows\System32\SHCORE.dll
|
||||
0x00007ff935270000 - 0x00007ff9352c5000 C:\Windows\System32\shlwapi.dll
|
||||
0x00007ff932b30000 - 0x00007ff932b4f000 C:\Windows\SYSTEM32\profapi.dll
|
||||
0x00007ff919f00000 - 0x00007ff919f0c000 C:\Program Files\Java\jdk-19.0.2\bin\dt_socket.dll
|
||||
0x00007ff932040000 - 0x00007ff93207c000 C:\Windows\SYSTEM32\IPHLPAPI.DLL
|
||||
0x00007ff9323a0000 - 0x00007ff93240a000 C:\Windows\system32\mswsock.dll
|
||||
0x00007ff932090000 - 0x00007ff93215a000 C:\Windows\SYSTEM32\DNSAPI.dll
|
||||
0x00007ff934e40000 - 0x00007ff934e48000 C:\Windows\System32\NSI.dll
|
||||
0x00007ff92a320000 - 0x00007ff92a32a000 C:\Windows\System32\rasadhlp.dll
|
||||
0x00007ff9279b0000 - 0x00007ff927a32000 C:\Windows\System32\fwpuclnt.dll
|
||||
0x00007ff932ef0000 - 0x00007ff932f17000 C:\Windows\System32\bcrypt.dll
|
||||
0x00007ff919c40000 - 0x00007ff919c58000 C:\Program Files\Java\jdk-19.0.2\bin\zip.dll
|
||||
0x00007ff916970000 - 0x00007ff916983000 C:\Program Files\Java\jdk-19.0.2\bin\net.dll
|
||||
0x00007ff92bf70000 - 0x00007ff92c07a000 C:\Windows\SYSTEM32\WINHTTP.dll
|
||||
0x00007ff912fa0000 - 0x00007ff912fb6000 C:\Program Files\Java\jdk-19.0.2\bin\nio.dll
|
||||
0x00007ff919ef0000 - 0x00007ff919f00000 C:\Program Files\Java\jdk-19.0.2\bin\verify.dll
|
||||
0x00007ff8a45d0000 - 0x00007ff8a464a000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl.dll
|
||||
0x00007ff8a26e0000 - 0x00007ff8a2762000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\glfw.dll
|
||||
0x00007ff8f5090000 - 0x00007ff8f50d5000 C:\Windows\SYSTEM32\dinput8.dll
|
||||
0x00007ff911910000 - 0x00007ff911921000 C:\Windows\SYSTEM32\xinput1_4.dll
|
||||
0x00007ff933020000 - 0x00007ff93306e000 C:\Windows\System32\cfgmgr32.dll
|
||||
0x00007ff9329a0000 - 0x00007ff9329cc000 C:\Windows\SYSTEM32\DEVOBJ.dll
|
||||
0x00007ff9307d0000 - 0x00007ff9307ff000 C:\Windows\SYSTEM32\dwmapi.dll
|
||||
0x00007ff924940000 - 0x00007ff924a92000 C:\Windows\SYSTEM32\inputhost.dll
|
||||
0x00007ff934130000 - 0x00007ff9341fd000 C:\Windows\System32\OLEAUT32.dll
|
||||
0x00007ff9301d0000 - 0x00007ff9302c2000 C:\Windows\SYSTEM32\CoreMessaging.dll
|
||||
0x00007ff92e200000 - 0x00007ff92e2f6000 C:\Windows\SYSTEM32\PROPSYS.dll
|
||||
0x00007ff92f570000 - 0x00007ff92f6c4000 C:\Windows\SYSTEM32\wintypes.dll
|
||||
0x00007ff92fd90000 - 0x00007ff9300ee000 C:\Windows\SYSTEM32\CoreUIComponents.dll
|
||||
0x00007ff931d70000 - 0x00007ff931da3000 C:\Windows\SYSTEM32\ntmarta.dll
|
||||
0x00007ff930550000 - 0x00007ff9305ee000 C:\Windows\system32\uxtheme.dll
|
||||
0x00007ff934010000 - 0x00007ff934124000 C:\Windows\System32\MSCTF.dll
|
||||
0x00007ff8b13c0000 - 0x00007ff8b141e000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl_opengl.dll
|
||||
0x00007ff8c8fb0000 - 0x00007ff8c90d5000 C:\Windows\SYSTEM32\opengl32.dll
|
||||
0x00007ff8c8a90000 - 0x00007ff8c8abc000 C:\Windows\SYSTEM32\GLU32.dll
|
||||
0x00007ff8a2190000 - 0x00007ff8a2400000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\jemalloc.dll
|
||||
|
||||
dbghelp: loaded successfully - version: 4.0.5 - missing functions: none
|
||||
symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\Java\jdk-19.0.2\bin;C:\Windows\SYSTEM32;C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e;C:\Program Files\Java\jdk-19.0.2\bin\server;C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64
|
||||
|
||||
VM Arguments:
|
||||
jvm_args: -XX:+ShowCodeDetailsInExceptionMessages -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:63110 -javaagent:C:\Users\Speiger\eclipse\java-2022-12\eclipse\configuration\org.eclipse.osgi\636\0\.cp\lib\javaagent-shaded.jar -Dfile.encoding=UTF-8
|
||||
java_command: speiger.src.coreengine.Testing
|
||||
java_class_path (initial): D:\Projects\GameProject\SimpleJavaEngine\bin\main;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-glfw\3.3.2\757920418805fb90bfebb3d46b1d9e7669fca2eb\lwjgl-glfw-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-glfw\3.3.2\1251e3cb7e5d6159334cfb9244f789ce992f03b\lwjgl-glfw-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-jemalloc\3.3.2\877e17e39ebcd58a9c956dc3b5b777813de0873a\lwjgl-jemalloc-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-jemalloc\3.3.2\db886c1f9e313c3fa2a25543b99ccd250d3f9fb5\lwjgl-jemalloc-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-nfd\3.3.2\ec66452fad5bf48707cbe96c573c6cc3dd8a7a82\lwjgl-nfd-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-nfd\3.3.2\12c0041066a97f0c74d0f72db1423ac9ea124275\lwjgl-nfd-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-openal\3.3.2\ae5357ed6d934546d3533993ea84c0cfb75eed95\lwjgl-openal-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-openal\3.3.2\e74f299a602192faaf14b917632e4cbbb493c940\lwjgl-openal-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-opengl\3.3.2\ee8e95be0b438602038bc1f02dc5e3d011b1b216\lwjgl-opengl-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-opengl\3.3.2\83cd34469d4e0bc335bf74c7f62206530a9480bf\lwjgl-opengl-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-stb\3.3.2\a2550795014d622b686e9caac50b14baa87d2c70\lwjgl-stb-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-stb\3.3.2\1c4f4b8353bdb78c5264ab921436f03fc9aa1ba5\lwjgl-stb-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl\3.3.2\4421d94af68e35dcaa31737a6fc59136a1e61b94\lwjgl-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl\3.3.2\a55169ced70ffcd15f2162daf4a9c968578f6cd5\lwjgl-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\com.google.code.gson\gson\2.8.6\9180733b7df8542621dc12e21e87557e8c99b8cb\gson-2.8.6.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\de.speiger\Primitive-Collections\0.8.0\333b9d587940fc34ad68f3d7d6bace4646dd02ec\Primitive-Collections-0.8.0.jar
|
||||
Launcher Type: SUN_STANDARD
|
||||
|
||||
[Global flags]
|
||||
intx CICompilerCount = 12 {product} {ergonomic}
|
||||
uint ConcGCThreads = 5 {product} {ergonomic}
|
||||
uint G1ConcRefinementThreads = 18 {product} {ergonomic}
|
||||
size_t G1HeapRegionSize = 4194304 {product} {ergonomic}
|
||||
uintx GCDrainStackTargetSize = 64 {product} {ergonomic}
|
||||
size_t InitialHeapSize = 524288000 {product} {ergonomic}
|
||||
size_t MarkStackSize = 4194304 {product} {ergonomic}
|
||||
size_t MaxHeapSize = 8363442176 {product} {ergonomic}
|
||||
size_t MaxNewSize = 5016387584 {product} {ergonomic}
|
||||
size_t MinHeapDeltaBytes = 4194304 {product} {ergonomic}
|
||||
size_t MinHeapSize = 8388608 {product} {ergonomic}
|
||||
uintx NonNMethodCodeHeapSize = 7602480 {pd product} {ergonomic}
|
||||
uintx NonProfiledCodeHeapSize = 122027880 {pd product} {ergonomic}
|
||||
uintx ProfiledCodeHeapSize = 122027880 {pd product} {ergonomic}
|
||||
uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic}
|
||||
bool SegmentedCodeCache = true {product} {ergonomic}
|
||||
bool ShowCodeDetailsInExceptionMessages = true {manageable} {command line}
|
||||
size_t SoftMaxHeapSize = 8363442176 {manageable} {ergonomic}
|
||||
bool UseCompressedClassPointers = true {product lp64_product} {ergonomic}
|
||||
bool UseCompressedOops = true {product lp64_product} {ergonomic}
|
||||
bool UseG1GC = true {product} {ergonomic}
|
||||
bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic}
|
||||
|
||||
Logging:
|
||||
Log output configuration:
|
||||
#0: stdout all=warning uptime,level,tags foldmultilines=false
|
||||
#1: stderr all=off uptime,level,tags foldmultilines=false
|
||||
|
||||
Environment Variables:
|
||||
PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\Speiger\AppData\Local\Microsoft\WindowsApps;
|
||||
USERNAME=Speiger
|
||||
OS=Windows_NT
|
||||
PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD
|
||||
TMP=C:\Users\Speiger\AppData\Local\Temp
|
||||
TEMP=C:\Users\Speiger\AppData\Local\Temp
|
||||
|
||||
|
||||
|
||||
--------------- S Y S T E M ---------------
|
||||
|
||||
OS:
|
||||
Windows 10 , 64 bit Build 19041 (10.0.19041.3031)
|
||||
OS uptime: 0 days 3:11 hours
|
||||
|
||||
CPU: total 24 (initial active 24) (24 cores per cpu, 2 threads per core) family 25 model 97 stepping 2 microcode 0x0, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, avx512f, avx512dq, avx512cd, avx512bw, avx512vl, sha, fma, vzeroupper, avx512_vpopcntdq, avx512_vpclmulqdq, avx512_vaes, avx512_vnni, clflush, clflushopt, avx512_vbmi2, avx512_vbmi, rdtscp, rdpid, fsrm, gfni, avx512_bitalg
|
||||
|
||||
Memory: 4k page, system-wide physical 31894M (21079M free)
|
||||
TotalPageFile size 36502M (AvailPageFile size 20292M)
|
||||
current process WorkingSet (physical memory assigned to process): 70M, peak: 70M
|
||||
current process commit charge ("private bytes"): 640M, peak: 640M
|
||||
|
||||
vm_info: Java HotSpot(TM) 64-Bit Server VM (19.0.2+7-44) for windows-amd64 JRE (19.0.2+7-44), built on 2022-11-30T18:02:09Z by "mach5one" with MS VC++ 17.1 (VS2022)
|
||||
|
||||
END.
|
||||
@@ -0,0 +1,34 @@
|
||||
package speiger.src.coreengine.assets.api;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.SeekableByteChannel;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import speiger.src.coreengine.assets.impl.parsers.Buffers;
|
||||
import speiger.src.coreengine.assets.impl.parsers.Checksums;
|
||||
import speiger.src.coreengine.assets.impl.parsers.Closables;
|
||||
import speiger.src.coreengine.assets.impl.parsers.Serialized;
|
||||
|
||||
public interface IAsset {
|
||||
public IAssetPackage owner();
|
||||
public ID location();
|
||||
|
||||
public InputStream stream() throws IOException;
|
||||
public default ByteBuffer bytes() throws IOException { return parse(Buffers.HEAP); }
|
||||
public default BufferedReader reader() throws IOException { return parse(Closables.READER); }
|
||||
public default SeekableByteChannel channel() throws IOException { return parse(Closables.BYTE_CHANNEL); }
|
||||
public default List<String> lines() throws IOException { return parse(Serialized.LINES); }
|
||||
public default JsonObject jsonObj() throws IOException { return parse(Serialized.JSON_OBJ); }
|
||||
public default JsonArray jsonArray() throws IOException { return parse(Serialized.JSON_ARRAY); }
|
||||
|
||||
public default String crc() throws IOException { return parse(Checksums.CRC); }
|
||||
public default String sha256() throws IOException { return parse(Checksums.SHA_256); }
|
||||
|
||||
public <T> T parse(IAssetParser<T> parser) throws IOException;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package speiger.src.coreengine.assets.api;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.nio.file.attribute.FileTime;
|
||||
import java.util.List;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import speiger.src.coreengine.assets.impl.FolderAssetPackage;
|
||||
import speiger.src.coreengine.assets.impl.FolderWatcher.ChangeType;
|
||||
import speiger.src.coreengine.assets.impl.ZipAssetPackage;
|
||||
|
||||
@NullMarked
|
||||
public interface IAssetPackage extends AutoCloseable {
|
||||
void registerWatchers(IFileWatcher watcher) throws IOException;
|
||||
boolean handleChange(Path file, ChangeType type, Consumer<ID> changed) throws IOException;
|
||||
List<String> domains();
|
||||
@Nullable
|
||||
IAsset get(ID location);
|
||||
void getAll(ID folder, BiConsumer<ID, IAsset> assets);
|
||||
|
||||
public static IAssetPackage asset(Path path) {
|
||||
return create(path, "assets");
|
||||
}
|
||||
|
||||
public static IAssetPackage create(Path path, String baseFolder) {
|
||||
if(Files.exists(path)) {
|
||||
if(Files.isDirectory(path)) return new FolderAssetPackage(path.resolve(baseFolder));
|
||||
if(isZip(path)) return new ZipAssetPackage(path, baseFolder);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isZip(Path path) {
|
||||
try(FileSystem system = FileSystems.newFileSystem(path)) { return "jar".equals(system.provider().getScheme()); }
|
||||
catch(Exception _) { return false; }
|
||||
}
|
||||
|
||||
public record AssetIdentity(long size, FileTime lastModified) {
|
||||
|
||||
public AssetIdentity(Path path) throws IOException {
|
||||
BasicFileAttributes attributes = Files.readAttributes(path, BasicFileAttributes.class);
|
||||
this(attributes.size(), attributes.lastModifiedTime());
|
||||
}
|
||||
|
||||
public boolean matches(Path path) throws IOException {
|
||||
BasicFileAttributes attributes = Files.readAttributes(path, BasicFileAttributes.class);
|
||||
return size() == attributes.size() && lastModified().equals(attributes.lastModifiedTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package speiger.src.coreengine.assets.api;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public interface IAssetParser<T> {
|
||||
public T parse(Path path) throws IOException;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package speiger.src.coreengine.assets.api;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.collections.objects.lists.ObjectList;
|
||||
import speiger.src.collections.objects.utils.ObjectLists;
|
||||
|
||||
@NullMarked
|
||||
public interface IAssetProvider extends AutoCloseable {
|
||||
@Nullable
|
||||
IAsset get(ID id);
|
||||
@Nullable
|
||||
MultiAsset getAll(ID id);
|
||||
Map<ID, IAsset> list(String folder, Predicate<ID> filter);
|
||||
Map<ID, MultiAsset> listAll(String folder, Predicate<ID> filter);
|
||||
|
||||
public static class ReloadTracker {
|
||||
ObjectList<Listener> listeners = new ObjectArrayList<>();
|
||||
|
||||
public void register(IResourceListener listener) {
|
||||
listeners.add(new Listener(listener));
|
||||
}
|
||||
|
||||
public void register(Predicate<ID> filter, IResourceListener listener) {
|
||||
listeners.add(new Listener(filter, listener));
|
||||
}
|
||||
|
||||
public List<IResourceListener> findByFilter(Set<ID> changed) {
|
||||
if(changed.isEmpty()) return ObjectLists.empty();
|
||||
List<IResourceListener> result = new ObjectArrayList<>();
|
||||
for(int i = 0,m=listeners.size();i<m;i++) {
|
||||
Listener listener = listeners.get(i);
|
||||
for(ID id : changed) {
|
||||
if(listener.contains(id)) {
|
||||
result.add(listener.listener());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<IResourceListener> listeners() {
|
||||
return listeners.map(Listener::listener).pourAsList();
|
||||
}
|
||||
|
||||
private record Listener(Predicate<ID> filter, IResourceListener listener) {
|
||||
public Listener(IResourceListener listener) {
|
||||
this(_ -> true, listener);
|
||||
}
|
||||
|
||||
public boolean contains(ID id) {
|
||||
return filter.test(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package speiger.src.coreengine.assets.api;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
|
||||
public record ID(String domain, String path) implements Comparable<ID> {
|
||||
|
||||
public ID {
|
||||
if(!isValidDomain(Objects.requireNonNull(domain))) throw new IllegalArgumentException("Non [a-zA-Z0-9_.-] Character found in domain of location ["+domain+":"+path+"]");
|
||||
if(!isValidPath(Objects.requireNonNull(path))) throw new IllegalArgumentException("Non [a-zA-Z0-9/_.-] Character found in path of location ["+domain+":"+path+"]");
|
||||
}
|
||||
|
||||
public ID prefix(String prefix) { return of(domain, prefix+"/"+path); }
|
||||
public ID suffix(String suffix) { return of(domain, path+"/"+suffix); }
|
||||
public ID suffix(Path path) { return suffix(path.toString().replace("\\", "/")); }
|
||||
public ID alternate(String alterversion) { return of(domain, path+"."+alterversion); }
|
||||
|
||||
public String fileLocation() { return domain+"/"+path; }
|
||||
public boolean isRoot() { return !path.contains("/"); }
|
||||
public boolean isRootFolder(String folder) { return path.indexOf('/', folder.length()+1) == -1; }
|
||||
public boolean endsWith(String suffix) { return path.endsWith(suffix); }
|
||||
public boolean startsWith(String prefix) { return path.startsWith(prefix); }
|
||||
|
||||
@Override
|
||||
public final String toString() {
|
||||
return domain+":"+path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(ID o) {
|
||||
int result = domain.compareToIgnoreCase(o.domain);
|
||||
return result != 0 ? result : path.compareToIgnoreCase(path);
|
||||
}
|
||||
|
||||
public boolean matches(ID id) {
|
||||
return id.domain.equals(domain) && id.path.equals(path);
|
||||
}
|
||||
|
||||
public static final ID of(String domain, String path) {
|
||||
return new ID((domain == null || domain.isBlank() ? "base" : domain), path);
|
||||
}
|
||||
|
||||
public static final ID of(String location) {
|
||||
Objects.requireNonNull(location);
|
||||
int index = location.indexOf(":");
|
||||
String domain = index == -1 ? "base" : location.substring(0, index);
|
||||
String path = index == -1 ? location : location.substring(index + 1);
|
||||
if(!isValidDomain(domain)) throw new IllegalArgumentException("Non [a-zA-Z0-9_.-] Character found in domain of location ["+domain+":"+path+"]");
|
||||
if(!isValidPath(path)) throw new IllegalArgumentException("Non [a-zA-Z0-9/_.-] Character found in path of location ["+domain+":"+path+"]");
|
||||
return new ID(domain, path);
|
||||
}
|
||||
|
||||
public static final ID of(Path path) {
|
||||
return of(path.getName(0).toString(), path.subpath(1, path.getNameCount()).toString().replace("\\", "/"));
|
||||
}
|
||||
|
||||
public static final ID tryOf(String location) {
|
||||
try { return of(location); }
|
||||
catch(Exception e) { return null; }
|
||||
}
|
||||
|
||||
private static boolean isValidDomain(String s) {
|
||||
for(int i = 0,m=s.length();i<m;i++) {
|
||||
if(!isValidDomainChar(s.charAt(i))) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean isValidPath(String s) {
|
||||
for(int i = 0,m=s.length();i<m;i++) {
|
||||
if(!isValidPathChar(s.charAt(i))) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean isValidPathChar(char c) {
|
||||
return c == '/' || isValidDomainChar(c);
|
||||
}
|
||||
|
||||
private static boolean isValidDomainChar(char c) {
|
||||
return c == '_' || c == '-' || c == '.' || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package speiger.src.coreengine.assets.api;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public interface IFileWatcher {
|
||||
void addDirectory(Path basePath) throws IOException;
|
||||
void addFile(Path file) throws IOException;
|
||||
|
||||
public static record FileWatcher(IOConsumer<Path> folder, IOConsumer<Path> file) implements IFileWatcher {
|
||||
@Override
|
||||
public void addDirectory(Path basePath) throws IOException { folder().accept(basePath); }
|
||||
@Override
|
||||
public void addFile(Path file) throws IOException { file().accept(file); }
|
||||
}
|
||||
|
||||
public static interface IOConsumer<T> {
|
||||
void accept(T t) throws IOException;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package speiger.src.coreengine.assets.api;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public interface IResourceListener {
|
||||
void name();
|
||||
CompletableFuture<Void> reload(ReloadContext context, ISyncer sync);
|
||||
void release();
|
||||
|
||||
public static interface ISyncer {
|
||||
<T> CompletableFuture<T> sync(T value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package speiger.src.coreengine.assets.api;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
|
||||
import speiger.src.collections.objects.collections.ObjectIterable;
|
||||
import speiger.src.collections.objects.collections.ObjectIterator;
|
||||
import speiger.src.collections.objects.functions.consumer.ObjectObjectConsumer;
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.collections.objects.lists.ObjectList;
|
||||
import speiger.src.coreengine.assets.impl.parsers.Checksums;
|
||||
|
||||
public record MultiAsset(ObjectList<IAsset> assets) implements ObjectIterable<IAsset> {
|
||||
|
||||
public MultiAsset(ObjectList<IAsset> assets) {
|
||||
this.assets = Objects.requireNonNull(assets).unmodifiable();
|
||||
}
|
||||
|
||||
public MultiAsset(IAsset... assets) {
|
||||
this(ObjectArrayList.wrap(assets));
|
||||
}
|
||||
|
||||
public int size() { return assets.size(); }
|
||||
public IAsset get(int index) { return assets.get(index); }
|
||||
@Override
|
||||
public ObjectIterator<IAsset> iterator() { return assets.iterator(); }
|
||||
public String crc() { return map(Checksums.CRC, () -> "").reduce(new StringBuilder(), StringBuilder::append).toString(); }
|
||||
public String sha256() { return map(Checksums.SHA_256, () -> "").reduce(new StringBuilder(), StringBuilder::append).toString(); }
|
||||
|
||||
|
||||
public <T> ObjectIterable<T> map(IAssetParser<T> mapper, Supplier<T> defaultValue) {
|
||||
return assets.map(E -> {
|
||||
try { return E.parse(mapper); }
|
||||
catch(IOException e) {
|
||||
e.printStackTrace();
|
||||
return defaultValue.get();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEach(Consumer<? super IAsset> action) {
|
||||
assets.forEach(action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E> void forEach(E input, ObjectObjectConsumer<E, IAsset> action) {
|
||||
assets.forEach(input, action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachIndexed(IntObjectConsumer<IAsset> action) {
|
||||
assets.forEachIndexed(action);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static MultiAsset combineNonNull(IAssetProvider provider, ID...ids) {
|
||||
ObjectList<IAsset> all = new ObjectArrayList<>();
|
||||
for(ID id : ids) {
|
||||
IAsset entry = provider.get(id);
|
||||
if(entry == null) return null;
|
||||
all.add(entry);
|
||||
}
|
||||
return new MultiAsset(all);
|
||||
}
|
||||
|
||||
public static MultiAsset combine(IAssetProvider provider, ID...ids) {
|
||||
return new MultiAsset(ObjectArrayList.wrap(ids).map(provider::get).filter(T -> T != null).pourAsList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package speiger.src.coreengine.assets.api;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
public record ReloadContext(IAssetProvider provider, Set<ID> filter, Executor main, Executor background) {
|
||||
|
||||
public boolean hasChanged(ID id) {
|
||||
return filter.isEmpty() || filter.contains(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package speiger.src.coreengine.assets.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.collections.objects.utils.ObjectLists;
|
||||
import speiger.src.coreengine.assets.api.IAsset;
|
||||
import speiger.src.coreengine.assets.api.IAssetPackage;
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
import speiger.src.coreengine.assets.api.IFileWatcher;
|
||||
import speiger.src.coreengine.assets.impl.FolderWatcher.ChangeType;
|
||||
|
||||
public class FolderAssetPackage implements IAssetPackage {
|
||||
Map<ID, AssetIdentity> knownIdentities = new HashMap<>();
|
||||
Path basePath;
|
||||
|
||||
public FolderAssetPackage(Path basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerWatchers(IFileWatcher watcher) throws IOException {
|
||||
initCache();
|
||||
watcher.addDirectory(basePath);
|
||||
}
|
||||
|
||||
private void initCache() throws IOException {
|
||||
for(Path path : Files.walk(basePath).filter(Files::isRegularFile).toList()) {
|
||||
knownIdentities.put(ID.of(basePath.relativize(path)), new AssetIdentity(path));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean handleChange(Path path, ChangeType type, Consumer<ID> changedIds) throws IOException {
|
||||
if(Files.notExists(basePath)) return false;
|
||||
Path target = basePath.relativize(path);
|
||||
ID id = ID.of(target);
|
||||
switch(type) {
|
||||
case ADD:
|
||||
if(Files.isRegularFile(path)) {
|
||||
knownIdentities.put(id, new AssetIdentity(path));
|
||||
changedIds.accept(id);
|
||||
}
|
||||
break;
|
||||
case MODIFIED:
|
||||
AssetIdentity original = knownIdentities.get(id);
|
||||
if(original != null && !original.matches(path)) {
|
||||
knownIdentities.put(id, new AssetIdentity(path));
|
||||
changedIds.accept(id);
|
||||
}
|
||||
break;
|
||||
case REMOVE: {
|
||||
if(knownIdentities.remove(id) != null) {
|
||||
changedIds.accept(id);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws Exception {}
|
||||
|
||||
@Override
|
||||
public List<String> domains() {
|
||||
try(DirectoryStream<Path> dirs = Files.newDirectoryStream(basePath)) {
|
||||
List<String> domains = new ObjectArrayList<>();
|
||||
dirs.forEach(T -> domains.add(T.getFileName().toString()));
|
||||
return domains;
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
return ObjectLists.empty();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAsset get(ID location) {
|
||||
Path path = basePath.resolve(location.fileLocation());
|
||||
return Files.notExists(path) ? null : new SimpleAsset(this, location, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAll(ID folder, BiConsumer<ID, IAsset> assets) {
|
||||
Path start = basePath.resolve(folder.fileLocation());
|
||||
if(Files.notExists(start)) return;
|
||||
try(Stream<Path> stream = Files.walk(start).filter(Files::isRegularFile)) {
|
||||
for(Path path : (Iterable<Path>)() -> stream.iterator()) {
|
||||
ID id = folder.suffix(start.relativize(path));
|
||||
assets.accept(folder, new SimpleAsset(this, id, path));
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package speiger.src.coreengine.assets.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.LinkOption;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.SimpleFileVisitor;
|
||||
import java.nio.file.StandardWatchEventKinds;
|
||||
import java.nio.file.WatchEvent;
|
||||
import java.nio.file.WatchEvent.Kind;
|
||||
import java.nio.file.WatchKey;
|
||||
import java.nio.file.WatchService;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import speiger.src.collections.objects.maps.impl.hash.Object2ObjectOpenHashMap;
|
||||
|
||||
public class FolderWatcher<T> {
|
||||
WatchService watcher;
|
||||
Map<WatchKey, PathFlags<T>> keys = new Object2ObjectOpenHashMap<>();
|
||||
|
||||
public FolderWatcher() throws IOException {
|
||||
watcher = FileSystems.getDefault().newWatchService();
|
||||
}
|
||||
|
||||
public FolderWatcher(WatchService service) {
|
||||
this.watcher = service;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
keys.keySet().forEach(WatchKey::cancel);
|
||||
keys.clear();
|
||||
}
|
||||
|
||||
public void close() throws IOException {
|
||||
watcher.close();
|
||||
keys.clear();
|
||||
}
|
||||
|
||||
public void register(Path basePath, T owner, boolean recursive) throws IOException {
|
||||
if(recursive) {
|
||||
Files.walkFileTree(basePath, new SimpleFileVisitor<Path>() {
|
||||
@Override
|
||||
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
|
||||
keys.put(register(dir), new PathFlags<>(dir, owner, true));
|
||||
return FileVisitResult.CONTINUE;
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
keys.put(register(basePath), new PathFlags<>(basePath, owner, recursive));
|
||||
}
|
||||
|
||||
private WatchKey register(Path path) throws IOException {
|
||||
return path.register(watcher, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_DELETE);
|
||||
}
|
||||
|
||||
public void pollEvents(FolderListener<T> output) {
|
||||
WatchKey key = null;
|
||||
boolean checkInvalidation = false;
|
||||
while((key = watcher.poll()) != null) {
|
||||
PathFlags<T> flags = keys.get(key);
|
||||
if(flags == null) continue;
|
||||
for(WatchEvent<?> event : key.pollEvents()) {
|
||||
if(event.kind() == StandardWatchEventKinds.OVERFLOW) continue;
|
||||
Path child = flags.resolve((Path)event.context());
|
||||
ChangeType type = toType(event.kind());
|
||||
if(type == ChangeType.ADD && flags.recursion() && Files.isDirectory(child, LinkOption.NOFOLLOW_LINKS)) {
|
||||
try { register(child, flags.owner(), true); }
|
||||
catch(Exception e) { e.printStackTrace(); }
|
||||
}
|
||||
else if(type == ChangeType.REMOVE && !checkInvalidation) {
|
||||
checkInvalidation = true;
|
||||
}
|
||||
output.onChanged(child, type, flags.owner());
|
||||
}
|
||||
if(!key.reset()) {
|
||||
keys.remove(key);
|
||||
}
|
||||
}
|
||||
if(checkInvalidation) {
|
||||
keys.keySet().removeIf(((Predicate<WatchKey>)WatchKey::isValid).negate());
|
||||
}
|
||||
}
|
||||
|
||||
private ChangeType toType(Kind<?> kind) {
|
||||
if(kind == StandardWatchEventKinds.ENTRY_CREATE) return ChangeType.ADD;
|
||||
else if(kind == StandardWatchEventKinds.ENTRY_MODIFY) return ChangeType.MODIFIED;
|
||||
return ChangeType.REMOVE;
|
||||
}
|
||||
|
||||
public interface FolderListener<T> {
|
||||
public void onChanged(Path path, ChangeType type, T owner);
|
||||
}
|
||||
|
||||
private record PathFlags<T>(Path folder, T owner, boolean recursion) {
|
||||
public Path resolve(Path subFolder) {
|
||||
return folder.resolve(subFolder);
|
||||
}
|
||||
}
|
||||
|
||||
public static enum ChangeType {
|
||||
ADD,
|
||||
MODIFIED,
|
||||
REMOVE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package speiger.src.coreengine.assets.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.collections.objects.maps.interfaces.Object2ObjectMap;
|
||||
import speiger.src.collections.objects.sets.ObjectOpenHashSet;
|
||||
import speiger.src.collections.objects.utils.ObjectLists;
|
||||
import speiger.src.coreengine.assets.api.IAssetPackage;
|
||||
import speiger.src.coreengine.assets.api.IAssetProvider.ReloadTracker;
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
import speiger.src.coreengine.assets.api.IFileWatcher.FileWatcher;
|
||||
import speiger.src.coreengine.assets.api.IResourceListener;
|
||||
import speiger.src.coreengine.assets.impl.FolderWatcher.ChangeType;
|
||||
|
||||
public class ReloadManager {
|
||||
private static final ScopedValue<IAssetPackage> CURRENT_PACKAGE = ScopedValue.newInstance();
|
||||
private static final ScopedValue<Set<ID>> TRACKED = ScopedValue.newInstance();
|
||||
Map<Path, Map<Path, IAssetPackage>> trackers;
|
||||
FolderWatcher<IAssetPackage> watcher;
|
||||
Runnable onStart;
|
||||
Consumer<Path> onNewFound;
|
||||
Consumer<IAssetPackage> onRemoved;
|
||||
|
||||
public ReloadManager(Runnable onStart, Consumer<Path> onNewFound, Consumer<IAssetPackage> onRemoved) {
|
||||
this.onStart = onStart;
|
||||
this.onNewFound = onNewFound;
|
||||
this.onRemoved = onRemoved;
|
||||
}
|
||||
|
||||
public void enableReload() {
|
||||
if(trackers != null) return;
|
||||
try {
|
||||
watcher = new FolderWatcher<>();
|
||||
trackers = Object2ObjectMap.builder().map();
|
||||
if(onStart != null) onStart.run();
|
||||
}
|
||||
catch(Exception e) { e.printStackTrace(); }
|
||||
}
|
||||
|
||||
public void disableReload() {
|
||||
if(trackers == null) return;
|
||||
try { watcher.close(); }
|
||||
catch(Exception e) { e.printStackTrace(); }
|
||||
watcher = null;
|
||||
trackers = null;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
if(trackers == null) return;
|
||||
trackers.clear();
|
||||
watcher.reset();
|
||||
}
|
||||
|
||||
public void registerPackage(IAssetPackage pack) {
|
||||
try { ScopedValue.where(CURRENT_PACKAGE, pack).call(this::registerWatchers); }
|
||||
catch(Exception e) { e.printStackTrace(); }
|
||||
}
|
||||
|
||||
public List<IResourceListener> handleFileEvents(ReloadTracker listeners, @Nullable Set<ID> changedIds) {
|
||||
if(watcher == null) return ObjectLists.empty();
|
||||
if(changedIds == null) changedIds = new ObjectOpenHashSet<>();
|
||||
ScopedValue.where(TRACKED, changedIds).run(() -> watcher.pollEvents(this::handleEvent));
|
||||
return changedIds.isEmpty() ? ObjectLists.empty() : listeners.findByFilter(changedIds);
|
||||
}
|
||||
|
||||
protected void handleEvent(Path path, ChangeType type, IAssetPackage owner) {
|
||||
if(owner == null) {
|
||||
owner = findOwner(path);
|
||||
if(owner == null) {
|
||||
if(type == ChangeType.ADD && onNewFound != null) onNewFound.accept(path);
|
||||
return;
|
||||
}
|
||||
}
|
||||
try {
|
||||
List<ID> changes = new ObjectArrayList<>();
|
||||
if(owner.handleChange(path, type, changes::add)) {
|
||||
TRACKED.get().addAll(changes);
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch(Exception e) { e.printStackTrace(); }
|
||||
if(onRemoved != null) onRemoved.accept(owner);
|
||||
}
|
||||
|
||||
protected IAssetPackage findOwner(Path path) {
|
||||
Map<Path, IAssetPackage> packages = trackers.get(path.getParent());
|
||||
return packages == null ? null : packages.get(path.getFileName());
|
||||
}
|
||||
|
||||
private Void registerWatchers() throws IOException {
|
||||
if(!CURRENT_PACKAGE.isBound()) throw new IllegalStateException("Current Package is required!");
|
||||
CURRENT_PACKAGE.get().registerWatchers(new FileWatcher(this::onFolderChanged, this::onFileChange));
|
||||
return null;
|
||||
}
|
||||
|
||||
private void onFileChange(Path file) throws IOException {
|
||||
if(!CURRENT_PACKAGE.isBound()) throw new IllegalStateException("Current Package is required!");
|
||||
Map<Path, IAssetPackage> packages = trackers.get(file.getParent());
|
||||
if(packages == null) {
|
||||
packages = Object2ObjectMap.builder().map();
|
||||
trackers.put(file.getParent(), packages);
|
||||
watcher.register(file, null, false);
|
||||
}
|
||||
packages.put(file.getFileName(), CURRENT_PACKAGE.get());
|
||||
}
|
||||
|
||||
private void onFolderChanged(Path folder) throws IOException {
|
||||
if(!CURRENT_PACKAGE.isBound()) throw new IllegalStateException("Current Package is required!");
|
||||
watcher.register(folder, CURRENT_PACKAGE.get(), true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package speiger.src.coreengine.assets.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import speiger.src.coreengine.assets.api.IAsset;
|
||||
import speiger.src.coreengine.assets.api.IAssetPackage;
|
||||
import speiger.src.coreengine.assets.api.IAssetParser;
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
|
||||
public record SimpleAsset(IAssetPackage owner, ID location, Path path) implements IAsset {
|
||||
|
||||
@Override
|
||||
public IAssetPackage owner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream stream() throws IOException {
|
||||
return Files.newInputStream(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T parse(IAssetParser<T> parser) throws IOException {
|
||||
return parser.parse(path);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package speiger.src.coreengine.assets.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.collections.objects.maps.impl.hash.Object2LongOpenHashMap;
|
||||
import speiger.src.collections.objects.maps.interfaces.Object2LongMap;
|
||||
import speiger.src.collections.objects.utils.ObjectLists;
|
||||
import speiger.src.coreengine.assets.api.IAsset;
|
||||
import speiger.src.coreengine.assets.api.IAssetPackage;
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
import speiger.src.coreengine.assets.api.IFileWatcher;
|
||||
import speiger.src.coreengine.assets.impl.FolderWatcher.ChangeType;
|
||||
|
||||
public class ZipAssetPackage implements IAssetPackage {
|
||||
Object2LongMap<ID> crcCache = new Object2LongOpenHashMap<>();
|
||||
Path baseFile;
|
||||
String startFolder;
|
||||
FileSystem cache;
|
||||
|
||||
public ZipAssetPackage(Path baseFile, String startFolder) {
|
||||
this.baseFile = baseFile;
|
||||
this.startFolder = startFolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws Exception {
|
||||
if(cache == null) return;
|
||||
FileSystem cache = this.cache;
|
||||
this.cache = null;
|
||||
cache.close();
|
||||
}
|
||||
|
||||
protected FileSystem getReference() throws IOException {
|
||||
if(cache == null) cache = FileSystems.newFileSystem(baseFile);
|
||||
return cache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerWatchers(IFileWatcher watcher) throws IOException {
|
||||
initCache();
|
||||
watcher.addFile(baseFile);
|
||||
}
|
||||
|
||||
private void initCache() {
|
||||
try(AutoCloseable _ = this) {
|
||||
Path root = getReference().getPath(startFolder);
|
||||
for(Path path : Files.walk(root).filter(Files::isRegularFile).toList()) {
|
||||
crcCache.put(ID.of(root.relativize(path)), getCrc(path));
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private long getCrc(Path path) throws IOException {
|
||||
return (Long)Files.readAttributes(path, "crc").get("crc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleChange(Path file, ChangeType type, Consumer<ID> changed) throws IOException {
|
||||
if(!baseFile.equals(file)) return true;
|
||||
if(Files.notExists(baseFile)) return false;
|
||||
if(type == ChangeType.MODIFIED) {
|
||||
try {
|
||||
Path root = getReference().getPath(startFolder);
|
||||
for(Path path : Files.walk(root).filter(Files::isRegularFile).toList()) {
|
||||
ID id = ID.of(root.relativize(path));
|
||||
long fileCRC = getCrc(path);
|
||||
if(crcCache.getOrDefault(id, -1L) != fileCRC) {
|
||||
crcCache.put(id, fileCRC);
|
||||
changed.accept(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> domains() {
|
||||
try(AutoCloseable _ = this; DirectoryStream<Path> dirs = Files.newDirectoryStream(getReference().getPath(startFolder))) {
|
||||
List<String> domains = new ObjectArrayList<>();
|
||||
dirs.forEach(T -> domains.add(T.getFileName().toString()));
|
||||
return domains;
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
return ObjectLists.empty();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAsset get(ID location) {
|
||||
try {
|
||||
Path path = getReference().getPath(startFolder, location.fileLocation());
|
||||
return Files.notExists(path) ? null : new SimpleAsset(this, location, path);
|
||||
}
|
||||
catch(Exception e) { e.printStackTrace(); }
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAll(ID folder, BiConsumer<ID, IAsset> assets) {
|
||||
try {
|
||||
Path root = getReference().getPath(startFolder, folder.fileLocation());
|
||||
if(Files.notExists(root)) return;
|
||||
for(Path path : Files.walk(root).filter(Files::isRegularFile).toList()) {
|
||||
ID id = ID.of(root.relativize(path));
|
||||
assets.accept(id, new SimpleAsset(this, id, path));
|
||||
}
|
||||
}
|
||||
catch(Exception e) { e.printStackTrace(); }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package speiger.src.coreengine.assets.impl.parsers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
|
||||
import speiger.src.coreengine.assets.api.IAssetParser;
|
||||
|
||||
public class Buffers {
|
||||
public static final IAssetParser<ByteBuffer> HEAP = new Heap();
|
||||
public static final IAssetParser<ByteBuffer> DIRECT = new Direct();
|
||||
|
||||
public static class Heap implements IAssetParser<ByteBuffer> {
|
||||
@Override
|
||||
public ByteBuffer parse(Path path) throws IOException {
|
||||
return ByteBuffer.wrap(Files.readAllBytes(path));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Direct implements IAssetParser<ByteBuffer> {
|
||||
@Override
|
||||
public ByteBuffer parse(Path path) throws IOException {
|
||||
byte[] data = Files.readAllBytes(path);
|
||||
ByteBuffer buffer = MemoryUtil.memAlloc(data.length);
|
||||
buffer.put(data);
|
||||
buffer.flip();
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package speiger.src.coreengine.assets.impl.parsers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Base64;
|
||||
import java.util.Map;
|
||||
import java.util.zip.CRC32C;
|
||||
|
||||
import speiger.src.coreengine.assets.api.IAssetParser;
|
||||
|
||||
public class Checksums {
|
||||
public static final IAssetParser<String> CRC = new CRC();
|
||||
public static final IAssetParser<String> SHA_256 = new SHA256();
|
||||
|
||||
public static class CRC implements IAssetParser<String> {
|
||||
@Override
|
||||
public String parse(Path path) throws IOException {
|
||||
Map<String, Object> files = Files.readAttributes(path, "*");
|
||||
if(files.containsKey("crc")) return Long.toHexString(((Long)files.get("crc")) & 0xFFFFFFFFL);
|
||||
CRC32C crc = new CRC32C();
|
||||
crc.update(Files.readAllBytes(path));
|
||||
return Long.toHexString(crc.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
public static class SHA256 implements IAssetParser<String> {
|
||||
@Override
|
||||
public String parse(Path path) throws IOException {
|
||||
try {
|
||||
MessageDigest digest = MessageDigest.getInstance("SHA-256");
|
||||
digest.update(Files.readAllBytes(path));
|
||||
return Base64.getEncoder().encodeToString(digest.digest());
|
||||
}
|
||||
catch(NoSuchAlgorithmException e) { e.printStackTrace(); }
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package speiger.src.coreengine.assets.impl.parsers;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.channels.SeekableByteChannel;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
|
||||
import speiger.src.coreengine.assets.api.IAssetParser;
|
||||
|
||||
public class Closables {
|
||||
public static final IAssetParser<BufferedReader> READER = new Reader();
|
||||
public static final IAssetParser<SeekableByteChannel> BYTE_CHANNEL = new ByteChannel();
|
||||
|
||||
public static class Reader implements IAssetParser<BufferedReader> {
|
||||
@Override
|
||||
public BufferedReader parse(Path path) throws IOException {
|
||||
return Files.newBufferedReader(path);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ByteChannel implements IAssetParser<SeekableByteChannel> {
|
||||
@Override
|
||||
public SeekableByteChannel parse(Path path) throws IOException {
|
||||
return Files.newByteChannel(path, StandardOpenOption.READ);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package speiger.src.coreengine.assets.impl.parsers;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import speiger.src.coreengine.assets.api.IAssetParser;
|
||||
|
||||
public class Serialized {
|
||||
public static final IAssetParser<List<String>> LINES = new Lines();
|
||||
public static final IAssetParser<JsonObject> JSON_OBJ = new JsonObj();
|
||||
public static final IAssetParser<JsonArray> JSON_ARRAY = new JsonList();
|
||||
|
||||
public static class Lines implements IAssetParser<List<String>> {
|
||||
@Override
|
||||
public List<String> parse(Path path) throws IOException {
|
||||
return Files.readAllLines(path);
|
||||
}
|
||||
}
|
||||
|
||||
public static class JsonObj implements IAssetParser<JsonObject> {
|
||||
@Override
|
||||
public JsonObject parse(Path path) throws IOException {
|
||||
try(BufferedReader reader = Files.newBufferedReader(path)) {
|
||||
return JsonParser.parseReader(reader).getAsJsonObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class JsonList implements IAssetParser<JsonArray> {
|
||||
@Override
|
||||
public JsonArray parse(Path path) throws IOException {
|
||||
try(BufferedReader reader = Files.newBufferedReader(path)) {
|
||||
return JsonParser.parseReader(reader).getAsJsonArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package speiger.src.coreengine.assets.manager;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import speiger.src.collections.objects.sets.ObjectOpenHashSet;
|
||||
import speiger.src.coreengine.assets.api.IAsset;
|
||||
import speiger.src.coreengine.assets.api.IAssetPackage;
|
||||
import speiger.src.coreengine.assets.api.IAssetProvider;
|
||||
import speiger.src.coreengine.assets.api.IAssetProvider.ReloadTracker;
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
import speiger.src.coreengine.assets.api.IResourceListener;
|
||||
import speiger.src.coreengine.assets.api.MultiAsset;
|
||||
import speiger.src.coreengine.assets.impl.ReloadManager;
|
||||
import speiger.src.coreengine.assets.providers.BaseProvider;
|
||||
import speiger.src.coreengine.assets.providers.LayeredProvider;
|
||||
import speiger.src.coreengine.assets.providers.SingleProvider;
|
||||
|
||||
public class AssetManager {
|
||||
BaseProvider provider;
|
||||
List<IAssetPackage> packages;
|
||||
ReloadTracker tracker = new ReloadTracker();
|
||||
ReloadManager manager;
|
||||
AtomicInteger InUse = new AtomicInteger();
|
||||
|
||||
public AssetManager(BaseProvider provider) {
|
||||
setPackages(provider);
|
||||
}
|
||||
|
||||
public static AssetManager single(IAssetPackage pack) {
|
||||
return new AssetManager(new SingleProvider(pack));
|
||||
}
|
||||
|
||||
public static AssetManager mult(List<IAssetPackage> packages) {
|
||||
return new AssetManager(new LayeredProvider(packages));
|
||||
}
|
||||
|
||||
private void setPackages(BaseProvider provider) {
|
||||
this.provider = provider;
|
||||
this.packages = provider.packages();
|
||||
if(manager != null) {
|
||||
manager.reset();
|
||||
packages.forEach(manager::registerPackage);
|
||||
}
|
||||
}
|
||||
|
||||
public AssetManager withReload(@Nullable Consumer<Path> onNewFound, @Nullable Consumer<IAssetPackage> onRemoval) {
|
||||
if(manager != null) throw new IllegalStateException("Can't replace the reload system");
|
||||
manager = new ReloadManager(null, onNewFound, onRemoval);
|
||||
manager.enableReload();
|
||||
packages.forEach(manager::registerPackage);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void register(IResourceListener listener) {
|
||||
tracker.register(listener);
|
||||
}
|
||||
|
||||
public void register(Predicate<ID> filter, IResourceListener listener) {
|
||||
tracker.register(filter, listener);
|
||||
}
|
||||
|
||||
public ReloadTracker listeners() {
|
||||
return tracker;
|
||||
}
|
||||
|
||||
public ReloadTask reload(ReloadBuilder builder) {
|
||||
if(builder.packages.isPresent()) setPackages(builder.packages.get());
|
||||
if(builder.listeners.isEmpty()) builder.withListener(tracker.listeners());
|
||||
return new ReloadTask(get(), builder);
|
||||
}
|
||||
|
||||
public boolean isReloadable() {
|
||||
return manager != null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ReloadTask handleChanges(ReloadBuilder builder) {
|
||||
if(manager == null) return null;
|
||||
Set<ID> changed = new ObjectOpenHashSet<>();
|
||||
List<IResourceListener> reloading = manager.handleFileEvents(tracker, changed);
|
||||
if(reloading.isEmpty()) return null;
|
||||
return reload(builder.withFilter(changed).withPackages((BaseProvider)null).withListener(reloading));
|
||||
}
|
||||
|
||||
public IAssetProvider get() {
|
||||
InUse.incrementAndGet();
|
||||
return new WrappedProvider(provider, this::manageClose);
|
||||
}
|
||||
|
||||
private void manageClose() throws Exception {
|
||||
if(InUse.decrementAndGet() > 0) return;
|
||||
provider.close();
|
||||
}
|
||||
|
||||
public final class WrappedProvider implements IAssetProvider {
|
||||
BaseProvider provider;
|
||||
AutoCloseable closer;
|
||||
|
||||
public WrappedProvider(BaseProvider provider, AutoCloseable closer) {
|
||||
this.provider = provider;
|
||||
this.closer = closer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws Exception {
|
||||
if(provider == null) return;
|
||||
this.provider = null;
|
||||
closer.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable IAsset get(ID id) { return provider.get(id); }
|
||||
@Override
|
||||
public @Nullable MultiAsset getAll(ID id) { return provider.getAll(id); }
|
||||
@Override
|
||||
public Map<ID, IAsset> list(String folder, Predicate<ID> filter) { return provider.list(folder, filter); }
|
||||
@Override
|
||||
public Map<ID, MultiAsset> listAll(String folder, Predicate<ID> filter) { return provider.listAll(folder, filter); }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package speiger.src.coreengine.assets.manager;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import speiger.src.collections.objects.utils.ObjectSets;
|
||||
import speiger.src.coreengine.assets.api.IAssetPackage;
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
import speiger.src.coreengine.assets.api.IResourceListener;
|
||||
import speiger.src.coreengine.assets.providers.BaseProvider;
|
||||
import speiger.src.coreengine.assets.providers.LayeredProvider;
|
||||
import speiger.src.coreengine.assets.providers.SingleProvider;
|
||||
|
||||
public class ReloadBuilder {
|
||||
Executor mainRunner = Runnable::run;
|
||||
Executor syncRunner = Runnable::run;
|
||||
Set<ID> filter = ObjectSets.empty();
|
||||
Optional<BaseProvider> packages = Optional.empty();
|
||||
Optional<List<IResourceListener>> listeners = Optional.empty();
|
||||
|
||||
public ReloadBuilder withFilter(Set<ID> filter) {
|
||||
this.filter = Objects.requireNonNull(filter);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ReloadBuilder withMain(Executor main) {
|
||||
mainRunner = Objects.requireNonNull(main);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ReloadBuilder withSync(Executor sync) {
|
||||
syncRunner = Objects.requireNonNull(sync);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ReloadBuilder withPackages(List<IAssetPackage> packages) {
|
||||
return withPackages(new LayeredProvider(packages));
|
||||
}
|
||||
|
||||
public ReloadBuilder withPackages(IAssetPackage pack) {
|
||||
return withPackages(new SingleProvider(pack));
|
||||
}
|
||||
|
||||
public ReloadBuilder withPackages(BaseProvider packages) {
|
||||
this.packages = Optional.ofNullable(packages);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ReloadBuilder withListener(List<IResourceListener> listeners) {
|
||||
this.listeners = Optional.ofNullable(listeners);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package speiger.src.coreengine.assets.manager;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.collections.objects.sets.ObjectOpenHashSet;
|
||||
import speiger.src.coreengine.assets.api.IAssetProvider;
|
||||
import speiger.src.coreengine.assets.api.IResourceListener;
|
||||
import speiger.src.coreengine.assets.api.IResourceListener.ISyncer;
|
||||
import speiger.src.coreengine.assets.api.ReloadContext;
|
||||
|
||||
public class ReloadTask {
|
||||
AtomicInteger started = new AtomicInteger();
|
||||
AtomicInteger finished = new AtomicInteger();
|
||||
CompletableFuture<?> future;
|
||||
|
||||
public ReloadTask(IAssetProvider provider, ReloadBuilder builder) {
|
||||
future = reload(new ReloadContext(provider, builder.filter, new CountingExecutor(builder.mainRunner, started, finished), new CountingExecutor(builder.syncRunner, started, finished)), new ObjectArrayList<>(builder.listeners.get()));
|
||||
}
|
||||
|
||||
public int started() { return started.get(); }
|
||||
public int stopped() { return finished.get(); }
|
||||
public float progress() { return finished.floatValue() / started.floatValue(); }
|
||||
public CompletableFuture<?> future() { return future; }
|
||||
public void join() { future.join(); }
|
||||
|
||||
private CompletableFuture<?> reload(ReloadContext context, List<IResourceListener> listeners) {
|
||||
started.getAndIncrement();
|
||||
Set<IResourceListener> todo = new ObjectOpenHashSet<>(listeners);
|
||||
CompletableFuture<Void> syncFuture = new CompletableFuture<>();
|
||||
CompletableFuture<Void> chainedTask = CompletableFuture.completedFuture(null);
|
||||
List<CompletableFuture<Void>> tasks = new ObjectArrayList<>();
|
||||
for(IResourceListener listener : listeners) {
|
||||
CompletableFuture<Void> current = chainedTask;
|
||||
chainedTask = listener.reload(context, new Syncer(context.main(), current, syncFuture, listener, todo));
|
||||
tasks.add(chainedTask);
|
||||
}
|
||||
return CompletableFuture.allOf(tasks.toArray(CompletableFuture[]::new)).thenRunAsync(() -> {
|
||||
finished.getAndIncrement();
|
||||
try { context.provider().close(); }
|
||||
catch(Exception e) { e.printStackTrace(); }
|
||||
}, context.main());
|
||||
}
|
||||
|
||||
|
||||
private record Syncer(Executor main, CompletableFuture<?> currentStep, CompletableFuture<?> syncStep, IResourceListener listener, Set<IResourceListener> toComplete) implements ISyncer {
|
||||
@Override
|
||||
public <T> CompletableFuture<T> sync(T value) {
|
||||
main.execute(() -> {
|
||||
toComplete.remove(listener);
|
||||
if(toComplete.isEmpty()) syncStep.complete(null);
|
||||
});
|
||||
return syncStep.thenCombine(currentStep, (_, _) -> value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private record CountingExecutor(Executor wrapper, AtomicInteger started, AtomicInteger finished) implements Executor {
|
||||
@Override
|
||||
public void execute(Runnable command) {
|
||||
started.getAndIncrement();
|
||||
wrapper.execute(() -> {
|
||||
command.run();
|
||||
finished.getAndIncrement();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package speiger.src.coreengine.assets.providers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import speiger.src.coreengine.assets.api.IAssetPackage;
|
||||
import speiger.src.coreengine.assets.api.IAssetProvider;
|
||||
|
||||
public interface BaseProvider extends IAssetProvider {
|
||||
List<IAssetPackage> packages();
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package speiger.src.coreengine.assets.providers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.collections.objects.lists.ObjectList;
|
||||
import speiger.src.collections.objects.maps.interfaces.Object2ObjectMap;
|
||||
import speiger.src.collections.objects.utils.maps.Object2ObjectMaps;
|
||||
import speiger.src.coreengine.assets.api.IAsset;
|
||||
import speiger.src.coreengine.assets.api.IAssetPackage;
|
||||
import speiger.src.coreengine.assets.api.IAssetProvider;
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
import speiger.src.coreengine.assets.api.MultiAsset;
|
||||
|
||||
public class LayeredProvider implements BaseProvider {
|
||||
Map<String, DomainProvider> domains = Object2ObjectMap.builder().linkedMap();
|
||||
List<IAssetPackage> packages;
|
||||
|
||||
public LayeredProvider(List<IAssetPackage> packages) {
|
||||
this.packages = packages;
|
||||
for(IAssetPackage pack : packages) {
|
||||
for(String domain : pack.domains()) {
|
||||
domains.computeIfAbsent(domain, DomainProvider::new).add(pack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IAssetPackage> packages() {
|
||||
return packages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws Exception {
|
||||
for(IAssetPackage pack : packages) {
|
||||
pack.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable IAsset get(ID id) {
|
||||
DomainProvider provider = domains.get(id.domain());
|
||||
return provider == null ? null : provider.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable MultiAsset getAll(ID id) {
|
||||
DomainProvider provider = domains.get(id.domain());
|
||||
return provider == null ? null : provider.getAll(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ID, IAsset> list(String folder, Predicate<ID> filter) {
|
||||
Map<ID, IAsset> result = Object2ObjectMap.builder().linkedMap();
|
||||
for(DomainProvider provider : domains.values()) {
|
||||
result.putAll(provider.list(folder, filter));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ID, MultiAsset> listAll(String folder, Predicate<ID> filter) {
|
||||
Map<ID, MultiAsset> result = Object2ObjectMap.builder().linkedMap();
|
||||
for(DomainProvider provider : domains.values()) {
|
||||
result.putAll(provider.listAll(folder, filter));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static class DomainProvider implements IAssetProvider {
|
||||
final String domain;
|
||||
ObjectList<IAssetPackage> packages = new ObjectArrayList<>();
|
||||
|
||||
public DomainProvider(String domain) {
|
||||
this.domain = domain;
|
||||
}
|
||||
|
||||
public void add(IAssetPackage pack) {
|
||||
packages.add(pack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {}
|
||||
|
||||
@Override
|
||||
public @Nullable IAsset get(ID id) {
|
||||
for(int i = packages.size()-1;i>=0;i--) {
|
||||
IAsset asset = packages.get(i).get(id);
|
||||
if(asset != null) return asset;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable MultiAsset getAll(ID id) {
|
||||
ObjectList<IAsset> result = new ObjectArrayList<>();
|
||||
for(int i = packages.size()-1;i>=0;i--) {
|
||||
IAsset asset = packages.get(i).get(id);
|
||||
if(asset != null) result.add(asset);
|
||||
}
|
||||
return new MultiAsset(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ID, IAsset> list(String folder, Predicate<ID> filter) {
|
||||
ID base = ID.of(domain, folder);
|
||||
Map<ID, IAsset> result = Object2ObjectMap.builder().linkedMap();
|
||||
for(int i = packages.size()-1;i>=0;i--) {
|
||||
packages.get(i).getAll(base, (K, V) -> {
|
||||
if(filter.test(K)) result.putIfAbsent(K, V);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ID, MultiAsset> listAll(String folder, Predicate<ID> filter) {
|
||||
ID base = ID.of(domain, folder);
|
||||
Object2ObjectMap<ID, ObjectList<IAsset>> assets = Object2ObjectMap.builder().linkedMap();
|
||||
for(int i = packages.size()-1;i>=0;i--) {
|
||||
packages.get(i).getAll(base, (K, V) -> {
|
||||
if(filter.test(K)) assets.supplyIfAbsent(K, ObjectArrayList::new).add(V);
|
||||
});
|
||||
}
|
||||
Map<ID, MultiAsset> result = Object2ObjectMap.builder().linkedMap();
|
||||
for(Object2ObjectMap.Entry<ID, ObjectList<IAsset>> entry : Object2ObjectMaps.fastIterable(assets)) {
|
||||
result.put(entry.getKey(), new MultiAsset(entry.getValue()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package speiger.src.coreengine.assets.providers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.collections.objects.lists.ObjectList;
|
||||
import speiger.src.collections.objects.maps.interfaces.Object2ObjectMap;
|
||||
import speiger.src.collections.objects.utils.ObjectLists;
|
||||
import speiger.src.collections.objects.utils.maps.Object2ObjectMaps;
|
||||
import speiger.src.coreengine.assets.api.IAsset;
|
||||
import speiger.src.coreengine.assets.api.IAssetPackage;
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
import speiger.src.coreengine.assets.api.MultiAsset;
|
||||
|
||||
public class SingleProvider implements BaseProvider {
|
||||
IAssetPackage pack;
|
||||
List<String> domains;
|
||||
|
||||
public SingleProvider(IAssetPackage pack) {
|
||||
this.pack = pack;
|
||||
this.domains = pack.domains();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws Exception {
|
||||
pack.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IAssetPackage> packages() {
|
||||
return ObjectLists.singleton(pack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable IAsset get(ID id) {
|
||||
return pack.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable MultiAsset getAll(ID id) {
|
||||
IAsset asset = pack.get(id);
|
||||
return asset == null ? null : new MultiAsset(asset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ID, IAsset> list(String folder, Predicate<ID> filter) {
|
||||
Map<ID, IAsset> result = Object2ObjectMap.builder().linkedMap();
|
||||
for(String domain : domains) {
|
||||
pack.getAll(ID.of(domain, folder), (K, V) -> {
|
||||
if(filter.test(K)) result.putIfAbsent(K, V);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ID, MultiAsset> listAll(String folder, Predicate<ID> filter) {
|
||||
Object2ObjectMap<ID, ObjectList<IAsset>> assets = Object2ObjectMap.builder().linkedMap();
|
||||
for(String domain : domains) {
|
||||
pack.getAll(ID.of(domain, folder), (K, V) -> {
|
||||
if(filter.test(K)) assets.supplyIfAbsent(K, ObjectArrayList::new).add(V);
|
||||
});
|
||||
}
|
||||
Map<ID, MultiAsset> result = Object2ObjectMap.builder().linkedMap();
|
||||
for(Object2ObjectMap.Entry<ID, ObjectList<IAsset>> entry : Object2ObjectMaps.fastIterable(assets)) {
|
||||
result.put(entry.getKey(), new MultiAsset(entry.getValue()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package speiger.src.coreengine.graphics.api.buffer;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.List;
|
||||
|
||||
import org.jspecify.annotations.NonNull;
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
|
||||
import speiger.src.collections.ints.misc.pairs.IntObjectPair;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.BufferState;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.BufferType;
|
||||
import speiger.src.coreengine.graphics.api.utils.BufferOwner;
|
||||
import speiger.src.coreengine.graphics.api.utils.GraphicsResource;
|
||||
|
||||
public abstract class VertexBuffer implements GraphicsResource {
|
||||
protected final BufferType type;
|
||||
protected final BufferState usage;
|
||||
protected int size;
|
||||
|
||||
public VertexBuffer(BufferType type, BufferState usage) {
|
||||
this.type = type;
|
||||
this.usage = usage;
|
||||
}
|
||||
|
||||
public BufferType type() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public BufferState usage() {
|
||||
return usage;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public abstract VertexBuffer bind();
|
||||
public abstract VertexBuffer unbind();
|
||||
|
||||
public abstract VertexBuffer allocate(int totalBytes);
|
||||
public abstract VertexBuffer set(long pointer, int totalBytes, BufferOwner owner);
|
||||
public VertexBuffer set(ByteBuffer buffer, BufferOwner owner) { return set(MemoryUtil.memAddress(buffer), buffer.remaining(), owner); }
|
||||
public VertexBuffer set(byte[] data) { return set(MemoryUtil.memAlloc(data.length).put(data).flip(), BufferOwner.GIVEN); }
|
||||
|
||||
public abstract VertexBuffer fill(long pointer, int totalBytes, int offset, BufferOwner owner);
|
||||
public VertexBuffer fill(int offset, ByteBuffer buffer, BufferOwner owner) { return fill(MemoryUtil.memAddress(buffer), buffer.remaining(), offset, owner); }
|
||||
public VertexBuffer fill(int offset, byte[] data) {
|
||||
return fill(offset, MemoryUtil.memAlloc(data.length).put(data).flip(), BufferOwner.GIVEN);
|
||||
}
|
||||
|
||||
public abstract VertexBuffer read(long pointer, int totalBytes, int offset, @NonNull Runnable completion);
|
||||
public VertexBuffer read(Buffer buffer, int totalBytes, int offset, @NonNull Runnable completion) { return read(MemoryUtil.memAddress(buffer), totalBytes, offset, completion); }
|
||||
|
||||
public VertexBuffer fill(List<IntObjectPair<byte[]>> data) { return fill(0, data); }
|
||||
public abstract VertexBuffer fill(int offset, List<IntObjectPair<byte[]>> data);
|
||||
|
||||
public abstract VertexBuffer shrink(int newSize);
|
||||
public abstract VertexBuffer grow(int newSize);
|
||||
public abstract VertexBuffer shift(int source, int dest, int length);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package speiger.src.coreengine.graphics.api.buffer.states;
|
||||
|
||||
public enum BufferState {
|
||||
STATIC_DRAW,
|
||||
STATIC_READ,
|
||||
STATIC_COPY,
|
||||
STREAM_DRAW,
|
||||
STREAM_READ,
|
||||
STREAM_COPY,
|
||||
DYNAMIC_DRAW,
|
||||
DYNAMIC_READ,
|
||||
DYNAMIC_COPY;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package speiger.src.coreengine.graphics.api.buffer.states;
|
||||
|
||||
public enum BufferType {
|
||||
ARRAY_BUFFER,
|
||||
ELEMENT_BUFFER,
|
||||
UNIFORM_BUFFER,
|
||||
DRAW_INDIRECT_BUFFER,
|
||||
TEXTURE_BUFFER,
|
||||
PIXEL_PACK_BUFFER,
|
||||
PIXEL_UNPACK_BUFFER,
|
||||
TRANSFORM_FEEDBACK_BUFFER,
|
||||
COPY_READ_BUFFER,
|
||||
COPY_WRITE_BUFFER,
|
||||
ATOMIC_COUNTER_BUFFER,
|
||||
DISPATCH_INDIRECT_BUFFER,
|
||||
SHADER_STORAGE_BUFFER;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package speiger.src.coreengine.graphics.api.buffer.states;
|
||||
|
||||
public enum IndeciesType {
|
||||
BYTE,
|
||||
SHORT,
|
||||
INT;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package speiger.src.coreengine.graphics.api.compute;
|
||||
|
||||
public enum BarrierType {
|
||||
MESH_BUFFER,
|
||||
SHADER_TEXTURE,
|
||||
SHADER_IMAGE,
|
||||
SHADER_STORAGE,
|
||||
SHADER_UNIFORM,
|
||||
INDIRECT_COMMAND,
|
||||
FRAMEBUFFER,
|
||||
CPU;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package speiger.src.coreengine.graphics.api.compute;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.collections.objects.lists.ObjectList;
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.Bindings.BufferBinding;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.Bindings.BufferMode;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.Bindings.TextureBinding;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.Bindings.TextureMode;
|
||||
import speiger.src.coreengine.graphics.api.texture.states.TextureType;
|
||||
|
||||
public record ComputePipeline(ID id, ID shader, List<BufferBinding> uniforms, List<TextureBinding> textures) {
|
||||
|
||||
public static Builder builder(ID id) {
|
||||
return new Builder(id);
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
ID id;
|
||||
ID shader;
|
||||
ObjectList<BufferBinding> uniforms = new ObjectArrayList<>();
|
||||
ObjectList<TextureBinding> textures = new ObjectArrayList<>();
|
||||
|
||||
private Builder(ID id) {
|
||||
this.id = Objects.requireNonNull(id);
|
||||
}
|
||||
|
||||
public Builder withShader(ID shader) {
|
||||
this.shader = Objects.requireNonNull(shader);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder withUniform(String name, int binding, int slot, int bytes) {
|
||||
uniforms.add(new BufferBinding(Objects.requireNonNull(name), binding, slot, bytes, BufferMode.UNIFORM));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder withBuffer(String name, int binding, int slot, int bytes) {
|
||||
uniforms.add(new BufferBinding(Objects.requireNonNull(name), binding, slot, bytes, BufferMode.STORAGE));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder withTexture(String name, int binding, int slot, TextureType type) {
|
||||
textures.add(new TextureBinding(Objects.requireNonNull(name), binding, slot, type, TextureMode.SAMPLER));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder withStorage(String name, int binding, int slot, TextureType type) {
|
||||
textures.add(new TextureBinding(Objects.requireNonNull(name), binding, slot, type, TextureMode.IMAGE_BUFFER));
|
||||
return this;
|
||||
}
|
||||
|
||||
public ComputePipeline build() {
|
||||
return new ComputePipeline(id, Objects.requireNonNull(shader, "A Shader has to exist"), uniforms, textures);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package speiger.src.coreengine.graphics.api.core;
|
||||
|
||||
public interface CommandBuffer {
|
||||
int commandCount();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package speiger.src.coreengine.graphics.api.core;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.buffer.VertexBuffer;
|
||||
import speiger.src.coreengine.graphics.api.compute.BarrierType;
|
||||
import speiger.src.coreengine.graphics.api.compute.ComputePipeline;
|
||||
import speiger.src.coreengine.graphics.api.sampler.Sampler;
|
||||
import speiger.src.coreengine.graphics.api.texture.Texture;
|
||||
import speiger.src.coreengine.graphics.api.utils.AccessType;
|
||||
import speiger.src.coreengine.graphics.api.utils.GraphicsResource;
|
||||
|
||||
public interface ComputeCommandBuffer extends GraphicsResource, CommandBuffer {
|
||||
ComputeCommandBuffer begin();
|
||||
ComputeCommandBuffer pipeline(ComputePipeline pipeline);
|
||||
|
||||
|
||||
ComputeCommandBuffer texture(int binding, Texture texture, Sampler sampler);
|
||||
ComputeCommandBuffer texture(int binding, Texture texture, AccessType access);
|
||||
|
||||
ComputeCommandBuffer uniform(int binding, VertexBuffer buffer);
|
||||
ComputeCommandBuffer uniform(int binding, VertexBuffer buffer, long offset, long size);
|
||||
|
||||
ComputeCommandBuffer storage(int binding, VertexBuffer buffer);
|
||||
ComputeCommandBuffer storage(int binding, VertexBuffer buffer, long offset, long size);
|
||||
|
||||
ComputeCommandBuffer dispatch(int numGroupsX, int numGroupsY, int numGroupsZ);
|
||||
|
||||
ComputeCommandBuffer barrier(BarrierType... types);
|
||||
|
||||
ComputeCommandBuffer end();
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package speiger.src.coreengine.graphics.api.core;
|
||||
|
||||
import speiger.src.coreengine.input.window.Window;
|
||||
|
||||
public interface Graphics {
|
||||
public String getName();
|
||||
|
||||
public void setupWindowArguments();
|
||||
public GraphicsDevice createDevice(Window window);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package speiger.src.coreengine.graphics.api.core;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.buffer.VertexBuffer;
|
||||
import speiger.src.coreengine.graphics.api.mesh.Mesh;
|
||||
import speiger.src.coreengine.graphics.api.sampler.Sampler;
|
||||
import speiger.src.coreengine.graphics.api.shader.ShaderPipeline;
|
||||
import speiger.src.coreengine.graphics.api.texture.Texture;
|
||||
import speiger.src.coreengine.graphics.api.utils.AccessType;
|
||||
import speiger.src.coreengine.graphics.api.utils.GraphicsResource;
|
||||
|
||||
public interface GraphicsCommandBuffer extends GraphicsResource, CommandBuffer {
|
||||
GraphicsCommandBuffer begin();
|
||||
GraphicsCommandBuffer setScissors(int x, int y, int width, int height);
|
||||
|
||||
GraphicsCommandBuffer pipeline(ShaderPipeline pipeline);
|
||||
GraphicsCommandBuffer mesh(Mesh mesh);
|
||||
GraphicsCommandBuffer texture(int binding, Texture texture, Sampler sampler);
|
||||
GraphicsCommandBuffer texture(int binding, Texture texture, AccessType access);
|
||||
|
||||
GraphicsCommandBuffer uniform(int binding, VertexBuffer buffer);
|
||||
GraphicsCommandBuffer uniform(int binding, VertexBuffer buffer, long offset, long size);
|
||||
|
||||
GraphicsCommandBuffer storage(int binding, VertexBuffer buffer);
|
||||
GraphicsCommandBuffer storage(int binding, VertexBuffer buffer, long offset, long size);
|
||||
|
||||
GraphicsCommandBuffer drawArrays(int offset, int count);
|
||||
GraphicsCommandBuffer drawElements(int offset, int count);
|
||||
|
||||
GraphicsCommandBuffer pushScissors(int x, int y, int width, int height);
|
||||
GraphicsCommandBuffer popScissors();
|
||||
GraphicsCommandBuffer end();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package speiger.src.coreengine.graphics.api.core;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.shader.states.GraphicsDataType;
|
||||
import speiger.src.coreengine.graphics.api.target.RenderTarget;
|
||||
import speiger.src.coreengine.graphics.api.texture.Texture;
|
||||
import speiger.src.coreengine.graphics.api.texture.states.TextureFormat;
|
||||
import speiger.src.coreengine.graphics.api.utils.PushableResource;
|
||||
import speiger.src.coreengine.math.vector.floats.Vec4f;
|
||||
|
||||
public interface GraphicsCommandQueue {
|
||||
public static final int CLEAR_COLOR = 1;
|
||||
public static final int CLEAR_DEPTH = 2;
|
||||
public static final int CLEAR_BOTH = 3;
|
||||
public PushableResource putClearColor(Vec4f color);
|
||||
public PushableResource putClearDepth(double value);
|
||||
public PushableResource putRenderTarget(RenderTarget target);
|
||||
public PushableResource pushViewPort(int x, int y, int width, int height);
|
||||
|
||||
public void clearTexture(int clearParam);
|
||||
public void clearTexture(int x, int y, int width, int height, int clearParam);
|
||||
public void clearTexture(Texture texture, int clearParam);
|
||||
public void clearTexture(Texture texture, int x, int y, int width, int height, int clearParam);
|
||||
|
||||
public void writeToTexture(Texture target, TextureFormat format, GraphicsDataType dataType, long source);
|
||||
public default void writeToTexture(Texture target, int level, int x, int y, int width, int height, TextureFormat format, GraphicsDataType dataType, long source) {
|
||||
writeToTexture(target, level, 0, 0, x, y, width, height, format, dataType, source);
|
||||
}
|
||||
public void writeToTexture(Texture target, int level, int sourceX, int sourceY, int targetX, int targetY, int width, int height, TextureFormat format, GraphicsDataType dataType, long source);
|
||||
|
||||
public void submitCommands(CommandBuffer buffer);
|
||||
|
||||
public GraphicsFence createFence();
|
||||
public long currentFrame();
|
||||
public void submitFrame();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package speiger.src.coreengine.graphics.api.core;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.buffer.VertexBuffer;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.BufferState;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.BufferType;
|
||||
import speiger.src.coreengine.graphics.api.compute.ComputePipeline;
|
||||
import speiger.src.coreengine.graphics.api.mesh.Mesh;
|
||||
import speiger.src.coreengine.graphics.api.sampler.Sampler;
|
||||
import speiger.src.coreengine.graphics.api.sampler.SamplerSettings;
|
||||
import speiger.src.coreengine.graphics.api.shader.ShaderPipeline;
|
||||
import speiger.src.coreengine.graphics.api.texture.Texture;
|
||||
import speiger.src.coreengine.graphics.api.texture.TextureSettings;
|
||||
import speiger.src.coreengine.graphics.api.utils.ExecutionType;
|
||||
import speiger.src.coreengine.input.window.Window;
|
||||
|
||||
public interface GraphicsDevice {
|
||||
Window window();
|
||||
GraphicsSurface createSurface();
|
||||
GraphicsCommandBuffer createCommandBuffer(ExecutionType type);
|
||||
GraphicsCommandQueue queue();
|
||||
VertexBuffer createBuffer(BufferType type, BufferState state);
|
||||
VertexBuffer createBuffer(BufferType type, BufferState state, int allocatedBytes);
|
||||
Texture createTexture(TextureSettings data, int width, int height);
|
||||
Sampler createSampler(SamplerSettings settings);
|
||||
Mesh createMesh(Mesh.Builder builder);
|
||||
TimeQueryPool createQueryPool(int size);
|
||||
void preloadPipelines(List<ShaderPipeline> graphics, List<ComputePipeline> compute);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package speiger.src.coreengine.graphics.api.core;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.utils.GraphicsResource;
|
||||
|
||||
public interface GraphicsFence extends GraphicsResource {
|
||||
boolean awaitCompletion(long timeout);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package speiger.src.coreengine.graphics.api.core;
|
||||
|
||||
public interface GraphicsSurface {
|
||||
public void setVsync(boolean value);
|
||||
public void beginFrame();
|
||||
public void finishFrame();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package speiger.src.coreengine.graphics.api.core;
|
||||
|
||||
import java.util.OptionalLong;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.utils.GraphicsResource;
|
||||
|
||||
public interface TimeQueryPool extends GraphicsResource {
|
||||
public int size();
|
||||
public void write(int index);
|
||||
public OptionalLong get(int index);
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package speiger.src.coreengine.graphics.api.mesh;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.OptionalInt;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import speiger.src.collections.ints.maps.impl.hash.Int2ObjectOpenHashMap;
|
||||
import speiger.src.collections.ints.maps.interfaces.Int2ObjectMap;
|
||||
import speiger.src.coreengine.graphics.api.buffer.VertexBuffer;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.BufferState;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.IndeciesType;
|
||||
import speiger.src.coreengine.graphics.api.utils.GraphicsResource;
|
||||
import speiger.src.coreengine.graphics.api.vertex.VertexLayout;
|
||||
|
||||
public abstract class Mesh implements GraphicsResource {
|
||||
protected final Int2ObjectMap<LayoutInfo> layouts;
|
||||
protected Int2ObjectMap<VertexBuffer> buffers;
|
||||
protected VertexBuffer indeciesBuffer;
|
||||
protected IndeciesType indeciesType;
|
||||
|
||||
public Mesh(Int2ObjectMap<LayoutInfo> layouts, Int2ObjectMap<VertexBuffer> buffers, @Nullable VertexBuffer indeciesBuffer, @Nullable IndeciesType type) {
|
||||
this.layouts = layouts;
|
||||
this.buffers = buffers;
|
||||
this.indeciesBuffer = indeciesBuffer;
|
||||
}
|
||||
|
||||
protected abstract void closeWithBuffers();
|
||||
|
||||
public Int2ObjectMap<LayoutInfo> layouts() {
|
||||
return layouts;
|
||||
}
|
||||
|
||||
public VertexBuffer indeciesBuffer() {
|
||||
return indeciesBuffer;
|
||||
}
|
||||
|
||||
public IndeciesType indeciesType() {
|
||||
return indeciesType;
|
||||
}
|
||||
|
||||
public VertexBuffer buffer(int binding) {
|
||||
return buffers.get(binding);
|
||||
}
|
||||
|
||||
public Mesh indexBuffer(VertexBuffer indexBuffer, IndeciesType indeciesType) {
|
||||
this.indeciesBuffer = indexBuffer;
|
||||
this.indeciesType = indeciesType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Mesh buffer(int binding, VertexBuffer buffer) {
|
||||
buffers.put(binding, buffer);
|
||||
return this;
|
||||
}
|
||||
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
Int2ObjectMap<BufferState> allocateState = new Int2ObjectOpenHashMap<BufferState>().setDefaultReturnValue(BufferState.STATIC_READ);
|
||||
Int2ObjectMap<LayoutInfo> layouts = Int2ObjectMap.builder().linkedMap();
|
||||
IndeciesType type = IndeciesType.INT;
|
||||
OptionalInt preallocated = OptionalInt.empty();
|
||||
boolean autoGenerate;
|
||||
|
||||
private Builder() {}
|
||||
|
||||
public Builder autogenerate() {
|
||||
autoGenerate = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder preallocate(int bytes) {
|
||||
preallocated = OptionalInt.of(bytes);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder indecies(IndeciesType type) {
|
||||
type = Objects.requireNonNull(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder bufferState(BufferState state) {
|
||||
allocateState.setDefaultReturnValue(Objects.requireNonNull(state));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder bufferState(int index, BufferState state) {
|
||||
allocateState.put(index, state);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder layout(VertexLayout layout) {
|
||||
return layout(layouts.size(), layout);
|
||||
}
|
||||
|
||||
public Builder layout(int index, VertexLayout layout) {
|
||||
return layout(index, layout, 0);
|
||||
}
|
||||
|
||||
public Builder layout(int index, VertexLayout layout, int instanceCount) {
|
||||
if(layout.isEmpty()) throw new IllegalStateException("Empty Layouts are not valid");
|
||||
layouts.put(index, new LayoutInfo(Objects.requireNonNull(layout), instanceCount));
|
||||
return this;
|
||||
}
|
||||
|
||||
public void validate() {
|
||||
if(layouts.isEmpty()) throw new IllegalStateException("Layouts have to be provided");
|
||||
}
|
||||
|
||||
public boolean isAutogenerated() {
|
||||
return autoGenerate;
|
||||
}
|
||||
|
||||
public IndeciesType indecies() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public OptionalInt preAllocated() {
|
||||
return preallocated;
|
||||
}
|
||||
|
||||
public BufferState getState(int index) {
|
||||
return allocateState.get(index);
|
||||
}
|
||||
|
||||
public Int2ObjectMap<LayoutInfo> info() {
|
||||
return layouts.unmodifiable();
|
||||
}
|
||||
}
|
||||
|
||||
public record LayoutInfo(VertexLayout layout, int instanceCount) {}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package speiger.src.coreengine.graphics.api.sampler;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.utils.GraphicsResource;
|
||||
|
||||
public abstract class Sampler implements GraphicsResource {
|
||||
protected SamplerSettings settings;
|
||||
|
||||
public Sampler(SamplerSettings settings) {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
public SamplerSettings settings() {
|
||||
return settings;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package speiger.src.coreengine.graphics.api.sampler;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.sampler.states.BorderMode;
|
||||
import speiger.src.coreengine.graphics.api.sampler.states.SampleMode;
|
||||
|
||||
public record SamplerSettings(BorderMode wrapS, BorderMode wrapT, Optional<BorderMode> wrapR, SampleMode minSample, SampleMode magSample) {
|
||||
|
||||
public SamplerSettings {
|
||||
Objects.requireNonNull(wrapS);
|
||||
Objects.requireNonNull(wrapT);
|
||||
Objects.requireNonNull(wrapR);
|
||||
Objects.requireNonNull(minSample);
|
||||
Objects.requireNonNull(magSample);
|
||||
}
|
||||
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
BorderMode wrapS;
|
||||
BorderMode wrapT;
|
||||
BorderMode wrapR;
|
||||
SampleMode minSample;
|
||||
SampleMode magSample;
|
||||
|
||||
public Builder wrap(BorderMode mode) {
|
||||
return wrap(mode, false);
|
||||
}
|
||||
|
||||
public Builder wrap(BorderMode mode, boolean includeR) {
|
||||
wrapS = Objects.requireNonNull(mode);
|
||||
wrapT = Objects.requireNonNull(mode);
|
||||
if(includeR) {
|
||||
wrapR = Objects.requireNonNull(mode);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder wrapS(BorderMode mode) {
|
||||
wrapS = Objects.requireNonNull(mode);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder wrapT(BorderMode mode) {
|
||||
wrapT = Objects.requireNonNull(mode);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder wrapR(BorderMode mode) {
|
||||
wrapR = mode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder sampler(SampleMode mode) {
|
||||
minSample = Objects.requireNonNull(mode);
|
||||
if(mode != SampleMode.LINEAR && mode != SampleMode.NEAREST) throw new IllegalArgumentException("["+mode+"] is not supported in mag filter");
|
||||
magSample = Objects.requireNonNull(mode);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder minSample(SampleMode mode) {
|
||||
minSample = Objects.requireNonNull(mode);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder magSample(SampleMode mode) {
|
||||
if(mode != SampleMode.LINEAR && mode != SampleMode.NEAREST) throw new IllegalArgumentException("["+mode+"] is not supported in mag filter");
|
||||
magSample = Objects.requireNonNull(mode);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SamplerSettings build() {
|
||||
return new SamplerSettings(Objects.requireNonNull(wrapS, "X Wrap should be defined"),
|
||||
Objects.requireNonNull(wrapT, "Y Wrap should be defined"),
|
||||
Optional.ofNullable(wrapR),
|
||||
Objects.requireNonNull(minSample, "Min Sample should be defined"),
|
||||
Objects.requireNonNull(magSample, "Mag Sample should be defined"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package speiger.src.coreengine.graphics.api.sampler.states;
|
||||
|
||||
public enum BorderMode {
|
||||
CLAMP_TO_EDGE,
|
||||
CLAMP_TO_BORDER,
|
||||
MIRRORED_REPEAT,
|
||||
REPEAT,
|
||||
MIRROR_CLAMP_TO_EDGE;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package speiger.src.coreengine.graphics.api.sampler.states;
|
||||
|
||||
public enum SampleMode {
|
||||
NEAREST,
|
||||
LINEAR,
|
||||
NEAREST_MIPMAP_NEAREST,
|
||||
LINEAR_MIPMAP_NEAREST,
|
||||
NEAREST_MIPMAP_LINEAR,
|
||||
LINEAR_MIPMAP_LINEAR;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package speiger.src.coreengine.graphics.api.shader;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.shader.states.GraphicsDataType;
|
||||
|
||||
public record BufferAttribute(String name, int index, int size, GraphicsDataType type, boolean normal) {
|
||||
public BufferAttribute {
|
||||
Objects.requireNonNull(name, "Attributes requires name");
|
||||
Objects.requireNonNull(type, "GraphicsDataType required");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package speiger.src.coreengine.graphics.api.shader;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.shader.states.BlendFunction;
|
||||
|
||||
public record ColorTarget(Optional<BlendFunction> blend, int writeMask) {
|
||||
public static final int RED = 1;
|
||||
public static final int GREEN = 2;
|
||||
public static final int BLUE = 4;
|
||||
public static final int ALPHA = 8;
|
||||
public static final int ALL = 15;
|
||||
public static final ColorTarget DEFAULT = new ColorTarget(null);
|
||||
|
||||
public ColorTarget {
|
||||
Objects.requireNonNull(blend);
|
||||
if(writeMask < 0 || writeMask > ALL) throw new IllegalArgumentException("WriteMask has to be within 0-15");
|
||||
}
|
||||
|
||||
public ColorTarget(BlendFunction function) {
|
||||
this(Optional.ofNullable(function), ALL);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package speiger.src.coreengine.graphics.api.shader;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.utils.AlphaFunction;
|
||||
|
||||
public record DepthTarget(boolean enabled, AlphaFunction function, boolean write) {
|
||||
public static final DepthTarget DEFAULT = new DepthTarget(true, AlphaFunction.GEQUAL, true);
|
||||
|
||||
public DepthTarget {
|
||||
Objects.requireNonNull(function);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package speiger.src.coreengine.graphics.api.shader;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.shader.states.DrawMode;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.PolygonMode;
|
||||
|
||||
public record RasterizerState(DrawMode mode, PolygonMode fillMode, boolean cullBack) {
|
||||
public static final RasterizerState DEFAULT = new RasterizerState(DrawMode.TRIANGLES, PolygonMode.FILL, true);
|
||||
public RasterizerState {
|
||||
Objects.requireNonNull(mode);
|
||||
Objects.requireNonNull(fillMode);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package speiger.src.coreengine.graphics.api.shader;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.collections.objects.lists.ObjectList;
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.Bindings.BufferMode;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.Bindings.TextureBinding;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.Bindings.TextureMode;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.Bindings.BufferBinding;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.DrawMode;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.PolygonMode;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.ShaderType;
|
||||
import speiger.src.coreengine.graphics.api.texture.states.TextureType;
|
||||
import speiger.src.coreengine.graphics.api.vertex.VertexLayout;
|
||||
|
||||
public record ShaderPipeline(ID id, Map<ShaderType, ID> shaders, List<VertexBinding> attributes, List<BufferBinding> uniforms, List<TextureBinding> textures, RasterizerState rasterizer, ColorTarget colorTarget, DepthTarget depthTarget) {
|
||||
|
||||
public ShaderPipeline {
|
||||
Objects.requireNonNull(id);
|
||||
if(shaders.isEmpty()) throw new IllegalStateException("Shaders isn't allowed to be empty");
|
||||
if(shaders.containsKey(ShaderType.COMPUTE)) throw new IllegalStateException("Graphics Pipelines are not allowed to have Compute Shaders");
|
||||
Objects.requireNonNull(uniforms);
|
||||
Objects.requireNonNull(textures);
|
||||
Objects.requireNonNull(rasterizer);
|
||||
Objects.requireNonNull(colorTarget);
|
||||
Objects.requireNonNull(depthTarget);
|
||||
}
|
||||
|
||||
public static Builder builder(ID id) {
|
||||
return new Builder(id);
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
ID id;
|
||||
EnumMap<ShaderType, ID> shaders = new EnumMap<>(ShaderType.class);
|
||||
ObjectList<VertexBinding> attributes = new ObjectArrayList<>();
|
||||
ObjectList<BufferBinding> uniforms = new ObjectArrayList<>();
|
||||
ObjectList<TextureBinding> textures = new ObjectArrayList<>();
|
||||
RasterizerState rasterizer = RasterizerState.DEFAULT;
|
||||
ColorTarget colorTarget = ColorTarget.DEFAULT;
|
||||
DepthTarget depthTarget = DepthTarget.DEFAULT;
|
||||
|
||||
private Builder(ID id) {
|
||||
this.id = Objects.requireNonNull(id);
|
||||
}
|
||||
|
||||
public Builder withStage(ShaderType type, ID location) {
|
||||
shaders.put(Objects.requireNonNull(type, "Shouldn't be null"), Objects.requireNonNull(location, "Resource shouldn't be null"));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder withUniform(String name, int binding, int slot, int bytes) {
|
||||
uniforms.add(new BufferBinding(Objects.requireNonNull(name), binding, slot, bytes, BufferMode.UNIFORM));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder withBuffer(String name, int binding, int slot, int bytes) {
|
||||
uniforms.add(new BufferBinding(Objects.requireNonNull(name), binding, slot, bytes, BufferMode.STORAGE));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder withTexture(String name, int binding, int slot, TextureType type) {
|
||||
textures.add(new TextureBinding(Objects.requireNonNull(name), binding, slot, type, TextureMode.SAMPLER));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder withStorage(String name, int binding, int slot, TextureType type) {
|
||||
textures.add(new TextureBinding(Objects.requireNonNull(name), binding, slot, type, TextureMode.IMAGE_BUFFER));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder withRasterizer(DrawMode draw, PolygonMode polygon, boolean cullBack) {
|
||||
rasterizer = new RasterizerState(Objects.requireNonNull(draw), Objects.requireNonNull(polygon), cullBack);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder withFormat(VertexLayout layout) {
|
||||
return withFormat(attributes.size(), layout);
|
||||
}
|
||||
|
||||
public Builder withInstanceFormat(VertexLayout layout) {
|
||||
return withFormat(attributes.size(), layout, 1);
|
||||
}
|
||||
|
||||
public Builder withInstanceFormat(VertexLayout layout, int instanceCount) {
|
||||
return withFormat(attributes.size(), layout, instanceCount);
|
||||
}
|
||||
|
||||
public Builder withFormat(int bindingIndex, VertexLayout layout) {
|
||||
return withFormat(bindingIndex, layout, 0);
|
||||
}
|
||||
|
||||
public Builder withFormat(int bindingIndex, VertexLayout layout, int instanceCount) {
|
||||
attributes.add(new VertexBinding(bindingIndex, Objects.requireNonNull(layout), instanceCount));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder withColorTarget(ColorTarget target) {
|
||||
this.colorTarget = Objects.requireNonNull(target);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder withDepthTarget(DepthTarget target) {
|
||||
this.depthTarget = Objects.requireNonNull(target);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ShaderPipeline build() {
|
||||
if(shaders.isEmpty()) throw new IllegalStateException("Shaders must be provided in a Shader Pipeline");
|
||||
if(shaders.containsKey(ShaderType.COMPUTE)) throw new IllegalStateException("Graphics Pipelines are not allowed to have Compute Shaders");
|
||||
return new ShaderPipeline(id, Collections.unmodifiableMap(shaders), attributes.unmodifiable(), uniforms.unmodifiable(), textures.unmodifiable(), Objects.requireNonNull(rasterizer, "A Rasterizer should be defined"), colorTarget, depthTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package speiger.src.coreengine.graphics.api.shader;
|
||||
|
||||
import speiger.src.collections.objects.collections.ObjectIterable;
|
||||
import speiger.src.coreengine.graphics.api.vertex.VertexLayout;
|
||||
import speiger.src.coreengine.graphics.api.vertex.VertexLayout.Element;
|
||||
|
||||
public record VertexBinding(int bindingIndex, VertexLayout layout, int instanceOffset) {
|
||||
public ObjectIterable<Element> elements() {
|
||||
return layout.elements();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package speiger.src.coreengine.graphics.api.shader.states;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.texture.states.TextureType;
|
||||
|
||||
public class Bindings {
|
||||
public record BufferBinding(String name, int binding, int slot, int bytes, BufferMode mode) {
|
||||
public BufferBinding {
|
||||
Objects.requireNonNull(name, "A name has to be provided");
|
||||
Objects.requireNonNull(mode, "A Mode has to be provided");
|
||||
}
|
||||
}
|
||||
|
||||
public record TextureBinding(String name, int binding, int slot, TextureType type, TextureMode mode) {
|
||||
public TextureBinding {
|
||||
Objects.requireNonNull(name, "A name has to be provided");
|
||||
Objects.requireNonNull(type, "A TextureType has to be provided");
|
||||
Objects.requireNonNull(mode, "A Mode has to be provided");
|
||||
}
|
||||
}
|
||||
|
||||
public static enum BufferMode {
|
||||
UNIFORM,
|
||||
STORAGE;
|
||||
}
|
||||
|
||||
public static enum TextureMode {
|
||||
SAMPLER,
|
||||
IMAGE_BUFFER;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package speiger.src.coreengine.graphics.api.shader.states;
|
||||
|
||||
public enum BlendFactor {
|
||||
ZERO,
|
||||
ONE,
|
||||
CONSTANT_COLOR,
|
||||
CONSTANT_ALPHA,
|
||||
SRC_COLOR,
|
||||
SRC_ALPHA,
|
||||
DST_COLOR,
|
||||
DST_ALPHA,
|
||||
ONE_MINUS_SRC_COLOR,
|
||||
ONE_MINUS_SRC_ALPHA,
|
||||
ONE_MINUS_DST_COLOR,
|
||||
ONE_MINUS_DST_ALPHA,
|
||||
ONE_MINUS_CONSTANT_COLOR,
|
||||
ONE_MINUS_CONSTANT_ALPHA,
|
||||
SRC_ALPHA_SATURATE;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package speiger.src.coreengine.graphics.api.shader.states;
|
||||
|
||||
public record BlendFunction(BlendFactor colorSource, BlendFactor alphaSource, BlendFactor colorTarget, BlendFactor alphaTarget) {
|
||||
public static final BlendFunction DEFAULT = new BlendFunction(BlendFactor.ONE, BlendFactor.ZERO);
|
||||
public BlendFunction(BlendFactor source, BlendFactor target) {
|
||||
this(source, BlendFactor.ONE, target, BlendFactor.ZERO);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package speiger.src.coreengine.graphics.api.shader.states;
|
||||
|
||||
public enum DrawMode {
|
||||
POINT(1),
|
||||
LINES(2),
|
||||
LINE_STRIP(2, true),
|
||||
LINE_LOOP(2, true),
|
||||
TRIANGLES(3),
|
||||
TRIANGLE_STRIP(3, true),
|
||||
TRIANGLE_FAN(3, true),
|
||||
QUADS(4);
|
||||
|
||||
int length;
|
||||
boolean isConnective;
|
||||
|
||||
private DrawMode(int length) {
|
||||
this(length, false);
|
||||
}
|
||||
|
||||
private DrawMode(int length, boolean isConnective) {
|
||||
this.length = length;
|
||||
this.isConnective = isConnective;
|
||||
}
|
||||
|
||||
public int primitiveLength() { return length; }
|
||||
public boolean isConnective() { return isConnective; }
|
||||
public int indeciesCount(int vertecies) {
|
||||
return switch(this) {
|
||||
case POINT, LINE_STRIP, TRIANGLES, TRIANGLE_STRIP, TRIANGLE_FAN -> vertecies;
|
||||
case LINES, QUADS -> vertecies / 4 * 6;
|
||||
default -> 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package speiger.src.coreengine.graphics.api.shader.states;
|
||||
|
||||
public enum GraphicsDataType {
|
||||
BYTE("byte", 1, PrimitiveType.BYTE),
|
||||
UNSIGNED_BYTE("u_byte", 1, PrimitiveType.BYTE, true),
|
||||
SHORT("short", 2, PrimitiveType.SHORT),
|
||||
UNSIGNED_SHORT("u_short", 2, PrimitiveType.SHORT, true),
|
||||
INT("int", 4, PrimitiveType.INT),
|
||||
UNSIGNED_INT("u_int", 4, PrimitiveType.INT, true),
|
||||
FLOAT("float", 4, PrimitiveType.FLOAT),
|
||||
DOUBLE("double", 8, PrimitiveType.DOUBLE),
|
||||
|
||||
//CompressedTypes
|
||||
UNSIGNED_3_3_2("u_byte_3_3_2", 1, PrimitiveType.BYTE, false, true),
|
||||
UNSIGNED_2_3_3_REV("u_byte_2_3_3_rev", 1, PrimitiveType.BYTE, false, true),
|
||||
UNSIGNED_5_6_5("u_short_5_6_5", 2, PrimitiveType.SHORT, false, true),
|
||||
UNSIGNED_5_6_5_REV("u_short_5_6_5_rev", 2, PrimitiveType.SHORT, false, true),
|
||||
UNSIGNED_4_4_4_4("u_short_4_4_4_4", 2, PrimitiveType.SHORT, false, true),
|
||||
UNSIGNED_4_4_4_4_REV("u_short_4_4_4_4_rev", 2, PrimitiveType.SHORT, false, true),
|
||||
UNSIGNED_5_5_5_1("u_short_5_5_5_1", 2, PrimitiveType.SHORT, false, true),
|
||||
UNSIGNED_1_5_5_5_REV("u_short_1_5_5_5_rev", 2, PrimitiveType.SHORT, false, true),
|
||||
UNSIGNED_8_8_8_8("u_int_8_8_8_8", 4, PrimitiveType.INT, false, true),
|
||||
UNSIGNED_8_8_8_8_REV("u_int_8_8_8_8_rev", 4, PrimitiveType.INT, false, true),
|
||||
UNSIGNED_10_10_10_2("u_int_10_10_10_2", 4, PrimitiveType.INT, false, true),
|
||||
UNSIGNED_2_10_10_10_REV("u_int_2_10_10_10_rev", 4, PrimitiveType.INT, false, true),
|
||||
|
||||
UNSIGNED_INT_10F_11F_11F_REV("u_int_10_11_11_rev", 4, PrimitiveType.INT, false, true),
|
||||
UNSIGNED_INT_5_9_9_9_REV("u_int_5_9_9_9_rev", 4, PrimitiveType.INT, false, true);
|
||||
|
||||
String name;
|
||||
int byteSize;
|
||||
PrimitiveType type;
|
||||
boolean supportsIBO;
|
||||
boolean compound;
|
||||
|
||||
private GraphicsDataType(String name, int byteSize, PrimitiveType type, boolean supportsIBO, boolean compound) {
|
||||
this.name = name;
|
||||
this.byteSize = byteSize;
|
||||
this.type = type;
|
||||
this.supportsIBO = supportsIBO;
|
||||
this.compound = compound;
|
||||
}
|
||||
|
||||
private GraphicsDataType(String name, int byteSize, PrimitiveType type, boolean supportsIBO) {
|
||||
this(name, byteSize, type, supportsIBO, false);
|
||||
}
|
||||
|
||||
|
||||
private GraphicsDataType(String name, int byteSize, PrimitiveType type) {
|
||||
this(name, byteSize, type, false, false);
|
||||
}
|
||||
|
||||
public String idName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int byteSize() {
|
||||
return byteSize;
|
||||
}
|
||||
|
||||
public PrimitiveType type() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public boolean isCompound() {
|
||||
return compound;
|
||||
}
|
||||
|
||||
public boolean supportsIBO() {
|
||||
return supportsIBO;
|
||||
}
|
||||
|
||||
public int size(int attributes) {
|
||||
return compound ? byteSize : attributes * byteSize;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package speiger.src.coreengine.graphics.api.shader.states;
|
||||
|
||||
public enum PolygonMode {
|
||||
POINT,
|
||||
LINE,
|
||||
FILL;
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package speiger.src.coreengine.graphics.api.shader.states;
|
||||
|
||||
public enum PrimitiveType {
|
||||
BYTE,
|
||||
SHORT,
|
||||
INT,
|
||||
LONG,
|
||||
FLOAT,
|
||||
DOUBLE;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package speiger.src.coreengine.graphics.api.shader.states;
|
||||
|
||||
public enum ShaderType {
|
||||
VERTEX,
|
||||
FRAGMENT,
|
||||
GEOMETRY,
|
||||
TESSELATION_CONTROL,
|
||||
TESSELATION_EVALUATION,
|
||||
COMPUTE;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package speiger.src.coreengine.graphics.api.target;
|
||||
|
||||
public sealed interface RenderTarget permits ScreenTarget, TextureTarget {
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package speiger.src.coreengine.graphics.api.target;
|
||||
|
||||
public final class ScreenTarget implements RenderTarget {
|
||||
public static final ScreenTarget INSTANCE = new ScreenTarget();
|
||||
private ScreenTarget() {}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package speiger.src.coreengine.graphics.api.target;
|
||||
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
import speiger.src.coreengine.graphics.api.texture.Texture;
|
||||
import speiger.src.coreengine.graphics.api.texture.states.TextureType;
|
||||
|
||||
public record TextureTarget(ID id, Texture color, Texture depth) implements RenderTarget {
|
||||
public TextureTarget {
|
||||
if(color == null && depth == null) throw new IllegalArgumentException("At least either texture has to be nonNull");
|
||||
if(color != null && depth != null) {
|
||||
if(color.width() != depth.width()) throw new IllegalArgumentException("Width is not matching");
|
||||
if(color.height() != depth.height()) throw new IllegalArgumentException("Height is not matching");
|
||||
}
|
||||
if(color != null && color.settings().type() != TextureType.TEXTURE_2D) throw new IllegalArgumentException("Color Texture has to be 2D");
|
||||
if(depth != null && depth.settings().type() != TextureType.TEXTURE_2D) throw new IllegalArgumentException("Depth Texture has to be 2D");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package speiger.src.coreengine.graphics.api.texture;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.utils.GraphicsResource;
|
||||
|
||||
public abstract class Texture implements GraphicsResource {
|
||||
final TextureSettings settings;
|
||||
int width;
|
||||
int height;
|
||||
|
||||
public Texture(TextureSettings settings, int width, int height) {
|
||||
this.settings = settings;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public int width() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public int height() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public TextureSettings settings() {
|
||||
return settings;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package speiger.src.coreengine.graphics.api.texture;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.OptionalInt;
|
||||
|
||||
import speiger.src.collections.objects.lists.ImmutableObjectList;
|
||||
import speiger.src.coreengine.graphics.api.texture.states.StencilType;
|
||||
import speiger.src.coreengine.graphics.api.texture.states.SwizzleMask;
|
||||
import speiger.src.coreengine.graphics.api.texture.states.TextureFormat;
|
||||
import speiger.src.coreengine.graphics.api.texture.states.TextureType;
|
||||
|
||||
public record TextureSettings(TextureType type, TextureFormat internal, boolean generateMipmapping, OptionalInt baseLevel, OptionalInt maxLevel, ImmutableObjectList<Optional<SwizzleMask>> swizzle, Optional<StencilType> stencilType) {
|
||||
|
||||
public TextureSettings {
|
||||
Objects.requireNonNull(type, "Texture Type shouldn't be null");
|
||||
Objects.requireNonNull(internal, "Internal Format shouldn't be null");
|
||||
Objects.requireNonNull(baseLevel);
|
||||
Objects.requireNonNull(maxLevel);
|
||||
Objects.requireNonNull(swizzle);
|
||||
Objects.requireNonNull(stencilType);
|
||||
}
|
||||
|
||||
public Builder copy() { return new Builder(this); }
|
||||
public static Builder builder() { return new Builder(); }
|
||||
|
||||
public boolean hasSwizzle() {
|
||||
for(int i = 0;i<4;i++) {
|
||||
if(swizzle().get(i).isPresent()) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
TextureFormat internalFormat = TextureFormat.RGBA;
|
||||
TextureType type = TextureType.TEXTURE_2D;
|
||||
boolean generateMipmapping = false;
|
||||
OptionalInt baseLevel = OptionalInt.empty();
|
||||
OptionalInt maxLevel = OptionalInt.empty();
|
||||
@SuppressWarnings("unchecked")
|
||||
Optional<SwizzleMask>[] swizzle = new Optional[] {Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()};
|
||||
Optional<StencilType> stencilType = Optional.empty();
|
||||
|
||||
private Builder() {}
|
||||
private Builder(TextureSettings settings) {
|
||||
type = settings.type;
|
||||
internalFormat = settings.internal;
|
||||
generateMipmapping = settings.generateMipmapping;
|
||||
baseLevel = settings.baseLevel;
|
||||
maxLevel = settings.maxLevel;
|
||||
settings.swizzle.toArray(swizzle);
|
||||
stencilType = settings.stencilType;
|
||||
}
|
||||
|
||||
public TextureSettings build() {
|
||||
return new TextureSettings(
|
||||
Objects.requireNonNull(type, "Texture Type shouldn't be null"),
|
||||
Objects.requireNonNull(internalFormat, "Internal Format shouldn't be null"),
|
||||
generateMipmapping, baseLevel, maxLevel, new ImmutableObjectList<>(swizzle), stencilType);
|
||||
}
|
||||
|
||||
public Builder type(TextureType type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder format(TextureFormat format) {
|
||||
this.internalFormat = format;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder internal(TextureFormat format) {
|
||||
this.internalFormat = format;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder swizzle(SwizzleMask red, SwizzleMask green, SwizzleMask blue, SwizzleMask alpha) {
|
||||
swizzle[0] = Optional.ofNullable(red);
|
||||
swizzle[1] = Optional.ofNullable(green);
|
||||
swizzle[2] = Optional.ofNullable(blue);
|
||||
swizzle[3] = Optional.ofNullable(alpha);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder swizzleRed(SwizzleMask mask) {
|
||||
swizzle[0] = Optional.ofNullable(mask);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder swizzleGreen(SwizzleMask mask) {
|
||||
swizzle[1] = Optional.ofNullable(mask);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder swizzleBlue(SwizzleMask mask) {
|
||||
swizzle[2] = Optional.ofNullable(mask);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder swizzleAlpha(SwizzleMask mask) {
|
||||
swizzle[3] = Optional.ofNullable(mask);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder stencil(StencilType type) {
|
||||
stencilType = Optional.ofNullable(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder generateMipmapping(boolean value) {
|
||||
this.generateMipmapping = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder mipMapping(int base, int max) {
|
||||
this.baseLevel = OptionalInt.of(base);
|
||||
this.maxLevel = OptionalInt.of(max);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clearmMipMapping() {
|
||||
this.baseLevel = OptionalInt.empty();
|
||||
this.maxLevel = OptionalInt.empty();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
package speiger.src.coreengine.graphics.api.texture.drawable;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.lwjgl.stb.STBImage;
|
||||
import org.lwjgl.stb.STBTTFontinfo;
|
||||
import org.lwjgl.stb.STBTruetype;
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
import org.lwjgl.util.freetype.FT_Bitmap;
|
||||
import org.lwjgl.util.freetype.FT_Face;
|
||||
import org.lwjgl.util.freetype.FT_GlyphSlot;
|
||||
import org.lwjgl.util.freetype.FreeType;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.core.GraphicsCommandQueue;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.GraphicsDataType;
|
||||
import speiger.src.coreengine.graphics.api.texture.Texture;
|
||||
import speiger.src.coreengine.graphics.api.texture.states.TextureFormat;
|
||||
import speiger.src.coreengine.math.color.ColorSpaces;
|
||||
|
||||
public class Drawable implements IDrawable, AutoCloseable {
|
||||
TextureFormat format;
|
||||
int width;
|
||||
int height;
|
||||
long components;
|
||||
long pixels;
|
||||
boolean isSTB;
|
||||
|
||||
public Drawable(TextureFormat format, int width, int height) {
|
||||
this(format, width, height, MemoryUtil.nmemAllocChecked(format.components() * width * height), false);
|
||||
}
|
||||
|
||||
public Drawable(TextureFormat format, int width, int height, long pixels, boolean isSTB) {
|
||||
this.format = format;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.pixels = pixels;
|
||||
this.components = format.components();
|
||||
this.isSTB = isSTB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ColorSpaces colorspace() { return ColorSpaces.ABGR; }
|
||||
@Override
|
||||
public int width() { return width; }
|
||||
@Override
|
||||
public int height() { return height; }
|
||||
public long pixels() { return pixels; }
|
||||
public boolean isSTBImage() { return isSTB; }
|
||||
public TextureFormat format() { return format; }
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if(pixels == 0L) return;
|
||||
if(isSTB) STBImage.nstbi_image_free(pixels);
|
||||
else MemoryUtil.nmemFree(pixels);
|
||||
pixels = 0L;
|
||||
}
|
||||
|
||||
protected long offset(int x, int y) {
|
||||
return ((y * width()) + x) * components;
|
||||
}
|
||||
|
||||
protected void ensureValid(int index) {
|
||||
ensureValid(index % width, index / width);
|
||||
}
|
||||
|
||||
protected void ensureValid(int x, int y) {
|
||||
if(x < 0 || y < 0) throw new ArrayIndexOutOfBoundsException("Index out of bounds: X=["+x+"], Y=["+y+"]");
|
||||
if(x > width || y > height) throw new ArrayIndexOutOfBoundsException("Index out of bounds: X=["+x+"], Y=["+y+"], width=["+width+"], height=["+height+"]");
|
||||
if(pixels == 0L) throw new IllegalStateException("Pixel Data doesn't exist");
|
||||
}
|
||||
|
||||
public boolean drawFont(FT_Face face, int glyth) {
|
||||
ensureValid(0);
|
||||
if(components != 1) throw new IllegalStateException("Format has to be 1 component");
|
||||
if(FreeType.FT_Load_Glyph(face, glyth, 4) != 0) return false;
|
||||
|
||||
FT_GlyphSlot slot = Objects.requireNonNull(face.glyph());
|
||||
FT_Bitmap map = slot.bitmap();
|
||||
if(map.pixel_mode() != FreeType.FT_PIXEL_MODE_GRAY) throw new IllegalStateException("Pixel isn't a grayscale picture");
|
||||
if(map.width() != width() || map.rows() != height()) throw new IllegalStateException("Bounds do not match");
|
||||
int size = map.width() * map.rows();
|
||||
ByteBuffer buffer = Objects.requireNonNull(map.buffer(size));
|
||||
MemoryUtil.memCopy(MemoryUtil.memAddress(buffer), pixels(), size);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void drawFont(STBTTFontinfo info, int glyth, float sourceX, float sourceY, int targetX, int targetY, int width, int height, float scaleX, float scaleY) {
|
||||
ensureValid(targetX, targetY);
|
||||
ensureValid(targetX + width, targetY + height);
|
||||
if(components != 1) throw new IllegalStateException("Format has to be 1 component");
|
||||
STBTruetype.nstbtt_MakeGlyphBitmapSubpixel(info.address(), pixels + offset(targetX, targetY), width, height, width(), scaleX, scaleY, sourceX, sourceY, glyth);
|
||||
}
|
||||
|
||||
public void upload(GraphicsCommandQueue queue, Texture texture) {
|
||||
if(texture.width() != width || texture.height() != height) throw new IllegalStateException("Texture[w="+texture.width()+",h="+texture.height()+"] bounds does not match the drawable [w="+width+",h="+height+"]");
|
||||
queue.writeToTexture(texture, format, GraphicsDataType.UNSIGNED_BYTE, pixels);
|
||||
}
|
||||
|
||||
public void upload(GraphicsCommandQueue queue, Texture texture, int targetX, int targetY, int sourceX, int sourceY, int width, int height) {
|
||||
upload(queue, texture, 0, targetX, targetY, sourceX, sourceY, width, height);
|
||||
}
|
||||
|
||||
public void upload(GraphicsCommandQueue queue, Texture texture, int level, int targetX, int targetY, int sourceX, int sourceY, int width, int height) {
|
||||
ensureValid(sourceX, sourceY);
|
||||
ensureValid(sourceX + width, sourceY + height);
|
||||
queue.writeToTexture(texture, level, sourceX, sourceY, targetX, targetY, width, height, format, GraphicsDataType.UNSIGNED_BYTE, pixels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(int index, int data) {
|
||||
ensureValid(index);
|
||||
if(components != 4) throw new IllegalStateException("Format has to be 4 components");
|
||||
MemoryUtil.memPutInt(this.pixels + index * 4L, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setR(int index, int red) {
|
||||
if(!format.hasRed()) throw new IllegalArgumentException("Format doesn't support Red/Luminance");
|
||||
ensureValid(index);
|
||||
MemoryUtil.memPutByte(this.pixels + index * components + format.redOffset(), (byte)(red & 0xFF));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setG(int index, int green) {
|
||||
if(!format.hasGreen()) throw new IllegalArgumentException("Format doesn't support Green");
|
||||
ensureValid(index);
|
||||
MemoryUtil.memPutByte(this.pixels + index * components + format.greenOffset(), (byte)(green & 0xFF));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setB(int index, int blue) {
|
||||
if(!format.hasBlue()) throw new IllegalArgumentException("Format doesn't support Blue");
|
||||
ensureValid(index);
|
||||
MemoryUtil.memPutByte(this.pixels + index * components + format.blueOffset(), (byte)(blue & 0xFF));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setA(int index, int alpha) {
|
||||
if(!format.hasAlpha()) throw new IllegalArgumentException("Format doesn't support Alpha");
|
||||
ensureValid(index);
|
||||
MemoryUtil.memPutByte(this.pixels + index * components + format.alphaOffset(), (byte)(alpha & 0xFF));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fill(int x, int y, int width, int height, int data) {
|
||||
if(components != 4 && components != 1) throw new IllegalStateException("Format has to be 1 or 4 components");
|
||||
ensureValid(x, y);
|
||||
ensureValid(x+width, y+height);
|
||||
if(components == 1) {
|
||||
for(int xOff = 0;xOff<width;xOff++) {
|
||||
for(int yOff = 0;yOff<height;yOff++) {
|
||||
MemoryUtil.memPutByte(this.pixels + offset(x+xOff, y+yOff), (byte)(data & 0xFF));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
for(int xOff = 0;xOff<width;xOff++) {
|
||||
for(int yOff = 0;yOff<height;yOff++) {
|
||||
MemoryUtil.memPutInt(this.pixels + offset(x+xOff, y+yOff), data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int get(int index) {
|
||||
if(components != 4) throw new IllegalStateException("Format has to be 4 components");
|
||||
ensureValid(index);
|
||||
return MemoryUtil.memGetInt(this.pixels + index * 4L);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getR(int index) {
|
||||
if(!format.hasRed()) throw new IllegalArgumentException("Format doesn't support Red/Luminance");
|
||||
ensureValid(index);
|
||||
return MemoryUtil.memGetByte(this.pixels + index * components + format.redOffset());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getG(int index) {
|
||||
if(!format.hasGreen()) throw new IllegalArgumentException("Format doesn't support Green");
|
||||
ensureValid(index);
|
||||
return MemoryUtil.memGetByte(this.pixels + index * components + format.greenOffset());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getB(int index) {
|
||||
if(!format.hasBlue()) throw new IllegalArgumentException("Format doesn't support Blue");
|
||||
ensureValid(index);
|
||||
return MemoryUtil.memGetByte(this.pixels + index * components + format.blueOffset());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getA(int index) {
|
||||
if(!format.hasAlpha()) throw new IllegalArgumentException("Format doesn't support Alpha");
|
||||
ensureValid(index);
|
||||
return MemoryUtil.memGetByte(this.pixels + index * components + format.alphaOffset());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package speiger.src.coreengine.graphics.api.texture.drawable;
|
||||
|
||||
import speiger.src.coreengine.math.color.ColorSpaces;
|
||||
|
||||
public interface IDrawable {
|
||||
public ColorSpaces colorspace();
|
||||
public int width();
|
||||
public int height();
|
||||
|
||||
public void set(int index, int data);
|
||||
public default void set(int x, int y, int data) { set((y * width()) + x, data); }
|
||||
|
||||
public default void set(int index, int red, int green, int blue, int alpha) { set(index, colorspace().color(red, green, blue, alpha)); }
|
||||
public default void set(int x, int y, int red, int green, int blue, int alpha) { set((y * width()) + x, colorspace().color(red, green, blue, alpha)); }
|
||||
|
||||
public void setR(int index, int red);
|
||||
public default void setR(int x, int y, int red) { setR((y * width()) + x, red); }
|
||||
|
||||
public void setG(int index, int green);
|
||||
public default void setG(int x, int y, int green) { setG((y * width()) + x, green); }
|
||||
|
||||
public void setB(int index, int blue);
|
||||
public default void setB(int x, int y, int blue) { setB((y * width()) + x, blue); }
|
||||
|
||||
public void setA(int index, int alpha);
|
||||
public default void setA(int x, int y, int alpha) { setA((y * width()) + x, alpha); }
|
||||
|
||||
public void fill(int x, int y, int width, int height, int data);
|
||||
public default void fill(int x, int y, int width, int height, int red, int green, int blue, int alpha) { fill(x, y, width, height, colorspace().color(red, green, blue, alpha)); }
|
||||
|
||||
public int get(int index);
|
||||
public default int get(int x, int y) { return get((y * width()) + x); }
|
||||
|
||||
public int getR(int index);
|
||||
public default int getR(int x, int y) { return getR((y * width()) + x); }
|
||||
public int getG(int index);
|
||||
public default int getG(int x, int y) { return getG((y * width()) + x); }
|
||||
public int getB(int index);
|
||||
public default int getB(int x, int y) { return getB((y * width()) + x); }
|
||||
public int getA(int index);
|
||||
public default int getA(int x, int y) { return getA((y * width()) + x); }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package speiger.src.coreengine.graphics.api.texture.states;
|
||||
|
||||
public enum StencilType {
|
||||
GL_COMPARE_REF_TO_TEXTURE,
|
||||
GL_NONE
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package speiger.src.coreengine.graphics.api.texture.states;
|
||||
|
||||
public enum SwizzleMask {
|
||||
ZERO,
|
||||
ONE,
|
||||
RED,
|
||||
GREEN,
|
||||
BLUE,
|
||||
ALPHA;
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package speiger.src.coreengine.graphics.api.texture.states;
|
||||
|
||||
public enum TextureFormat {
|
||||
R(1, 0, -1, -1, -1),
|
||||
RG(2, 0, 1, -1, -1),
|
||||
RGB(3, 0, 1, 2, -1),
|
||||
RGBA(4, 0, 1, 2, 3),
|
||||
DEPTH(1, 0, -1, -1, -1),
|
||||
DEPTH_STENCIL(2, 0, 1, -1, -1),
|
||||
LUMINANCE(1, 0, 0, 0, 0),
|
||||
LUMINANCE_ALPHA(2, 0, -1, -1, 1);
|
||||
|
||||
int components;
|
||||
int componentMask;
|
||||
int redOffset;
|
||||
int greenOffset;
|
||||
int blueOffset;
|
||||
int alphaOffset;
|
||||
|
||||
private TextureFormat(int components, int redOffset, int greenOffset, int blueOffset, int alphaOffset) {
|
||||
this.components = components;
|
||||
this.componentMask = (1 << (components * 8)) - 1;
|
||||
this.redOffset = redOffset;
|
||||
this.greenOffset = greenOffset;
|
||||
this.blueOffset = blueOffset;
|
||||
this.alphaOffset = alphaOffset;
|
||||
}
|
||||
|
||||
public int components() { return components; }
|
||||
public int componentMask() { return componentMask; }
|
||||
public int redOffset() { return redOffset; }
|
||||
public int greenOffset() { return greenOffset; }
|
||||
public int blueOffset() { return blueOffset; }
|
||||
public int alphaOffset() { return alphaOffset; }
|
||||
|
||||
public boolean hasRed() { return redOffset != -1; }
|
||||
public boolean hasGreen() { return greenOffset != -1; }
|
||||
public boolean hasBlue() { return blueOffset != -1; }
|
||||
public boolean hasAlpha() { return alphaOffset != -1; }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package speiger.src.coreengine.graphics.api.texture.states;
|
||||
|
||||
public enum TextureType {
|
||||
TEXTURE_1D,
|
||||
TEXTURE_1D_ARRAY,
|
||||
TEXTURE_2D,
|
||||
TEXTURE_2D_ARRAY,
|
||||
TEXTURE_2D_MULTISAMPLE,
|
||||
TEXTURE_2D_MULTISAMPLE_ARRAY,
|
||||
TEXTURE_3D,
|
||||
TEXTURE_CUBE_MAP,
|
||||
TEXTURE_CUBE_MAP_ARRAY,
|
||||
TEXTURE_RECTANGLE,
|
||||
TEXTURE_BUFFER;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package speiger.src.coreengine.graphics.api.utils;
|
||||
|
||||
public enum AccessType {
|
||||
READ,
|
||||
WRITE,
|
||||
BOTH;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package speiger.src.coreengine.graphics.api.utils;
|
||||
|
||||
public enum AlphaFunction {
|
||||
NEVER,
|
||||
LESS,
|
||||
EQUAL,
|
||||
LEQUAL,
|
||||
GREATER,
|
||||
NOTEQUAL,
|
||||
GEQUAL,
|
||||
ALWAYS;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package speiger.src.coreengine.graphics.api.utils;
|
||||
|
||||
public enum BufferOwner {
|
||||
KEPT,
|
||||
GIVEN;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package speiger.src.coreengine.graphics.api.utils;
|
||||
|
||||
public enum ExecutionType {
|
||||
IMMEDIATE,
|
||||
RECORDED;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package speiger.src.coreengine.graphics.api.utils;
|
||||
|
||||
public interface GraphicsResource extends AutoCloseable {
|
||||
public boolean isRemoved();
|
||||
public void remove();
|
||||
|
||||
@Override
|
||||
default void close() {
|
||||
remove();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package speiger.src.coreengine.graphics.api.utils;
|
||||
|
||||
public interface PushableResource extends AutoCloseable {
|
||||
@Override
|
||||
public void close();
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package speiger.src.coreengine.graphics.api.utils;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.collections.utils.Stack;
|
||||
import speiger.src.coreengine.math.vector.ints.Vec4i;
|
||||
|
||||
public class ScissorsManager {
|
||||
IScissorsHandler handler;
|
||||
Stack<Vec4i> stack = new ObjectArrayList<>();
|
||||
boolean withRoot = false;
|
||||
int limit;
|
||||
|
||||
public ScissorsManager(int limit, IScissorsHandler handler) {
|
||||
if(limit <= 0) throw new IllegalStateException("Limit is negative");
|
||||
this.limit = limit;
|
||||
this.handler = Objects.requireNonNull(handler, "Handler is required");
|
||||
}
|
||||
|
||||
public void setRoot(int x, int y, int width, int height) {
|
||||
if(stack.size() > 0) throw new IllegalStateException("A Root can't be set if the Stack is already in use or the root is already set");
|
||||
withRoot = true;
|
||||
stack.push(Vec4i.of(x, y, x + width, y + height));
|
||||
handler.enable();
|
||||
handler.apply(x, y, width, height);
|
||||
}
|
||||
|
||||
public void push(int x, int y, int width, int height) {
|
||||
if(stack.size() >= limit) {
|
||||
//TODO implement logging
|
||||
return;
|
||||
}
|
||||
if(stack.isEmpty()) {
|
||||
stack.push(Vec4i.of(x, y, x + width, y + height));
|
||||
handler.enable();
|
||||
handler.apply(x, y, width, height);
|
||||
return;
|
||||
}
|
||||
Vec4i top = stack.top();
|
||||
Vec4i result = Vec4i.of(Math.max(x, top.x()), Math.max(y, top.y()), Math.min(x + width, top.z()), Math.min(y + height, top.w()));
|
||||
stack.push(result);
|
||||
handler.apply(result.x(), result.y(), result.z() - result.x(), result.w() - result.y());
|
||||
}
|
||||
|
||||
public Vec4i top() {
|
||||
return stack.isEmpty() ? Vec4i.MINUS_ONE : stack.top();
|
||||
}
|
||||
|
||||
public boolean contains(int x, int y, int width, int height) {
|
||||
return stack.isEmpty() || contains(stack.top(), x, y, width, height);
|
||||
}
|
||||
|
||||
protected boolean contains(Vec4i top, int x, int y, int width, int height) {
|
||||
return x >= top.x() && y >= top.y() && x + width < top.z() && y + height < top.w();
|
||||
}
|
||||
|
||||
public void pop() {
|
||||
if(stack.size() <= (withRoot ? 1 : 0)) {
|
||||
//TODO implement logging
|
||||
return;
|
||||
}
|
||||
stack.pop();
|
||||
if(stack.isEmpty()) {
|
||||
handler.disable();
|
||||
return;
|
||||
}
|
||||
Vec4i result = stack.top();
|
||||
handler.apply(result.x(), result.y(), result.z() - result.x(), result.w() - result.y());
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
stack.clear();
|
||||
withRoot = false;
|
||||
handler.disable();
|
||||
}
|
||||
|
||||
public static interface IScissorsHandler {
|
||||
public void enable();
|
||||
public void disable();
|
||||
public void apply(int x, int y, int width, int height);
|
||||
}
|
||||
|
||||
public static class NoOp implements IScissorsHandler {
|
||||
public static final IScissorsHandler INSTANCE = new NoOp();
|
||||
@Override
|
||||
public void enable() {}
|
||||
@Override
|
||||
public void disable() {}
|
||||
@Override
|
||||
public void apply(int x, int y, int width, int height) {}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package speiger.src.coreengine.graphics.api.vertex;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import speiger.src.collections.ints.lists.IntArrayList;
|
||||
import speiger.src.collections.ints.lists.IntList;
|
||||
import speiger.src.collections.objects.collections.ObjectIterable;
|
||||
import speiger.src.collections.objects.collections.ObjectIterator;
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.collections.objects.lists.ObjectList;
|
||||
import speiger.src.collections.objects.maps.interfaces.Object2ObjectMap;
|
||||
import speiger.src.collections.objects.utils.ObjectIterators;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.GraphicsDataType;
|
||||
import speiger.src.coreengine.graphics.api.vertex.VertexLayout.Element;
|
||||
|
||||
public class VertexLayout implements ObjectIterable<Element> {
|
||||
Object2ObjectMap<String, Element> mapped = Object2ObjectMap.builder().linkedMap();
|
||||
ObjectList<Element> elements = new ObjectArrayList<>();
|
||||
IntList offsets = new IntArrayList();
|
||||
int stride;
|
||||
int bytes;
|
||||
|
||||
private VertexLayout() {}
|
||||
|
||||
public static Builder builder() {
|
||||
return new Builder(new VertexLayout());
|
||||
}
|
||||
|
||||
public int stride() { return stride; }
|
||||
public int bytes() { return bytes; }
|
||||
public boolean isEmpty() { return elements.isEmpty(); }
|
||||
public int size() { return elements.size(); }
|
||||
public int offset(int index) { return offsets.getInt(index); }
|
||||
public Element get(int index) { return elements.get(index); }
|
||||
public boolean contains(String key) { return mapped.containsKey(key); }
|
||||
public ObjectList<Element> elements() { return elements.unmodifiable(); }
|
||||
@Override
|
||||
public ObjectIterator<Element> iterator() { return ObjectIterators.unmodifiable(elements.iterator()); }
|
||||
|
||||
private void add(Element element) {
|
||||
if(mapped.put(element.name(), element) != null) throw new IllegalStateException("Duplicated Names are not allowed");
|
||||
elements.add(element);
|
||||
offsets.add(bytes);
|
||||
int size = element.size();
|
||||
stride += size;
|
||||
bytes += element.type().size(size);
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
VertexLayout format;
|
||||
|
||||
private Builder(VertexLayout format) {
|
||||
this.format = format;
|
||||
}
|
||||
|
||||
public Builder element(String name, int index, int size, Usage usage) {
|
||||
return element(name, index, size, usage, GraphicsDataType.FLOAT, false);
|
||||
}
|
||||
|
||||
public Builder element(String name, int index, int size, Usage usage, GraphicsDataType type) {
|
||||
return element(name, index, size, usage, type, false);
|
||||
}
|
||||
|
||||
public Builder element(String name, int index, int size, Usage usage, GraphicsDataType type, boolean normalized) {
|
||||
format.add(new Element(name, index, size, usage, type, normalized));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder array(String baseName, int startIndex, int width, int size, Usage usage, GraphicsDataType type) {
|
||||
return array(baseName, startIndex, width, size, usage, type, false);
|
||||
}
|
||||
|
||||
public Builder array(String baseName, int startIndex, int width, int size, Usage usage, GraphicsDataType type, boolean normalized) {
|
||||
Objects.requireNonNull(baseName);
|
||||
for(int i = 0;i<width;i++) {
|
||||
element(baseName+" ["+i+"]", startIndex + i, size, usage, type, normalized);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public VertexLayout build() {
|
||||
return format;
|
||||
}
|
||||
}
|
||||
|
||||
public record Element(String name, int index, int size, Usage usage, GraphicsDataType type, boolean normalized) {}
|
||||
|
||||
public enum Usage {
|
||||
POS, UV, COLOR, NORMAL, MATRIX, CUSTOM;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package speiger.src.coreengine.graphics.opengl.buffer;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.jspecify.annotations.NonNull;
|
||||
import org.lwjgl.opengl.GL15;
|
||||
import org.lwjgl.opengl.GL45;
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
|
||||
import speiger.src.collections.ints.misc.pairs.IntObjectPair;
|
||||
import speiger.src.coreengine.graphics.api.buffer.VertexBuffer;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.BufferState;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.BufferType;
|
||||
import speiger.src.coreengine.graphics.api.utils.BufferOwner;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLUtils;
|
||||
import speiger.src.coreengine.rendering.utils.AllocationTracker;
|
||||
import speiger.src.coreengine.utils.io.GameLog;
|
||||
|
||||
public class GLVertexBuffer extends VertexBuffer {
|
||||
int id;
|
||||
public GLVertexBuffer(BufferType type, BufferState usage) {
|
||||
super(type, usage);
|
||||
id = GL45.glCreateBuffers();
|
||||
}
|
||||
|
||||
public GLVertexBuffer(BufferType type, BufferState usage, int totalBytes) {
|
||||
super(type, usage);
|
||||
id = GL45.glCreateBuffers();
|
||||
bind().allocate(totalBytes).unbind();
|
||||
}
|
||||
|
||||
public int id() {
|
||||
if(id == 0) throw new IllegalStateException("Buffer is already removed");
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemoved() {
|
||||
return id == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
if(id == 0) return;
|
||||
GL15.glDeleteBuffers(id);
|
||||
id = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLVertexBuffer bind() {
|
||||
GL15.glBindBuffer(GLUtils.toGL(type), id);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLVertexBuffer unbind() {
|
||||
GL15.glBindBuffer(GLUtils.toGL(type), 0);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLVertexBuffer allocate(int totalBytes) {
|
||||
this.size = totalBytes;
|
||||
GL45.glNamedBufferData(id, totalBytes, GLUtils.toGL(usage));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLVertexBuffer set(long pointer, int totalBytes, BufferOwner ownership) {
|
||||
this.size = totalBytes;
|
||||
GL45.nglNamedBufferData(id, totalBytes, pointer, GLUtils.toGL(usage));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLVertexBuffer fill(long pointer, int totalBytes, int offset, BufferOwner ownerhip) {
|
||||
GL45.nglNamedBufferSubData(id, offset, totalBytes, pointer);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLVertexBuffer read(long pointer, int totalBytes, int offset, @NonNull Runnable completion) {
|
||||
Objects.requireNonNull(completion, "Completion has to be required otherwise you can't see when the data is there");
|
||||
GL45.nglGetNamedBufferSubData(id, offset, totalBytes, pointer);
|
||||
completion.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLVertexBuffer fill(int offset, List<IntObjectPair<byte[]>> data) {
|
||||
if(data.size() > 0) {
|
||||
ByteBuffer buffer = GL45.glMapNamedBuffer(id, GL15.GL_WRITE_ONLY);
|
||||
for(int i = 0,m = data.size();i < m;i++) {
|
||||
IntObjectPair<byte[]> entry = data.get(i);
|
||||
buffer.position(entry.getIntKey() + offset);
|
||||
buffer.put(entry.getValue());
|
||||
}
|
||||
buffer.flip();
|
||||
if(!GL45.glUnmapNamedBuffer(id)) GameLog.info("Memory Corruption?");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLVertexBuffer shrink(int newSize) {
|
||||
if(size <= newSize) throw new IllegalArgumentException("New Size ["+newSize+"] is bigger then the buffer ["+size+"]");
|
||||
ByteBuffer buffer = GL45.glMapNamedBuffer(id, GL15.GL_READ_WRITE);
|
||||
if(size != buffer.remaining()) throw new IllegalStateException("Grow Function found inconsisten data: Found=["+buffer.remaining()+"], Expected=["+size+"]");
|
||||
ByteBuffer newBuff = MemoryUtil.memAlloc(newSize);
|
||||
MemoryUtil.memCopy(MemoryUtil.memAddress(buffer), MemoryUtil.memAddress(newBuff), newSize);
|
||||
newBuff.position(newSize).flip();
|
||||
GL45.glUnmapNamedBuffer(id);
|
||||
return set(MemoryUtil.memAddress(newBuff), newSize, BufferOwner.GIVEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLVertexBuffer grow(int newSize) {
|
||||
if(size >= newSize) throw new IllegalArgumentException("New Size ["+newSize+"] is smaller then the buffer ["+size+"]");
|
||||
ByteBuffer buffer = GL45.glMapNamedBuffer(id, GL15.GL_READ_ONLY);
|
||||
if(size != buffer.remaining()) throw new IllegalStateException("Grow Function found inconsisten data: Found=["+buffer.remaining()+"], Expected=["+size+"]");
|
||||
ByteBuffer newBuff = MemoryUtil.memAlloc(newSize);
|
||||
MemoryUtil.memCopy(MemoryUtil.memAddress(buffer), MemoryUtil.memAddress(newBuff), size);
|
||||
newBuff.position(newSize).flip();
|
||||
GL45.glUnmapNamedBuffer(id);
|
||||
return set(MemoryUtil.memAddress(newBuff), newSize, BufferOwner.GIVEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLVertexBuffer shift(int source, int dest, int length) {
|
||||
if(source < 0 || source + length >= size) throw new ArrayIndexOutOfBoundsException();
|
||||
if(dest < 0 || dest + length >= size) throw new ArrayIndexOutOfBoundsException();
|
||||
GL45.glCopyNamedBufferSubData(id, id, source, dest, length);
|
||||
AllocationTracker.INSTANCE.addGPUBytes(length*2);
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
package speiger.src.coreengine.graphics.opengl.core;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Deque;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL30;
|
||||
import org.lwjgl.opengl.GL32;
|
||||
import org.lwjgl.opengl.GL45;
|
||||
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
import speiger.src.coreengine.graphics.api.core.CommandBuffer;
|
||||
import speiger.src.coreengine.graphics.api.core.GraphicsCommandQueue;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.GraphicsDataType;
|
||||
import speiger.src.coreengine.graphics.api.target.RenderTarget;
|
||||
import speiger.src.coreengine.graphics.api.target.ScreenTarget;
|
||||
import speiger.src.coreengine.graphics.api.target.TextureTarget;
|
||||
import speiger.src.coreengine.graphics.api.texture.Texture;
|
||||
import speiger.src.coreengine.graphics.api.texture.states.TextureFormat;
|
||||
import speiger.src.coreengine.graphics.api.utils.PushableResource;
|
||||
import speiger.src.coreengine.graphics.opengl.texture.FrameBufferCache;
|
||||
import speiger.src.coreengine.graphics.opengl.texture.GLTexture;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLStates;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLUtils;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.ViewPortStack;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.states.ScissorState;
|
||||
import speiger.src.coreengine.input.window.Window;
|
||||
import speiger.src.coreengine.math.vector.floats.Vec4f;
|
||||
import speiger.src.coreengine.math.vector.ints.Vec4i;
|
||||
|
||||
public class GLCommandQueue implements GraphicsCommandQueue {
|
||||
GLGraphicsDevice device;
|
||||
FrameBufferCache fboCache = new FrameBufferCache();
|
||||
RenderTarget renderTarget = ScreenTarget.INSTANCE;
|
||||
ScreenBuffer targetFBO;
|
||||
int tempWriteFBO;
|
||||
Deque<Frame> frames = new ArrayDeque<>(4);
|
||||
long currentFrame = 0L;
|
||||
Vec4f clearColor = Vec4f.mutable(0F, 0F, 0F, 1F);
|
||||
double clearDepth = 0D;
|
||||
|
||||
public GLCommandQueue(GLGraphicsDevice device) {
|
||||
this.device = device;
|
||||
this.targetFBO = new ScreenBuffer(0, device.window().width(), device.window().height());
|
||||
tempWriteFBO = GL45.glCreateFramebuffers();
|
||||
frames.add(new Frame(-2));
|
||||
frames.add(new Frame(-1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PushableResource putClearColor(Vec4f color) {
|
||||
return new PushableObject<>(clearColor.copyAsImmutable(), setClearColor(color), () -> clearColor, this::setClearColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PushableResource putClearDepth(double value) {
|
||||
return new PushableObject<>(clearDepth, setClearDepth(value), () -> clearDepth, this::setClearDepth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PushableResource putRenderTarget(RenderTarget target) {
|
||||
return new PushableObject<>(renderTarget, setRenderTarget(target), () -> renderTarget, this::setRenderTarget);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PushableResource pushViewPort(int x, int y, int width, int height) {
|
||||
ViewPortStack stack = device.states.viewPort;
|
||||
Vec4i top = stack.top();
|
||||
Vec4i bounds = Vec4i.of(x, y, height, width);
|
||||
stack.push(x, y, width, height);
|
||||
return new PushableObject<>(top, bounds, stack::top, _ -> stack.pop());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void submitCommands(CommandBuffer buffer) {
|
||||
if(buffer instanceof GLRecordingCommandBuffer recorder) {
|
||||
recorder.execute();
|
||||
}
|
||||
else if(buffer instanceof GLRecordingComputeCommandBuffer recorder) {
|
||||
recorder.execute();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long currentFrame() {
|
||||
return currentFrame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void submitFrame() {
|
||||
frames.getFirst().fenceIn();
|
||||
currentFrame++;
|
||||
frames.add(new Frame(currentFrame));
|
||||
if(!frames.pop().isCompleted(Long.MAX_VALUE)) {
|
||||
throw new IllegalStateException("Couldn't complete frames");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLFence createFence() {
|
||||
return new GLFence(frames.getFirst());
|
||||
}
|
||||
|
||||
private Vec4f setClearColor(Vec4f value) {
|
||||
if(clearColor.equals(value)) return value;
|
||||
clearColor.set(value);
|
||||
GL11.glClearColor(value.x(), value.y(), value.y(), value.w());
|
||||
return value;
|
||||
}
|
||||
|
||||
private double setClearDepth(double value) {
|
||||
if(Double.compare(clearDepth, value) == 0) return value;
|
||||
clearDepth = value;
|
||||
GL11.glClearDepth(value);
|
||||
return value;
|
||||
}
|
||||
|
||||
private RenderTarget setRenderTarget(RenderTarget target) {
|
||||
if(this.renderTarget.equals(target)) return target;
|
||||
this.renderTarget = target;
|
||||
targetFBO = switch(target) {
|
||||
case ScreenTarget _ -> {
|
||||
Window window = device.window();
|
||||
yield new ScreenBuffer(0, window.width(), window.height());
|
||||
}
|
||||
case TextureTarget(ID id, Texture color, Texture depth) -> {
|
||||
int fbo = fboCache.getOrCreateFBO(id);
|
||||
if(color != null) {
|
||||
GL45.glNamedFramebufferTexture(fbo, GL30.GL_COLOR_ATTACHMENT0, ((GLTexture)color).id(), 0);
|
||||
yield new ScreenBuffer(fbo, color.width(), color.height());
|
||||
}
|
||||
if(depth != null) {
|
||||
GL45.glNamedFramebufferTexture(fbo, GL30.GL_DEPTH_ATTACHMENT, ((GLTexture)depth).id(), 0);
|
||||
yield new ScreenBuffer(fbo, depth.width(), depth.height());
|
||||
}
|
||||
throw new IllegalArgumentException("No Color or Depth Provided");
|
||||
}
|
||||
};
|
||||
GL30.glBindFramebuffer(GL30.GL_DRAW_FRAMEBUFFER, targetFBO.fbo());
|
||||
GL11.glViewport(0, 0, targetFBO.width(), targetFBO.height());
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearTexture(int clearParam) {
|
||||
GL11.glClear(((clearParam & CLEAR_COLOR) != 0 ? GL11.GL_COLOR_BUFFER_BIT : 0) | ((clearParam & CLEAR_DEPTH) != 0 ? GL11.GL_DEPTH_BUFFER_BIT : 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearTexture(int x, int y, int width, int height, int clearParam) {
|
||||
ScissorState state = device.states.scissors;
|
||||
state.backup();
|
||||
try(PushableResource _ = pushViewPort(0, 0, targetFBO.width(), targetFBO.height())) {
|
||||
state.set(Vec4i.of(x, y, x + width, y + height));
|
||||
clearTexture(clearParam);
|
||||
}
|
||||
state.restore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearTexture(Texture texture, int clearParam) {
|
||||
if((clearParam & CLEAR_BOTH) == CLEAR_BOTH) {
|
||||
//TODO implement Logging
|
||||
return;
|
||||
}
|
||||
GL30.glBindFramebuffer(GL30.GL_DRAW_FRAMEBUFFER, tempWriteFBO);
|
||||
GL45.glNamedFramebufferTexture(tempWriteFBO, GL30.GL_COLOR_ATTACHMENT0, ((GLTexture)texture).id(), 0);
|
||||
clearTexture(clearParam);
|
||||
GL45.glNamedFramebufferTexture(tempWriteFBO, GL30.GL_COLOR_ATTACHMENT0, 0, 0);
|
||||
GL30.glBindFramebuffer(GL30.GL_DRAW_FRAMEBUFFER, targetFBO.fbo());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearTexture(Texture texture, int x, int y, int width, int height, int clearParam) {
|
||||
ScissorState state = device.states.scissors;
|
||||
state.backup();
|
||||
try(PushableResource _ = pushViewPort(x, y, texture.width(), texture.height())) {
|
||||
state.set(Vec4i.of(x, y, x + width, y + height));
|
||||
clearTexture(texture, clearParam);
|
||||
}
|
||||
state.restore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToTexture(Texture target, TextureFormat format, GraphicsDataType dataType, long source) {
|
||||
GL45.glTextureSubImage2D(((GLTexture)target).id(), 0, 0, 0, target.width(), target.height(), GLUtils.toGLExternal(format), GLUtils.toGL(dataType), source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToTexture(Texture target, int level, int sourceX, int sourceY, int targetX, int targetY, int width, int height, TextureFormat format, GraphicsDataType dataType, long source) {
|
||||
GLStates states = device.states;
|
||||
states.unpack_alignment.set(target.settings().internal().components());
|
||||
states.unpack_row_length.set(target.width());
|
||||
states.unpack_skip_pixel.set(sourceX);
|
||||
states.unpack_skip_rows.set(sourceY);
|
||||
GL45.glTextureSubImage2D(((GLTexture)target).id(), level, targetX, targetY, width, height, GLUtils.toGLExternal(format), GLUtils.toGL(dataType), source);
|
||||
states.unpack_alignment.setDefault();
|
||||
states.unpack_row_length.setDefault();
|
||||
states.unpack_skip_pixel.setDefault();
|
||||
states.unpack_skip_rows.setDefault();
|
||||
}
|
||||
|
||||
private record PushableObject<T>(T original, T applying, Supplier<T> current, Consumer<T> apply) implements PushableResource {
|
||||
@Override
|
||||
public void close() {
|
||||
if(current.get().equals(applying)) {
|
||||
apply.accept(original);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private record ScreenBuffer(int fbo, int width, int height) {}
|
||||
public class Frame {
|
||||
final long frame;
|
||||
boolean hasBegun;
|
||||
long fenceId;
|
||||
|
||||
public Frame(long frame) {
|
||||
this.frame = frame;
|
||||
hasBegun = frame < 0;
|
||||
}
|
||||
|
||||
public void fenceIn() {
|
||||
hasBegun = true;
|
||||
fenceId = GL32.glFenceSync(GL32.GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
}
|
||||
|
||||
public boolean isCompleted(long timeout) {
|
||||
if(!hasBegun) {
|
||||
if(timeout == 0) return false;
|
||||
throw new IllegalStateException("Can't wait on something you are supposed to submit to");
|
||||
}
|
||||
if(fenceId == 0) return true;
|
||||
int result = GL32.glClientWaitSync(fenceId, GL32.GL_SYNC_FLUSH_COMMANDS_BIT, timeout);
|
||||
if(result == GL32.GL_TIMEOUT_EXPIRED) return false;
|
||||
if(result == GL32.GL_WAIT_FAILED) throw new IllegalStateException("Waiting has failed?");
|
||||
GL32.glDeleteSync(fenceId);
|
||||
fenceId = 0L;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package speiger.src.coreengine.graphics.opengl.core;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.core.GraphicsFence;
|
||||
import speiger.src.coreengine.graphics.opengl.core.GLCommandQueue.Frame;
|
||||
|
||||
public class GLFence implements GraphicsFence {
|
||||
boolean removed = false;
|
||||
Frame frame;
|
||||
|
||||
public GLFence(Frame frame) {
|
||||
this.frame = frame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemoved() {
|
||||
return removed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
removed = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean awaitCompletion(long timeout) {
|
||||
return removed || frame.isCompleted(timeout);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package speiger.src.coreengine.graphics.opengl.core;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.lwjgl.opengl.GL;
|
||||
|
||||
import speiger.src.coreengine.assets.manager.AssetManager;
|
||||
import speiger.src.coreengine.graphics.api.core.Graphics;
|
||||
import speiger.src.coreengine.input.window.Window;
|
||||
|
||||
public class GLGraphics implements Graphics {
|
||||
AssetManager manager;
|
||||
|
||||
public GLGraphics(AssetManager manager) {
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "OpenGL";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupWindowArguments() {
|
||||
GLFW.glfwDefaultWindowHints();
|
||||
GLFW.glfwWindowHint(GLFW.GLFW_VISIBLE, GLFW.GLFW_FALSE);
|
||||
|
||||
GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR, 4);
|
||||
GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_PROFILE, GLFW.GLFW_OPENGL_CORE_PROFILE);
|
||||
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_FORWARD_COMPAT, GLFW.GLFW_TRUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLGraphicsDevice createDevice(Window window) {
|
||||
return new GLGraphicsDevice(window, manager, GL.createCapabilities());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,378 @@
|
||||
package speiger.src.coreengine.graphics.opengl.core;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.OptionalInt;
|
||||
import java.util.function.IntPredicate;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
import org.lwjgl.opengl.GL20;
|
||||
import org.lwjgl.opengl.GL31;
|
||||
import org.lwjgl.opengl.GL33;
|
||||
import org.lwjgl.opengl.GL41;
|
||||
import org.lwjgl.opengl.GL43;
|
||||
import org.lwjgl.opengl.GL45;
|
||||
import org.lwjgl.opengl.GL46;
|
||||
import org.lwjgl.opengl.GLCapabilities;
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
|
||||
import speiger.src.collections.ints.lists.IntArrayList;
|
||||
import speiger.src.collections.ints.lists.IntList;
|
||||
import speiger.src.collections.ints.maps.impl.hash.Int2ObjectLinkedOpenHashMap;
|
||||
import speiger.src.collections.ints.maps.impl.hash.Int2ObjectOpenHashMap;
|
||||
import speiger.src.collections.ints.maps.interfaces.Int2ObjectMap;
|
||||
import speiger.src.collections.objects.maps.impl.hash.Object2IntOpenHashMap;
|
||||
import speiger.src.collections.objects.maps.impl.hash.Object2ObjectOpenHashMap;
|
||||
import speiger.src.collections.objects.maps.interfaces.Object2IntMap;
|
||||
import speiger.src.collections.objects.maps.interfaces.Object2ObjectMap;
|
||||
import speiger.src.collections.objects.utils.ObjectIterables;
|
||||
import speiger.src.coreengine.assets.api.IAsset;
|
||||
import speiger.src.coreengine.assets.api.IAssetProvider;
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
import speiger.src.coreengine.assets.api.MultiAsset;
|
||||
import speiger.src.coreengine.assets.manager.AssetManager;
|
||||
import speiger.src.coreengine.graphics.api.buffer.VertexBuffer;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.BufferState;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.BufferType;
|
||||
import speiger.src.coreengine.graphics.api.compute.ComputePipeline;
|
||||
import speiger.src.coreengine.graphics.api.core.GraphicsCommandBuffer;
|
||||
import speiger.src.coreengine.graphics.api.core.GraphicsDevice;
|
||||
import speiger.src.coreengine.graphics.api.core.TimeQueryPool;
|
||||
import speiger.src.coreengine.graphics.api.mesh.Mesh;
|
||||
import speiger.src.coreengine.graphics.api.mesh.Mesh.LayoutInfo;
|
||||
import speiger.src.coreengine.graphics.api.sampler.SamplerSettings;
|
||||
import speiger.src.coreengine.graphics.api.shader.ShaderPipeline;
|
||||
import speiger.src.coreengine.graphics.api.shader.VertexBinding;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.Bindings.BufferBinding;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.Bindings.BufferMode;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.Bindings.TextureBinding;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.Bindings.TextureMode;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.ShaderType;
|
||||
import speiger.src.coreengine.graphics.api.texture.TextureSettings;
|
||||
import speiger.src.coreengine.graphics.api.texture.states.SwizzleMask;
|
||||
import speiger.src.coreengine.graphics.api.texture.states.TextureType;
|
||||
import speiger.src.coreengine.graphics.api.utils.ExecutionType;
|
||||
import speiger.src.coreengine.graphics.api.vertex.VertexLayout.Element;
|
||||
import speiger.src.coreengine.graphics.opengl.buffer.GLVertexBuffer;
|
||||
import speiger.src.coreengine.graphics.opengl.mesh.GLMesh;
|
||||
import speiger.src.coreengine.graphics.opengl.sampler.GLSampler;
|
||||
import speiger.src.coreengine.graphics.opengl.shader.ShaderCache;
|
||||
import speiger.src.coreengine.graphics.opengl.shader.ShaderInstance;
|
||||
import speiger.src.coreengine.graphics.opengl.shader.ShaderInstance.BufferObject;
|
||||
import speiger.src.coreengine.graphics.opengl.shader.ShaderInstance.ShaderStorage;
|
||||
import speiger.src.coreengine.graphics.opengl.shader.ShaderInstance.TextureObject;
|
||||
import speiger.src.coreengine.graphics.opengl.texture.GLTexture;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLFunctions;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLStates;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLUtils;
|
||||
import speiger.src.coreengine.input.window.Window;
|
||||
|
||||
public class GLGraphicsDevice implements GraphicsDevice {
|
||||
static final Map<ID, String> IMPORTS = Object2ObjectMap.builder().<ID, String>map().synchronize();
|
||||
Object2IntMap<ID> shaderCache = new Object2IntOpenHashMap<>();
|
||||
Object2ObjectMap<ID, ShaderInstance> programCache = new Object2ObjectOpenHashMap<>();
|
||||
AssetManager manager;
|
||||
GLCapabilities capabilities;
|
||||
GLStates states = new GLStates();
|
||||
ShaderCache cache = new ShaderCache();
|
||||
GLCommandQueue queue;
|
||||
Window owner;
|
||||
|
||||
public GLGraphicsDevice(Window owner, AssetManager manager, GLCapabilities capbilities) {
|
||||
this.owner = owner;
|
||||
this.manager = manager;
|
||||
this.capabilities = capbilities;
|
||||
this.queue = new GLCommandQueue(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Window window() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLSurface createSurface() {
|
||||
return new GLSurface(owner, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer createCommandBuffer(ExecutionType type) {
|
||||
return type == ExecutionType.IMMEDIATE ? new GLImmidateCommandBuffer(this) : new GLRecordingCommandBuffer(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLCommandQueue queue() {
|
||||
return queue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLVertexBuffer createBuffer(BufferType type, BufferState state) {
|
||||
return new GLVertexBuffer(Objects.requireNonNull(type), Objects.requireNonNull(state));
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLVertexBuffer createBuffer(BufferType type, BufferState state, int allocatedBytes) {
|
||||
if(allocatedBytes <= 0) throw new IllegalArgumentException("Allocated bytes are invalid");
|
||||
return new GLVertexBuffer(Objects.requireNonNull(type), Objects.requireNonNull(state), allocatedBytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLTexture createTexture(TextureSettings settings, int width, int height) {
|
||||
if(width < 0) throw new IllegalArgumentException("Width ["+width+"] is invalid");
|
||||
if(height < 0) throw new IllegalArgumentException("Height ["+height+"] is invalid");
|
||||
if(settings.type() != TextureType.TEXTURE_2D) throw new IllegalStateException("Currently only 2D textures are supported");
|
||||
int id = GLFunctions.createTexture(settings.type());
|
||||
settings.stencilType().ifPresent(T -> GL45.glTextureParameteri(id, GL43.GL_DEPTH_STENCIL_TEXTURE_MODE, GLUtils.toGL(T)));
|
||||
settings.baseLevel().ifPresent(T -> GL45.glTextureParameteri(id, GL12.GL_TEXTURE_BASE_LEVEL, T));
|
||||
settings.maxLevel().ifPresent(T -> GL45.glTextureParameteri(id, GL12.GL_TEXTURE_MAX_LEVEL, T));
|
||||
if(settings.hasSwizzle()) {
|
||||
List<Optional<SwizzleMask>> masks = settings.swizzle();
|
||||
GL45.glTextureParameterIiv(id, GL33.GL_TEXTURE_SWIZZLE_RGBA, new int[] {
|
||||
GLUtils.toGL(masks.get(0).orElse(SwizzleMask.RED)),
|
||||
GLUtils.toGL(masks.get(1).orElse(SwizzleMask.GREEN)),
|
||||
GLUtils.toGL(masks.get(2).orElse(SwizzleMask.BLUE)),
|
||||
GLUtils.toGL(masks.get(3).orElse(SwizzleMask.ALPHA)),
|
||||
});
|
||||
}
|
||||
GL45.glTextureStorage2D(id, 1, GLUtils.toGLInternal(settings.internal()), width, height);
|
||||
return new GLTexture(settings, id, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLSampler createSampler(SamplerSettings settings) {
|
||||
return new GLSampler(Objects.requireNonNull(settings));
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLMesh createMesh(Mesh.Builder builder) {
|
||||
builder.validate();
|
||||
if(builder.isAutogenerated()) {
|
||||
Int2ObjectMap<LayoutInfo> info = builder.info();
|
||||
OptionalInt preAllocation = builder.preAllocated();
|
||||
Int2ObjectMap<VertexBuffer> buffers = new Int2ObjectLinkedOpenHashMap<>();
|
||||
for(Int2ObjectMap.Entry<LayoutInfo> entry : info.int2ObjectEntrySet()) {
|
||||
int key = entry.getIntKey();
|
||||
buffers.put(key, preAllocation.isPresent() ? createBuffer(BufferType.ARRAY_BUFFER, builder.getState(key), preAllocation.getAsInt()) : createBuffer(BufferType.ARRAY_BUFFER, builder.getState(key)));
|
||||
}
|
||||
return new GLMesh(info, buffers, createBuffer(BufferType.ELEMENT_BUFFER, builder.getState(-1)), builder.indecies(), true);
|
||||
}
|
||||
return new GLMesh(builder.info(), new Int2ObjectOpenHashMap<>(), null, null, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TimeQueryPool createQueryPool(int size) {
|
||||
return new GLTimeQueryPool(size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preloadPipelines(List<ShaderPipeline> graphics, List<ComputePipeline> compute) {
|
||||
try(IAssetProvider provider = manager.get()) {
|
||||
for(ShaderPipeline pipeline : graphics) {
|
||||
programCache.put(pipeline.id(), computeShaderProgram(pipeline, provider));
|
||||
}
|
||||
for(ComputePipeline pipeline : compute) {
|
||||
programCache.put(pipeline.id(), computeShaderProgram(pipeline, provider));
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public ShaderInstance getShader(ShaderPipeline pipeline) {
|
||||
return programCache.supplyIfAbsent(pipeline.id(), () -> computeShaderProgram(pipeline));
|
||||
}
|
||||
|
||||
private ShaderInstance computeShaderProgram(ShaderPipeline pipeline) {
|
||||
try(IAssetProvider provider = manager.get()) {
|
||||
return computeShaderProgram(pipeline, provider);
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public ShaderInstance getShader(ComputePipeline pipeline) {
|
||||
return programCache.supplyIfAbsent(pipeline.id(), () -> computeShaderProgram(pipeline));
|
||||
}
|
||||
|
||||
private ShaderInstance computeShaderProgram(ComputePipeline pipeline) {
|
||||
try(IAssetProvider provider = manager.get()) {
|
||||
return computeShaderProgram(pipeline, provider);
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ShaderInstance computeShaderProgram(ComputePipeline pipeline, IAssetProvider provider) {
|
||||
MultiAsset assets = MultiAsset.combineNonNull(provider, pipeline.shader());
|
||||
if(assets == null) {
|
||||
//TODO log stuff
|
||||
return null;
|
||||
}
|
||||
|
||||
int program = loadOrCreateProgram(pipeline.id(), assets::crc, T -> {
|
||||
int id = shaderCache.computeIfAbsent(pipeline.shader(), E -> computeShader(E, assets.get(0), ShaderType.COMPUTE, provider));
|
||||
if(id == -1) {
|
||||
System.out.println("Couldn't create a compute shader Id["+pipeline.shader()+"]");
|
||||
//TODO implement logging.
|
||||
//Failed to compile shader
|
||||
return false;
|
||||
}
|
||||
GL20.glAttachShader(T, id);
|
||||
GL20.glLinkProgram(T);
|
||||
GL20.glDetachShader(T, id);
|
||||
return true;
|
||||
});
|
||||
if(program == 0) return null;
|
||||
return generateShaderInstance(program, pipeline::textures, pipeline::uniforms);
|
||||
}
|
||||
|
||||
private ShaderInstance computeShaderProgram(ShaderPipeline pipeline, IAssetProvider provider) {
|
||||
MultiAsset assets = MultiAsset.combineNonNull(provider, pipeline.shaders().values().toArray(ID[]::new));
|
||||
if(assets == null) {
|
||||
//TODO log stuff
|
||||
return null;
|
||||
}
|
||||
int program = loadOrCreateProgram(pipeline.id(), assets::crc, T -> {
|
||||
Map<ID, IAsset> map = Object2ObjectMap.builder().map();
|
||||
assets.forEach(map, (K, V) -> K.put(V.location(), V));
|
||||
IntList shaders = new IntArrayList();
|
||||
for(Entry<ShaderType, ID> entry : pipeline.shaders().entrySet()) {
|
||||
ShaderType type = entry.getKey();
|
||||
IAsset asset = map.get(entry.getValue());
|
||||
int id = shaderCache.computeIfAbsent(entry.getValue(), E -> computeShader(E, asset, type, provider));
|
||||
if(id == -1) {
|
||||
System.out.println("Couldn't create a shader. Type["+type+"], of Id["+asset.location()+"]");
|
||||
//TODO implement logging.
|
||||
//Failed to compile shader
|
||||
return false;
|
||||
}
|
||||
GL20.glAttachShader(T, id);
|
||||
shaders.add(id);
|
||||
}
|
||||
for(Element element : ObjectIterables.flatMap(pipeline.attributes(), VertexBinding::elements)) {
|
||||
GL20.glBindAttribLocation(T, element.index(), element.name());
|
||||
}
|
||||
GL20.glLinkProgram(T);
|
||||
for(int i = 0,m=shaders.size();i<m;i++) {
|
||||
GL20.glDetachShader(T, shaders.getInt(i));
|
||||
}
|
||||
return true;
|
||||
});
|
||||
if(program == 0) return null;
|
||||
return generateShaderInstance(program, pipeline::textures, pipeline::uniforms);
|
||||
}
|
||||
|
||||
private ShaderInstance generateShaderInstance(int program, Supplier<List<TextureBinding>> textureProvider, Supplier<List<BufferBinding>> uniformProvider) {
|
||||
ShaderStorage<BufferObject> uniforms = new ShaderStorage<>();
|
||||
ShaderStorage<BufferObject> storages = new ShaderStorage<>();
|
||||
ShaderStorage<TextureObject> samplers = new ShaderStorage<>();
|
||||
ShaderStorage<TextureObject> buffers = new ShaderStorage<>();
|
||||
for(TextureBinding binding : textureProvider.get()) {
|
||||
int location = GL20.glGetUniformLocation(program, binding.name());
|
||||
if(location == -1) {
|
||||
System.out.println("Couldn't find Location ["+binding.name()+"] in Program ["+program+"]");
|
||||
//TODO Warn that location wasn't found
|
||||
continue;
|
||||
}
|
||||
(binding.mode() == TextureMode.SAMPLER ? samplers : buffers).add(binding.name(), binding.slot(), new TextureObject(binding.slot()));
|
||||
}
|
||||
for(BufferBinding binding : uniformProvider.get()) {
|
||||
int location = GL31.glGetUniformBlockIndex(program, binding.name());
|
||||
if(location == GL31.GL_INVALID_INDEX) {
|
||||
System.out.println("Couldn't find Location ["+binding.name()+"] in Program ["+program+"]");
|
||||
//TODO Warn that location wasn't found
|
||||
continue;
|
||||
}
|
||||
GL31.glUniformBlockBinding(program, location, binding.slot());
|
||||
(binding.mode() == BufferMode.UNIFORM ? uniforms : storages).add(binding.name(), binding.slot(), new BufferObject(binding.slot()));
|
||||
}
|
||||
return new ShaderInstance(program, uniforms, storages, samplers, buffers);
|
||||
}
|
||||
|
||||
private int computeShader(ID id, IAsset asset, ShaderType type, IAssetProvider provider) {
|
||||
StringBuilder builder = new StringBuilder(2048);
|
||||
try {
|
||||
for(String line : asset.lines()) {
|
||||
if(line.startsWith("//")) continue;
|
||||
if(line.startsWith("#import<") && line.endsWith(">")) builder.append(importLines(provider, ID.of(line.substring(8, line.length()-1))));
|
||||
else builder.append(line);
|
||||
builder.append("\n");
|
||||
};
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
int shader = GL20.glCreateShader(GLUtils.toGL(type));
|
||||
GL20.glShaderSource(shader, builder);
|
||||
GL20.glCompileShader(shader);
|
||||
if(GL20.glGetShaderi(shader, GL20.GL_COMPILE_STATUS) == 0) {
|
||||
//TODO improve logging
|
||||
System.out.println(GL20.glGetShaderInfoLog(shader, GL20.glGetShaderi(shader, GL20.GL_INFO_LOG_LENGTH)));
|
||||
GL20.glDeleteShader(shader);
|
||||
return -1;
|
||||
}
|
||||
return shader;
|
||||
}
|
||||
|
||||
private int loadOrCreateProgram(ID pipeline, Supplier<String> crc, IntPredicate callback) {
|
||||
int id = GL20.glCreateProgram();
|
||||
boolean fail = true;
|
||||
if((fail = !loadFromCache(id, pipeline, crc) && callback.test(id))) {
|
||||
if(GL20.glGetProgrami(id, GL20.GL_LINK_STATUS) == GL11.GL_TRUE) {
|
||||
cache.store(pipeline, crc.get(), getProgramBytes(id));
|
||||
fail = false;
|
||||
}
|
||||
}
|
||||
if(fail) {
|
||||
GL20.glDeleteProgram(id);
|
||||
return 0;
|
||||
}
|
||||
String error = GL20.glGetProgramInfoLog(id);
|
||||
if(!error.isBlank()) {
|
||||
System.out.println("Error: "+error);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
private byte[] getProgramBytes(int programId) {
|
||||
ByteBuffer buffer = MemoryUtil.memAlloc(GL20.glGetProgrami(programId, GL41.GL_PROGRAM_BINARY_LENGTH) + 4);
|
||||
int[] format = new int[1];
|
||||
GL41.glGetProgramBinary(programId, null, format, buffer.position(4));
|
||||
buffer.putInt(0, format[0]).flip();
|
||||
byte[] data = new byte[buffer.remaining()];
|
||||
buffer.get(data);
|
||||
MemoryUtil.memFree(buffer);
|
||||
return data;
|
||||
}
|
||||
|
||||
private boolean loadFromCache(int programId, ID pipeline, Supplier<String> crc) {
|
||||
ByteBuffer data = cache.get(pipeline, crc);
|
||||
if(data == null) return false;
|
||||
GL41.glProgramBinary(programId, data.getInt(), data);
|
||||
MemoryUtil.memFree(data);
|
||||
return GL46.glGetProgrami(programId, GL46.GL_LINK_STATUS) == GL46.GL_TRUE;
|
||||
}
|
||||
|
||||
public static String importLines(IAssetProvider provider, ID location) {
|
||||
return IMPORTS.computeIfAbsent(location, T -> {
|
||||
try { return ObjectIterables.filter(provider.get(T).lines(), E -> !E.startsWith("//")).reduce(new StringBuilder(), (K, V) -> K.append(V).append("\n")).toString(); }
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
+243
@@ -0,0 +1,243 @@
|
||||
package speiger.src.coreengine.graphics.opengl.core;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL30;
|
||||
import org.lwjgl.opengl.GL31;
|
||||
import org.lwjgl.opengl.GL43;
|
||||
import org.lwjgl.opengl.GL45;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.buffer.VertexBuffer;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.BufferType;
|
||||
import speiger.src.coreengine.graphics.api.core.GraphicsCommandBuffer;
|
||||
import speiger.src.coreengine.graphics.api.mesh.Mesh;
|
||||
import speiger.src.coreengine.graphics.api.sampler.Sampler;
|
||||
import speiger.src.coreengine.graphics.api.shader.ColorTarget;
|
||||
import speiger.src.coreengine.graphics.api.shader.DepthTarget;
|
||||
import speiger.src.coreengine.graphics.api.shader.RasterizerState;
|
||||
import speiger.src.coreengine.graphics.api.shader.ShaderPipeline;
|
||||
import speiger.src.coreengine.graphics.api.texture.Texture;
|
||||
import speiger.src.coreengine.graphics.api.utils.AccessType;
|
||||
import speiger.src.coreengine.graphics.api.utils.ScissorsManager;
|
||||
import speiger.src.coreengine.graphics.opengl.buffer.GLVertexBuffer;
|
||||
import speiger.src.coreengine.graphics.opengl.mesh.GLMesh;
|
||||
import speiger.src.coreengine.graphics.opengl.sampler.GLSampler;
|
||||
import speiger.src.coreengine.graphics.opengl.shader.ShaderInstance;
|
||||
import speiger.src.coreengine.graphics.opengl.texture.GLTexture;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLScissorsHandler;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLStates;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLUtils;
|
||||
|
||||
public class GLImmidateCommandBuffer implements GraphicsCommandBuffer {
|
||||
GLGraphicsDevice device;
|
||||
boolean removed = false;
|
||||
boolean recording = false;
|
||||
int recorded = 0;
|
||||
|
||||
ScissorsManager scissors;
|
||||
ShaderPipeline pipeline;
|
||||
ShaderInstance shader;
|
||||
GLMesh mesh;
|
||||
|
||||
public GLImmidateCommandBuffer(GLGraphicsDevice device) {
|
||||
this.device = device;
|
||||
this.scissors = new ScissorsManager(8, new GLScissorsHandler(device.states));
|
||||
}
|
||||
|
||||
protected void ensureDrawing() {
|
||||
if(removed) throw new IllegalStateException("CommandBuffer is removed");
|
||||
if(!recording) throw new IllegalStateException("CommandBuffer isn't recording");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemoved() { return removed; }
|
||||
@Override
|
||||
public void remove() {
|
||||
clear();
|
||||
device = null;
|
||||
removed = true;
|
||||
recorded = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer begin() {
|
||||
if(removed) throw new IllegalStateException("CommandBuffer is removed");
|
||||
if(recording) throw new IllegalStateException("CommandBuffer already recording");
|
||||
recording = true;
|
||||
recorded = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer setScissors(int x, int y, int width, int height) {
|
||||
ensureDrawing();
|
||||
scissors.setRoot(x, y, width, height);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer pipeline(ShaderPipeline pipeline) {
|
||||
Objects.requireNonNull(pipeline);
|
||||
ensureDrawing();
|
||||
if(this.pipeline == pipeline) return this;
|
||||
this.pipeline = pipeline;
|
||||
shader = device.getShader(pipeline);
|
||||
if(shader == null) {
|
||||
//TODO implement logging
|
||||
return this;
|
||||
}
|
||||
GLStates states = device.states;
|
||||
states.shaders.bind(shader);
|
||||
RasterizerState rasterization = pipeline.rasterizer();
|
||||
states.polygon.set(rasterization.fillMode());
|
||||
states.backCulling.set(rasterization.cullBack());
|
||||
DepthTarget depth = pipeline.depthTarget();
|
||||
if(depth.enabled()) {
|
||||
states.depth.enable();
|
||||
states.setDepthMask(depth.write());
|
||||
states.setDepthFunction(depth.function());
|
||||
}
|
||||
else states.depth.disable();
|
||||
ColorTarget color = pipeline.colorTarget();
|
||||
color.blend().ifPresentOrElse(states.blend::enableSet, states.blend::disable);
|
||||
states.setColorMask(color.writeMask());
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer mesh(Mesh mesh) {
|
||||
Objects.requireNonNull(mesh);
|
||||
ensureDrawing();
|
||||
if(this.mesh == mesh) return this;
|
||||
this.mesh = (GLMesh)mesh;
|
||||
GL30.glBindVertexArray(this.mesh.id());
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer texture(int binding, Texture texture, Sampler sampler) {
|
||||
Objects.requireNonNull(texture);
|
||||
Objects.requireNonNull(sampler);
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.samplers().byIndex(binding), "Texture["+binding+"] binding not found");
|
||||
GLStates states = device.states;
|
||||
states.textures.bind(binding, ((GLTexture)texture).id());
|
||||
states.samplers.bind(binding, ((GLSampler)sampler).id());
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer texture(int binding, Texture texture, AccessType access) {
|
||||
Objects.requireNonNull(texture);
|
||||
Objects.requireNonNull(access);
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.buffers().byIndex(binding), "Texture["+binding+"] binding not found");
|
||||
GL45.glBindImageTexture(0, binding, ((GLTexture)texture).id(), false, 0, GLUtils.toGL(access), GLUtils.toGLInternal(texture.settings().internal()));
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer uniform(int binding, VertexBuffer buffer) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.UNIFORM_BUFFER) throw new IllegalStateException("Buffer isn't a Uniform Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.uniforms().byIndex(binding), "Uniform for binding ["+binding+"] doesn't exist");
|
||||
GL30.glBindBufferBase(GL31.GL_UNIFORM_BUFFER, binding, ((GLVertexBuffer)buffer).id());
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer uniform(int binding, VertexBuffer buffer, long offset, long size) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.UNIFORM_BUFFER) throw new IllegalStateException("Buffer isn't a Uniform Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.uniforms().byIndex(binding), "Uniform for binding ["+binding+"] doesn't exist");
|
||||
GL30.glBindBufferRange(GL31.GL_UNIFORM_BUFFER, binding, ((GLVertexBuffer)buffer).id(), offset, size);
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer storage(int binding, VertexBuffer buffer) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.SHADER_STORAGE_BUFFER) throw new IllegalStateException("Buffer isn't a Shader Storage Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.storages().byIndex(binding), "Shader Storage for binding ["+binding+"] doesn't exist");
|
||||
GL30.glBindBufferBase(GL43.GL_SHADER_STORAGE_BUFFER, binding, ((GLVertexBuffer)buffer).id());
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer storage(int binding, VertexBuffer buffer, long offset, long size) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.SHADER_STORAGE_BUFFER) throw new IllegalStateException("Buffer isn't a Shader Storage Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.storages().byIndex(binding), "Shader Storage for binding ["+binding+"] doesn't exist");
|
||||
GL30.glBindBufferRange(GL43.GL_SHADER_STORAGE_BUFFER, binding, ((GLVertexBuffer)buffer).id(), offset, size);
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer drawArrays(int offset, int count) {
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
GL11.glDrawArrays(GLUtils.toGL(pipeline.rasterizer().mode()), offset, count);
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer drawElements(int offset, int count) {
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
GL11.nglDrawElements(GLUtils.toGL(pipeline.rasterizer().mode()), count, GLUtils.toGL(mesh.indeciesType()), offset);
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer pushScissors(int x, int y, int width, int height) {
|
||||
ensureDrawing();
|
||||
scissors.push(x, y, width, height);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer popScissors() {
|
||||
ensureDrawing();
|
||||
scissors.pop();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer end() {
|
||||
if(!recording) throw new IllegalStateException("Already Stopped Recording");
|
||||
clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
private void clear() {
|
||||
recording = false;
|
||||
pipeline = null;
|
||||
shader = null;
|
||||
mesh = null;
|
||||
scissors.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int commandCount() { return recorded; }
|
||||
}
|
||||
+192
@@ -0,0 +1,192 @@
|
||||
package speiger.src.coreengine.graphics.opengl.core;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.lwjgl.opengl.GL30;
|
||||
import org.lwjgl.opengl.GL31;
|
||||
import org.lwjgl.opengl.GL42;
|
||||
import org.lwjgl.opengl.GL43;
|
||||
import org.lwjgl.opengl.GL45;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.buffer.VertexBuffer;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.BufferType;
|
||||
import speiger.src.coreengine.graphics.api.compute.BarrierType;
|
||||
import speiger.src.coreengine.graphics.api.compute.ComputePipeline;
|
||||
import speiger.src.coreengine.graphics.api.core.ComputeCommandBuffer;
|
||||
import speiger.src.coreengine.graphics.api.sampler.Sampler;
|
||||
import speiger.src.coreengine.graphics.api.texture.Texture;
|
||||
import speiger.src.coreengine.graphics.api.utils.AccessType;
|
||||
import speiger.src.coreengine.graphics.opengl.buffer.GLVertexBuffer;
|
||||
import speiger.src.coreengine.graphics.opengl.sampler.GLSampler;
|
||||
import speiger.src.coreengine.graphics.opengl.shader.ShaderInstance;
|
||||
import speiger.src.coreengine.graphics.opengl.texture.GLTexture;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLStates;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLUtils;
|
||||
|
||||
public class GLImmidateComputeCommandBuffer implements ComputeCommandBuffer {
|
||||
GLGraphicsDevice device;
|
||||
int recorded = 0;
|
||||
boolean recording = false;
|
||||
boolean removed = false;
|
||||
|
||||
ComputePipeline pipeline;
|
||||
ShaderInstance shader;
|
||||
|
||||
public GLImmidateComputeCommandBuffer(GLGraphicsDevice device) {
|
||||
this.device = device;
|
||||
}
|
||||
|
||||
protected void ensureDrawing() {
|
||||
if(removed) throw new IllegalStateException("CommandBuffer is removed");
|
||||
if(!recording) throw new IllegalStateException("CommandBuffer isn't recording");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemoved() { return removed; }
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
clear();
|
||||
device = null;
|
||||
removed = true;
|
||||
recorded = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer begin() {
|
||||
if(removed) throw new IllegalStateException("CommandBuffer is removed");
|
||||
if(recording) throw new IllegalStateException("CommandBuffer already recording");
|
||||
recording = true;
|
||||
recorded = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer pipeline(ComputePipeline pipeline) {
|
||||
Objects.requireNonNull(pipeline);
|
||||
ensureDrawing();
|
||||
if(this.pipeline == pipeline) return this;
|
||||
this.pipeline = pipeline;
|
||||
shader = device.getShader(pipeline);
|
||||
if(shader == null) {
|
||||
//TODO implement logging
|
||||
return this;
|
||||
}
|
||||
GLStates states = device.states;
|
||||
states.shaders.bind(shader);
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer texture(int binding, Texture texture, Sampler sampler) {
|
||||
Objects.requireNonNull(texture);
|
||||
Objects.requireNonNull(sampler);
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.samplers().byIndex(binding), "Texture["+binding+"] binding not found");
|
||||
GLStates states = device.states;
|
||||
states.textures.bind(binding, ((GLTexture)texture).id());
|
||||
states.samplers.bind(binding, ((GLSampler)sampler).id());
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer texture(int binding, Texture texture, AccessType access) {
|
||||
Objects.requireNonNull(texture);
|
||||
Objects.requireNonNull(access);
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.buffers().byIndex(binding), "Texture["+binding+"] binding not found");
|
||||
GL45.glBindImageTexture(0, binding, ((GLTexture)texture).id(), false, 0, GLUtils.toGL(access), GLUtils.toGLInternal(texture.settings().internal()));
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer uniform(int binding, VertexBuffer buffer) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.UNIFORM_BUFFER) throw new IllegalStateException("Buffer isn't a Uniform Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.uniforms().byIndex(binding), "Uniform for binding ["+binding+"] doesn't exist");
|
||||
GL30.glBindBufferBase(GL31.GL_UNIFORM_BUFFER, binding, ((GLVertexBuffer)buffer).id());
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer uniform(int binding, VertexBuffer buffer, long offset, long size) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.UNIFORM_BUFFER) throw new IllegalStateException("Buffer isn't a Uniform Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.uniforms().byIndex(binding), "Uniform for binding ["+binding+"] doesn't exist");
|
||||
GL30.glBindBufferRange(GL31.GL_UNIFORM_BUFFER, binding, ((GLVertexBuffer)buffer).id(), offset, size);
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer storage(int binding, VertexBuffer buffer) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.SHADER_STORAGE_BUFFER) throw new IllegalStateException("Buffer isn't a Shader Storage Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.storages().byIndex(binding), "Shader Storage for binding ["+binding+"] doesn't exist");
|
||||
GL30.glBindBufferBase(GL43.GL_SHADER_STORAGE_BUFFER, binding, ((GLVertexBuffer)buffer).id());
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer storage(int binding, VertexBuffer buffer, long offset, long size) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.SHADER_STORAGE_BUFFER) throw new IllegalStateException("Buffer isn't a Shader Storage Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.storages().byIndex(binding), "Shader Storage for binding ["+binding+"] doesn't exist");
|
||||
GL30.glBindBufferRange(GL43.GL_SHADER_STORAGE_BUFFER, binding, ((GLVertexBuffer)buffer).id(), offset, size);
|
||||
recorded++;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer dispatch(int numGroupsX, int numGroupsY, int numGroupsZ) {
|
||||
Objects.requireNonNull(shader);
|
||||
if(numGroupsX < 1) throw new IllegalArgumentException("X has to be 1 or more");
|
||||
if(numGroupsY < 1) throw new IllegalArgumentException("Y has to be 1 or more");
|
||||
if(numGroupsZ < 1) throw new IllegalArgumentException("Z has to be 1 or more");
|
||||
GL45.glDispatchCompute(numGroupsX, numGroupsY, numGroupsZ);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer barrier(BarrierType... types) {
|
||||
int result = 0;
|
||||
for(BarrierType type : types) {
|
||||
result |= GLUtils.toGL(type);
|
||||
}
|
||||
GL42.glMemoryBarrier(result);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer end() {
|
||||
clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
private void clear() {
|
||||
recording = false;
|
||||
pipeline = null;
|
||||
shader = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int commandCount() {
|
||||
return recorded;
|
||||
}
|
||||
|
||||
}
|
||||
+289
@@ -0,0 +1,289 @@
|
||||
package speiger.src.coreengine.graphics.opengl.core;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL30;
|
||||
import org.lwjgl.opengl.GL31;
|
||||
import org.lwjgl.opengl.GL43;
|
||||
import org.lwjgl.opengl.GL45;
|
||||
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.coreengine.graphics.api.buffer.VertexBuffer;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.BufferType;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.IndeciesType;
|
||||
import speiger.src.coreengine.graphics.api.core.GraphicsCommandBuffer;
|
||||
import speiger.src.coreengine.graphics.api.mesh.Mesh;
|
||||
import speiger.src.coreengine.graphics.api.sampler.Sampler;
|
||||
import speiger.src.coreengine.graphics.api.shader.ColorTarget;
|
||||
import speiger.src.coreengine.graphics.api.shader.DepthTarget;
|
||||
import speiger.src.coreengine.graphics.api.shader.RasterizerState;
|
||||
import speiger.src.coreengine.graphics.api.shader.ShaderPipeline;
|
||||
import speiger.src.coreengine.graphics.api.shader.states.DrawMode;
|
||||
import speiger.src.coreengine.graphics.api.texture.Texture;
|
||||
import speiger.src.coreengine.graphics.api.utils.AccessType;
|
||||
import speiger.src.coreengine.graphics.api.utils.ScissorsManager;
|
||||
import speiger.src.coreengine.graphics.api.utils.ScissorsManager.NoOp;
|
||||
import speiger.src.coreengine.graphics.opengl.buffer.GLVertexBuffer;
|
||||
import speiger.src.coreengine.graphics.opengl.mesh.GLMesh;
|
||||
import speiger.src.coreengine.graphics.opengl.sampler.GLSampler;
|
||||
import speiger.src.coreengine.graphics.opengl.shader.ShaderInstance;
|
||||
import speiger.src.coreengine.graphics.opengl.texture.GLTexture;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLStates;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLUtils;
|
||||
import speiger.src.coreengine.math.vector.ints.Vec4i;
|
||||
|
||||
public class GLRecordingCommandBuffer implements GraphicsCommandBuffer {
|
||||
List<Runnable> tasks = new ObjectArrayList<>();
|
||||
boolean recording = false;
|
||||
boolean removed = false;
|
||||
GLGraphicsDevice device;
|
||||
|
||||
ScissorsManager scissors = new ScissorsManager(8, NoOp.INSTANCE);
|
||||
ShaderPipeline pipeline;
|
||||
ShaderInstance shader;
|
||||
GLMesh mesh;
|
||||
|
||||
|
||||
public GLRecordingCommandBuffer(GLGraphicsDevice device) {
|
||||
this.device = device;
|
||||
}
|
||||
|
||||
protected void ensureDrawing() {
|
||||
if(removed) throw new IllegalStateException("CommandBuffer is removed");
|
||||
if(!recording) throw new IllegalStateException("CommandBuffer isn't recording");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemoved() {
|
||||
return removed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
removed = true;
|
||||
clear();
|
||||
recording = false;
|
||||
tasks.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer begin() {
|
||||
if(removed) throw new IllegalStateException("CommandBuffer is removed");
|
||||
if(recording) throw new IllegalStateException("CommandBuffer already recording");
|
||||
recording = true;
|
||||
tasks.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer setScissors(int x, int y, int width, int height) {
|
||||
ensureDrawing();
|
||||
scissors.setRoot(x, y, width, height);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer pipeline(ShaderPipeline pipeline) {
|
||||
Objects.requireNonNull(pipeline);
|
||||
ensureDrawing();
|
||||
if(this.pipeline == pipeline) return this;
|
||||
this.pipeline = pipeline;
|
||||
shader = device.getShader(pipeline);
|
||||
if(shader == null) {
|
||||
//TODO implement logging
|
||||
return this;
|
||||
}
|
||||
tasks.add(new SetPipeline(pipeline, shader, device.states));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer mesh(Mesh mesh) {
|
||||
Objects.requireNonNull(mesh);
|
||||
ensureDrawing();
|
||||
if(this.mesh == mesh) return this;
|
||||
this.mesh = (GLMesh)mesh;
|
||||
this.tasks.add(new SetMesh(this.mesh));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer texture(int binding, Texture texture, Sampler sampler) {
|
||||
Objects.requireNonNull(texture);
|
||||
Objects.requireNonNull(sampler);
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.samplers().byIndex(binding), "Texture["+binding+"] binding not found");
|
||||
tasks.add(new SetTexture(binding, (GLTexture)texture, (GLSampler)sampler, device.states));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer texture(int binding, Texture texture, AccessType access) {
|
||||
Objects.requireNonNull(texture);
|
||||
Objects.requireNonNull(access);
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.buffers().byIndex(binding), "Texture["+binding+"] binding not found");
|
||||
tasks.add(new SetImageStorage(binding, (GLTexture)texture, access));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer uniform(int binding, VertexBuffer buffer) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.UNIFORM_BUFFER) throw new IllegalStateException("Buffer isn't a Uniform Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.uniforms().byIndex(binding), "Uniform for binding ["+binding+"] doesn't exist");
|
||||
tasks.add(new SetUniform(binding, (GLVertexBuffer)buffer, -1, -1, false));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer uniform(int binding, VertexBuffer buffer, long offset, long size) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.UNIFORM_BUFFER) throw new IllegalStateException("Buffer isn't a Uniform Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.uniforms().byIndex(binding), "Uniform for binding ["+binding+"] doesn't exist");
|
||||
tasks.add(new SetUniform(binding, (GLVertexBuffer)buffer, offset, size, false));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer storage(int binding, VertexBuffer buffer) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.SHADER_STORAGE_BUFFER) throw new IllegalStateException("Buffer isn't a Shader Storage Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.storages().byIndex(binding), "Shader Storage for binding ["+binding+"] doesn't exist");
|
||||
tasks.add(new SetUniform(binding, (GLVertexBuffer)buffer, -1, -1, true));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer storage(int binding, VertexBuffer buffer, long offset, long size) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.SHADER_STORAGE_BUFFER) throw new IllegalStateException("Buffer isn't a Shader Storage Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.storages().byIndex(binding), "Shader Storage for binding ["+binding+"] doesn't exist");
|
||||
tasks.add(new SetUniform(binding, (GLVertexBuffer)buffer, offset, size, true));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer drawArrays(int offset, int count) {
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
DrawMode mode = pipeline.rasterizer().mode();
|
||||
tasks.add(() -> GL11.glDrawArrays(GLUtils.toGL(mode), offset, count));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer drawElements(int offset, int count) {
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
DrawMode mode = pipeline.rasterizer().mode();
|
||||
IndeciesType type = mesh.indeciesType();
|
||||
tasks.add(() -> GL11.nglDrawElements(GLUtils.toGL(mode), count, GLUtils.toGL(type), offset));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer pushScissors(int x, int y, int width, int height) {
|
||||
ensureDrawing();
|
||||
scissors.push(x, y, width, height);
|
||||
tasks.add(new SetScissors(scissors.top(), device.states));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer popScissors() {
|
||||
ensureDrawing();
|
||||
scissors.pop();
|
||||
tasks.add(new SetScissors(scissors.top(), device.states));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsCommandBuffer end() {
|
||||
if(!recording) throw new IllegalStateException("Already Stopped Recording");
|
||||
clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int commandCount() {
|
||||
return tasks.size();
|
||||
}
|
||||
|
||||
public void execute() {
|
||||
tasks.forEach(Runnable::run);
|
||||
}
|
||||
|
||||
private void clear() {
|
||||
recording = false;
|
||||
pipeline = null;
|
||||
shader = null;
|
||||
mesh = null;
|
||||
scissors.clear();
|
||||
}
|
||||
|
||||
public record SetScissors(Vec4i area, GLStates states) implements Runnable {
|
||||
@Override
|
||||
public void run() { states.scissors.set(area); }
|
||||
}
|
||||
|
||||
public record SetPipeline(ShaderPipeline pipeline, ShaderInstance instance, GLStates states) implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
states.shaders.bind(instance);
|
||||
RasterizerState rasterization = pipeline.rasterizer();
|
||||
states.polygon.set(rasterization.fillMode());
|
||||
states.backCulling.set(rasterization.cullBack());
|
||||
DepthTarget depth = pipeline.depthTarget();
|
||||
if(depth.enabled()) {
|
||||
states.depth.enable();
|
||||
states.setDepthMask(depth.write());
|
||||
states.setDepthFunction(depth.function());
|
||||
}
|
||||
else states.depth.disable();
|
||||
ColorTarget color = pipeline.colorTarget();
|
||||
color.blend().ifPresentOrElse(states.blend::enableSet, states.blend::disable);
|
||||
states.setColorMask(color.writeMask());
|
||||
}
|
||||
}
|
||||
|
||||
public record SetMesh(GLMesh mesh) implements Runnable {
|
||||
@Override
|
||||
public void run() { GL30.glBindVertexArray(mesh.id()); }
|
||||
}
|
||||
|
||||
public record SetTexture(int binding, GLTexture texture, GLSampler sampler, GLStates states) implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
states.textures.bind(binding, texture.id());
|
||||
states.samplers.bind(binding, sampler.id());
|
||||
}
|
||||
}
|
||||
|
||||
public record SetImageStorage(int binding, GLTexture texture, AccessType type) implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
GL45.glBindImageTexture(0, binding, texture.id(), false, 0, GLUtils.toGL(type), GLUtils.toGLInternal(texture.settings().internal()));
|
||||
}
|
||||
}
|
||||
|
||||
public record SetUniform(int binding, GLVertexBuffer buffer, long offset, long size, boolean shader) implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
if(size < 0 || offset < 0) GL30.glBindBufferBase(shader ? GL43.GL_SHADER_STORAGE_BUFFER : GL31.GL_UNIFORM_BUFFER, binding, buffer.id());
|
||||
else GL30.glBindBufferRange(shader ? GL43.GL_SHADER_STORAGE_BUFFER : GL31.GL_UNIFORM_BUFFER, binding, buffer.id(), offset, size);
|
||||
}
|
||||
}
|
||||
}
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
package speiger.src.coreengine.graphics.opengl.core;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.lwjgl.opengl.GL30;
|
||||
import org.lwjgl.opengl.GL31;
|
||||
import org.lwjgl.opengl.GL42;
|
||||
import org.lwjgl.opengl.GL43;
|
||||
import org.lwjgl.opengl.GL45;
|
||||
|
||||
import speiger.src.collections.objects.lists.ObjectArrayList;
|
||||
import speiger.src.coreengine.graphics.api.buffer.VertexBuffer;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.BufferType;
|
||||
import speiger.src.coreengine.graphics.api.compute.BarrierType;
|
||||
import speiger.src.coreengine.graphics.api.compute.ComputePipeline;
|
||||
import speiger.src.coreengine.graphics.api.core.ComputeCommandBuffer;
|
||||
import speiger.src.coreengine.graphics.api.sampler.Sampler;
|
||||
import speiger.src.coreengine.graphics.api.texture.Texture;
|
||||
import speiger.src.coreengine.graphics.api.utils.AccessType;
|
||||
import speiger.src.coreengine.graphics.opengl.buffer.GLVertexBuffer;
|
||||
import speiger.src.coreengine.graphics.opengl.sampler.GLSampler;
|
||||
import speiger.src.coreengine.graphics.opengl.shader.ShaderInstance;
|
||||
import speiger.src.coreengine.graphics.opengl.texture.GLTexture;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLStates;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLUtils;
|
||||
|
||||
public class GLRecordingComputeCommandBuffer implements ComputeCommandBuffer {
|
||||
List<Runnable> tasks = new ObjectArrayList<>();
|
||||
boolean recording = false;
|
||||
boolean removed = false;
|
||||
GLGraphicsDevice device;
|
||||
|
||||
ComputePipeline pipeline;
|
||||
ShaderInstance shader;
|
||||
|
||||
public GLRecordingComputeCommandBuffer(GLGraphicsDevice device) {
|
||||
this.device = device;
|
||||
}
|
||||
|
||||
protected void ensureDrawing() {
|
||||
if(removed) throw new IllegalStateException("CommandBuffer is removed");
|
||||
if(!recording) throw new IllegalStateException("CommandBuffer isn't recording");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemoved() {
|
||||
return removed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
removed = true;
|
||||
clear();
|
||||
recording = false;
|
||||
tasks.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int commandCount() {
|
||||
return tasks.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer begin() {
|
||||
if(removed) throw new IllegalStateException("CommandBuffer is removed");
|
||||
if(recording) throw new IllegalStateException("CommandBuffer already recording");
|
||||
recording = true;
|
||||
tasks.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer pipeline(ComputePipeline pipeline) {
|
||||
Objects.requireNonNull(pipeline);
|
||||
ensureDrawing();
|
||||
if(this.pipeline == pipeline) return this;
|
||||
this.pipeline = pipeline;
|
||||
shader = device.getShader(pipeline);
|
||||
if(shader == null) {
|
||||
//TODO implement logging
|
||||
return this;
|
||||
}
|
||||
tasks.add(new SetPipeline(shader, device.states));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer texture(int binding, Texture texture, Sampler sampler) {
|
||||
Objects.requireNonNull(texture);
|
||||
Objects.requireNonNull(sampler);
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.samplers().byIndex(binding), "Texture["+binding+"] binding not found");
|
||||
tasks.add(new SetTexture(binding, (GLTexture)texture, (GLSampler)sampler, device.states));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer texture(int binding, Texture texture, AccessType access) {
|
||||
Objects.requireNonNull(texture);
|
||||
Objects.requireNonNull(access);
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.buffers().byIndex(binding), "Texture["+binding+"] binding not found");
|
||||
tasks.add(new SetImageStorage(binding, (GLTexture)texture, access));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer uniform(int binding, VertexBuffer buffer) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.UNIFORM_BUFFER) throw new IllegalStateException("Buffer isn't a Uniform Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.uniforms().byIndex(binding), "Uniform for binding ["+binding+"] doesn't exist");
|
||||
tasks.add(new SetUniform(binding, (GLVertexBuffer)buffer, -1, -1, false));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer uniform(int binding, VertexBuffer buffer, long offset, long size) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.UNIFORM_BUFFER) throw new IllegalStateException("Buffer isn't a Uniform Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.uniforms().byIndex(binding), "Uniform for binding ["+binding+"] doesn't exist");
|
||||
tasks.add(new SetUniform(binding, (GLVertexBuffer)buffer, offset, size, false));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer storage(int binding, VertexBuffer buffer) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.SHADER_STORAGE_BUFFER) throw new IllegalStateException("Buffer isn't a Shader Storage Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.storages().byIndex(binding), "Shader Storage for binding ["+binding+"] doesn't exist");
|
||||
tasks.add(new SetUniform(binding, (GLVertexBuffer)buffer, -1, -1, true));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer storage(int binding, VertexBuffer buffer, long offset, long size) {
|
||||
Objects.requireNonNull(buffer);
|
||||
if(buffer.type() != BufferType.SHADER_STORAGE_BUFFER) throw new IllegalStateException("Buffer isn't a Shader Storage Buffer");
|
||||
ensureDrawing();
|
||||
Objects.requireNonNull(shader, "No Pipeline found");
|
||||
Objects.requireNonNull(shader.storages().byIndex(binding), "Shader Storage for binding ["+binding+"] doesn't exist");
|
||||
tasks.add(new SetUniform(binding, (GLVertexBuffer)buffer, offset, size, true));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer dispatch(int numGroupsX, int numGroupsY, int numGroupsZ) {
|
||||
Objects.requireNonNull(shader);
|
||||
if(numGroupsX < 1) throw new IllegalArgumentException("X has to be 1 or more");
|
||||
if(numGroupsY < 1) throw new IllegalArgumentException("Y has to be 1 or more");
|
||||
if(numGroupsZ < 1) throw new IllegalArgumentException("Z has to be 1 or more");
|
||||
tasks.add(() -> GL45.glDispatchCompute(numGroupsX, numGroupsY, numGroupsZ));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer barrier(BarrierType... types) {
|
||||
int result = 0;
|
||||
for(BarrierType type : types) {
|
||||
result |= GLUtils.toGL(type);
|
||||
}
|
||||
tasks.add(new SetBarrier(result));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputeCommandBuffer end() {
|
||||
if(!recording) throw new IllegalStateException("Already Stopped Recording");
|
||||
clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
public void execute() {
|
||||
tasks.forEach(Runnable::run);
|
||||
}
|
||||
|
||||
private void clear() {
|
||||
recording = false;
|
||||
pipeline = null;
|
||||
shader = null;
|
||||
}
|
||||
|
||||
public record SetPipeline(ShaderInstance instance, GLStates states) implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
states.shaders.bind(instance);
|
||||
}
|
||||
}
|
||||
|
||||
public record SetTexture(int binding, GLTexture texture, GLSampler sampler, GLStates states) implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
states.textures.bind(binding, texture.id());
|
||||
states.samplers.bind(binding, sampler.id());
|
||||
}
|
||||
}
|
||||
|
||||
public record SetImageStorage(int binding, GLTexture texture, AccessType type) implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
GL45.glBindImageTexture(0, binding, texture.id(), false, 0, GLUtils.toGL(type), GLUtils.toGLInternal(texture.settings().internal()));
|
||||
}
|
||||
}
|
||||
|
||||
public record SetUniform(int binding, GLVertexBuffer buffer, long offset, long size, boolean shader) implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
if(size < 0 || offset < 0) GL30.glBindBufferBase(shader ? GL43.GL_SHADER_STORAGE_BUFFER : GL31.GL_UNIFORM_BUFFER, binding, buffer.id());
|
||||
else GL30.glBindBufferRange(shader ? GL43.GL_SHADER_STORAGE_BUFFER : GL31.GL_UNIFORM_BUFFER, binding, buffer.id(), offset, size);
|
||||
}
|
||||
}
|
||||
|
||||
public record SetBarrier(int barrierBits) implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
GL42.glMemoryBarrier(barrierBits);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package speiger.src.coreengine.graphics.opengl.core;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.lwjgl.opengl.GL;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.core.GraphicsSurface;
|
||||
import speiger.src.coreengine.input.window.Window;
|
||||
|
||||
public class GLSurface implements GraphicsSurface {
|
||||
GLGraphicsDevice device;
|
||||
Window window;
|
||||
|
||||
public GLSurface(Window window, GLGraphicsDevice device) {
|
||||
this.window = window;
|
||||
this.device = device;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVsync(boolean value) {
|
||||
window.vsync(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginFrame() {
|
||||
GL11.glClearColor(0.2F, 0.55F, 0.66F, 1F);
|
||||
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
|
||||
window.beginFrame();
|
||||
GL.setCapabilities(device.capabilities);
|
||||
if(window.isPrimaryWindow()) window.manager().joinOnWindowThread(GLFW::glfwPollEvents);
|
||||
Thread.onSpinWait();
|
||||
window.handleInput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishFrame() {
|
||||
window.finishFrame();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package speiger.src.coreengine.graphics.opengl.core;
|
||||
|
||||
import java.util.OptionalLong;
|
||||
|
||||
import org.lwjgl.opengl.GL15;
|
||||
import org.lwjgl.opengl.GL33;
|
||||
import org.lwjgl.opengl.GL45;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.core.TimeQueryPool;
|
||||
|
||||
public class GLTimeQueryPool implements TimeQueryPool {
|
||||
boolean removed = false;
|
||||
int[] queries;
|
||||
|
||||
public GLTimeQueryPool(int size) {
|
||||
this.queries = new int[size];
|
||||
GL45.glCreateQueries(GL33.GL_TIMESTAMP, queries);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemoved() {
|
||||
return removed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
if(removed) return;
|
||||
GL15.glDeleteQueries(queries);
|
||||
removed = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return queries.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(int index) {
|
||||
GL33.glQueryCounter(queries[index], GL33.GL_TIMESTAMP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OptionalLong get(int index) {
|
||||
if(GL15.glGetQueryObjectui(queries[index], GL15.GL_QUERY_RESULT_AVAILABLE) == 1) {
|
||||
return OptionalLong.of(GL33.glGetQueryObjectui64(queries[index], GL15.GL_QUERY_RESULT));
|
||||
}
|
||||
return OptionalLong.empty();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package speiger.src.coreengine.graphics.opengl.mesh;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import org.lwjgl.opengl.GL45;
|
||||
|
||||
import speiger.src.collections.ints.collections.IntIterator;
|
||||
import speiger.src.collections.ints.maps.interfaces.Int2ObjectMap;
|
||||
import speiger.src.coreengine.graphics.api.buffer.VertexBuffer;
|
||||
import speiger.src.coreengine.graphics.api.buffer.states.IndeciesType;
|
||||
import speiger.src.coreengine.graphics.api.mesh.Mesh;
|
||||
import speiger.src.coreengine.graphics.api.vertex.VertexLayout;
|
||||
import speiger.src.coreengine.graphics.api.vertex.VertexLayout.Element;
|
||||
import speiger.src.coreengine.graphics.opengl.buffer.GLVertexBuffer;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLUtils;
|
||||
|
||||
public class GLMesh extends Mesh {
|
||||
int vao;
|
||||
boolean managed;
|
||||
|
||||
public GLMesh(Int2ObjectMap<LayoutInfo> layouts, Int2ObjectMap<VertexBuffer> buffers, @Nullable VertexBuffer indeciesBuffer, @Nullable IndeciesType indeciesType, boolean managed) {
|
||||
super(layouts, buffers, indeciesBuffer, indeciesType);
|
||||
this.managed = managed;
|
||||
vao = GL45.glCreateVertexArrays();
|
||||
if(managed) {
|
||||
bindElement();
|
||||
for(IntIterator iter = layouts.keySet().iterator();iter.hasNext();) {
|
||||
bindBuffer(iter.nextInt());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int id() {
|
||||
return vao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return obj instanceof GLMesh mesh && mesh.vao == vao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemoved() { return vao == 0; }
|
||||
|
||||
@Override
|
||||
public GLMesh buffer(int binding, VertexBuffer buffer) {
|
||||
super.buffer(binding, buffer);
|
||||
bindBuffer(binding);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLMesh indexBuffer(VertexBuffer indexBuffer, IndeciesType indeciesType) {
|
||||
super.indexBuffer(indexBuffer, indeciesType);
|
||||
bindElement();
|
||||
return this;
|
||||
}
|
||||
|
||||
private void bindElement() {
|
||||
indeciesBuffer.bind();
|
||||
GL45.glVertexArrayElementBuffer(vao, ((GLVertexBuffer)indeciesBuffer).id());
|
||||
}
|
||||
|
||||
private void bindBuffer(int binding) {
|
||||
LayoutInfo info = layouts.get(binding);
|
||||
VertexLayout layout = info.layout();
|
||||
GLVertexBuffer buffer = (GLVertexBuffer)buffers.get(binding);
|
||||
buffer.bind();
|
||||
GL45.glVertexArrayVertexBuffer(vao, binding, buffer.id(), 0, layout.bytes());
|
||||
if(info.instanceCount() > 0) GL45.glVertexArrayBindingDivisor(vao, binding, info.instanceCount());
|
||||
int index = 0;
|
||||
for(Element element : layout) {
|
||||
GL45.glVertexArrayAttribFormat(vao, element.index(), element.size(), GLUtils.toGL(element.type()), element.normalized(), layout.offset(index++));
|
||||
GL45.glVertexArrayAttribBinding(vao, element.index(), binding);
|
||||
GL45.glEnableVertexArrayAttrib(vao, element.index());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
if(vao == 0) return;
|
||||
GL45.glDeleteVertexArrays(vao);
|
||||
vao = 0;
|
||||
if(!managed) return;
|
||||
if(indeciesBuffer != null) indeciesBuffer.remove();
|
||||
buffers.values().forEach(VertexBuffer::close);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void closeWithBuffers() {
|
||||
boolean wasManaged = managed;
|
||||
managed = true;
|
||||
close();
|
||||
managed = wasManaged;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package speiger.src.coreengine.graphics.opengl.sampler;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
import org.lwjgl.opengl.GL33;
|
||||
import org.lwjgl.opengl.GL45;
|
||||
|
||||
import speiger.src.coreengine.graphics.api.sampler.Sampler;
|
||||
import speiger.src.coreengine.graphics.api.sampler.SamplerSettings;
|
||||
import speiger.src.coreengine.graphics.opengl.utils.GLUtils;
|
||||
|
||||
public class GLSampler extends Sampler {
|
||||
int id;
|
||||
|
||||
public GLSampler(SamplerSettings settings) {
|
||||
super(settings);
|
||||
init();
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
this.id = GL45.glCreateSamplers();
|
||||
GL45.glSamplerParameteri(id, GL11.GL_TEXTURE_WRAP_S, GLUtils.toGL(settings.wrapS()));
|
||||
GL45.glSamplerParameteri(id, GL11.GL_TEXTURE_WRAP_T, GLUtils.toGL(settings.wrapT()));
|
||||
settings.wrapR().ifPresent(T -> GL45.glSamplerParameteri(id, GL12.GL_TEXTURE_WRAP_R, GLUtils.toGL(T)));
|
||||
GL45.glSamplerParameteri(id, GL11.GL_TEXTURE_WRAP_S, GLUtils.toGL(settings.wrapS()));
|
||||
GL45.glSamplerParameteri(id, GL11.GL_TEXTURE_MIN_FILTER, GLUtils.toGL(settings.minSample()));
|
||||
GL45.glSamplerParameteri(id, GL11.GL_TEXTURE_MAG_FILTER, GLUtils.toGL(settings.magSample()));
|
||||
}
|
||||
|
||||
public int id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemoved() {
|
||||
return id == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
if(id == 0) return;
|
||||
GL33.glDeleteSamplers(id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package speiger.src.coreengine.graphics.opengl.shader;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.internal.Streams;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
|
||||
import speiger.src.collections.objects.maps.impl.hash.Object2ObjectOpenHashMap;
|
||||
import speiger.src.coreengine.assets.api.ID;
|
||||
|
||||
public class ShaderCache {
|
||||
public static final ShaderCache INSTANCE = new ShaderCache();
|
||||
Map<ID, String> hashCache;
|
||||
Path cache;
|
||||
|
||||
public void init(Path cache) {
|
||||
this.cache = cache;
|
||||
if(Files.notExists(cache)) {
|
||||
try { Files.createDirectories(cache); }
|
||||
catch(IOException e) {
|
||||
e.printStackTrace();
|
||||
this.cache = null;
|
||||
}
|
||||
}
|
||||
try(BufferedReader reader = Files.newBufferedReader(cache.resolve("cache.json"))) {
|
||||
Map<ID, String> knownCache = new Object2ObjectOpenHashMap<>();
|
||||
for(JsonElement element : JsonParser.parseReader(reader).getAsJsonObject().getAsJsonArray("shaders")) {
|
||||
JsonObject shader = element.getAsJsonObject();
|
||||
knownCache.put(ID.of(shader.get("id").getAsString()), shader.get("hash").getAsString());
|
||||
}
|
||||
hashCache = knownCache;
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
hashCache = new Object2ObjectOpenHashMap<>();
|
||||
}
|
||||
}
|
||||
|
||||
private void save() {
|
||||
JsonArray array = new JsonArray();
|
||||
hashCache.forEach((K, V) -> {
|
||||
JsonObject obj = new JsonObject();
|
||||
obj.addProperty("id", K.toString());
|
||||
obj.addProperty("hash", V);
|
||||
array.add(obj);
|
||||
});
|
||||
try(JsonWriter writer = new JsonWriter(Files.newBufferedWriter(cache.resolve("cache.json")))) {
|
||||
JsonObject obj = new JsonObject();
|
||||
obj.add("shaders", array);
|
||||
writer.setIndent("\t");
|
||||
Streams.write(obj, writer);
|
||||
}
|
||||
catch(Exception e) { e.printStackTrace(); }
|
||||
}
|
||||
|
||||
public ByteBuffer get(ID shaderId, Supplier<String> fileHash) {
|
||||
if(cache == null) return null;
|
||||
String known = hashCache.get(shaderId);
|
||||
if(known == null || !Objects.equals(known, fileHash.get())) return null;
|
||||
Path path = toFile(shaderId);
|
||||
if(Files.notExists(path)) return null;
|
||||
try {
|
||||
byte[] data = Files.readAllBytes(path);
|
||||
return MemoryUtil.memAlloc(data.length).put(data).flip();
|
||||
}
|
||||
catch(Exception e) { e.printStackTrace(); }
|
||||
return null;
|
||||
}
|
||||
|
||||
public void store(ID shaderId, String fileHash, byte[] shader) {
|
||||
Objects.requireNonNull(shaderId);
|
||||
Objects.requireNonNull(fileHash);
|
||||
Objects.requireNonNull(shader);
|
||||
if(cache == null) return;
|
||||
hashCache.put(shaderId, fileHash);
|
||||
try {
|
||||
Path file = toFile(shaderId);
|
||||
if(Files.notExists(file.getParent())) Files.createDirectories(file.getParent());
|
||||
Files.write(file, shader);
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
save();
|
||||
}
|
||||
|
||||
public void delete(ID shaderId) {
|
||||
if(cache == null) return;
|
||||
if(hashCache.remove(shaderId) == null) return;
|
||||
try { Files.deleteIfExists(toFile(shaderId)); }
|
||||
catch(Exception e) { e.printStackTrace(); }
|
||||
save();
|
||||
}
|
||||
|
||||
private Path toFile(ID id) {
|
||||
return cache.resolve(id.domain()).resolve(id.path()+".bin");
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user