Skip to content
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0d3be6c
Fix issues in GLES backends
riccardobl Jan 25, 2026
9a63ca1
rewrite lwjgl3 backend to use SDL
riccardobl Mar 20, 2026
5b00164
remove debug libraries
riccardobl Mar 20, 2026
fe52fef
support msaa framebuffer extension in gles
riccardobl Mar 21, 2026
fd4512a
use auxiliary framebuffer for srgb conversion
riccardobl Mar 21, 2026
812eecc
deprecate old opengl versions
riccardobl Mar 21, 2026
76da689
update deps
riccardobl Mar 21, 2026
05a9d64
Merge remote-tracking branch 'upstream/master' into angle
riccardobl May 5, 2026
0f94445
use lib catalog for angle native
riccardobl May 7, 2026
2b7c025
Merge remote-tracking branch 'upstream/master' into angle
riccardobl May 7, 2026
5706c46
Merge branch 'glespatch' into angle
riccardobl May 7, 2026
a257bed
fix
riccardobl May 7, 2026
182e94f
remove debug override
riccardobl May 7, 2026
b15c60f
update libs
riccardobl May 7, 2026
2927234
add task to run tests in proton
riccardobl May 7, 2026
2ad2de2
increase memory
riccardobl May 7, 2026
b8178dc
Merge remote-tracking branch 'upstream/master' into angle
riccardobl May 8, 2026
36dbf9f
Implement GPU timer query support across multiple platforms and handl…
riccardobl May 8, 2026
feaf8ea
Revert "Implement GPU timer query support across multiple platforms a…
riccardobl May 8, 2026
25a130f
add packed float toggler to getBestColorTargetFormat and disallow pac…
riccardobl May 8, 2026
919e4b2
fix wayland selection
riccardobl May 8, 2026
4bf14ab
Reapply "Implement GPU timer query support across multiple platforms …
riccardobl May 8, 2026
1c99a99
Revert "Reapply "Implement GPU timer query support across multiple pl…
riccardobl May 8, 2026
a3a408c
fix gpu timer support
riccardobl May 8, 2026
79734e7
fixes
riccardobl May 9, 2026
c3c1fc8
Merge branch 'master' into angle
riccardobl May 9, 2026
31af325
use Blit.j3md for gamma correction
riccardobl May 9, 2026
ccd450f
Revert "fixes"
riccardobl May 9, 2026
2e1d32b
Reapply "fixes"
riccardobl May 9, 2026
9520f5d
add explicit GLSL310 support for Blit material
riccardobl May 9, 2026
11c578f
force GL 3.2 in screenshot tests
riccardobl May 9, 2026
1059c81
add renderer selector to settings dialog
riccardobl May 9, 2026
34e595c
catch swapwindow failures
riccardobl May 9, 2026
5784b2b
reset hint on renderer change, fix sRGB for non angle renderer
riccardobl May 9, 2026
a926479
set __GL_THREADED_OPTIMIZATIONS=0 on start to workaround known nvidia…
riccardobl May 9, 2026
da56f14
bypass aux framebuffer if native gl
riccardobl May 9, 2026
5296808
use isGraphicsDebug
riccardobl May 9, 2026
4c3ee3c
Merge branch 'master' into angle
riccardobl May 9, 2026
db3d814
use 24 bit buffer in Xvfb
riccardobl May 9, 2026
5c76970
Fix examples launcher and disable AWT dialogs in macos
riccardobl May 9, 2026
a288755
use angle in tests with vulkan software rendering
riccardobl May 9, 2026
748e584
make all extensions optional
riccardobl May 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ javadoc_deploy.pub
!.vscode/settings.json
!.vscode/JME_style.xml
!.vscode/extensions.json
joysticks-*.txt
joysticks-*.txt
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"editor.formatOnPaste": false,
"editor.formatOnType": false,
"editor.formatOnSave": false,
"java.jdt.ls.vmargs": "-Xms512M -Xmx2G -XX:+UseG1GC -XX:+UseStringDeduplication -XX:AdaptiveSizePolicyWeight=90"
"java.jdt.ls.vmargs": "-Xms512M -Xmx4G -XX:+UseG1GC -XX:+UseStringDeduplication -XX:AdaptiveSizePolicyWeight=90"
}
6 changes: 6 additions & 0 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ repositories {
flatDir {
dirs rootProject.file('lib')
}
maven {
url "https://maven.rblb.it/NostrGameEngine/angle-natives"
}
maven {
url = uri("https://central.sonatype.com/repository/maven-snapshots")
Comment on lines +42 to +43
}
}

dependencies {
Expand Down
15 changes: 14 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
checkstyle = "13.3.0"
jacoco = "0.8.12"
lwjgl3 = "3.4.1"
angle = "20260507.46e42d40740c-SNAPSHOT"
saferalloc = "0.0.8"
nifty = "1.4.3"
spotbugs = "4.9.8"

Expand Down Expand Up @@ -36,9 +38,10 @@ lwjgl3-glfw = { module = "org.lwjgl:lwjgl-glfw", version.ref = "lwjgl3"
lwjgl3-jawt = { module = "org.lwjgl:lwjgl-jawt", version.ref = "lwjgl3" }
lwjgl3-jemalloc = { module = "org.lwjgl:lwjgl-jemalloc", version.ref = "lwjgl3" }
lwjgl3-openal = { module = "org.lwjgl:lwjgl-openal", version.ref = "lwjgl3" }
lwjgl3-opencl = { module = "org.lwjgl:lwjgl-opencl", version.ref = "lwjgl3" }
lwjgl3-opengl = { module = "org.lwjgl:lwjgl-opengl", version.ref = "lwjgl3" }
lwjgl3-sdl = { module = "org.lwjgl:lwjgl-sdl", version.ref = "lwjgl3" }
lwjgl3-opengles = { module = "org.lwjgl:lwjgl-opengles", version.ref = "lwjgl3" }
lwjgl3-egl = { module = "org.lwjgl:lwjgl-egl", version.ref = "lwjgl3" }

mokito-core = "org.mockito:mockito-core:5.23.0"
mokito-junit-jupiter = "org.mockito:mockito-junit-jupiter:5.23.0"
Expand All @@ -53,8 +56,18 @@ vecmath = "javax.vecmath:vecmath:1.5.2"

stb-image = "org.ngengine:stb-image:2.30.4"
imagewebp = "org.ngengine:image-webp-decoder:1.3.0"
angle = { module = "org.ngengine:angle-natives", version.ref = "angle" }
saferalloc = { module = "org.ngengine:saferalloc", version.ref = "saferalloc" }
saferalloc-natives-linux-x8664 = { module = "org.ngengine:saferalloc-natives-linux-x86_64", version.ref = "saferalloc" }
saferalloc-natives-linux-aarch64 = { module = "org.ngengine:saferalloc-natives-linux-aarch64", version.ref = "saferalloc" }
saferalloc-natives-windows-x8664 = { module = "org.ngengine:saferalloc-natives-windows-x86_64", version.ref = "saferalloc" }
saferalloc-natives-windows-aarch64 = { module = "org.ngengine:saferalloc-natives-windows-aarch64", version.ref = "saferalloc" }
saferalloc-natives-macos-x8664 = { module = "org.ngengine:saferalloc-natives-macos-x86_64", version.ref = "saferalloc" }
saferalloc-natives-macos-aarch64 = { module = "org.ngengine:saferalloc-natives-macos-aarch64", version.ref = "saferalloc" }
saferalloc-natives-android = { module = "org.ngengine:saferalloc-natives-android", version.ref = "saferalloc" }

[bundles]
saferalloc = ["saferalloc", "saferalloc-natives-linux-x8664", "saferalloc-natives-linux-aarch64", "saferalloc-natives-windows-x8664", "saferalloc-natives-windows-aarch64", "saferalloc-natives-macos-x8664", "saferalloc-natives-macos-aarch64", "saferalloc-natives-android"]

[plugins]
jacoco = { id = "jacoco", version.ref = "jacoco" }
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public class AndroidGL implements GL, GL2, GLES_30, GLExt, GLFbo {
public void resetStats() {
}

@Override
public boolean supportsGpuTimerQuery() {
return false;
}

private static int getLimitBytes(ByteBuffer buffer) {
checkLimit(buffer);
return buffer.limit();
Expand Down Expand Up @@ -100,6 +105,9 @@ public void glAttachShader(int program, int shader) {

@Override
public void glBeginQuery(int target, int query) {
if (target == GL.GL_TIME_ELAPSED) {
throw new UnsupportedOperationException("64-bit GPU timer queries are not exposed by the Android GLES bindings");
}
GLES30.glBeginQuery(target, query);
}

Expand Down Expand Up @@ -287,6 +295,9 @@ public void glEnableVertexAttribArray(int index) {

@Override
public void glEndQuery(int target) {
if (target == GL.GL_TIME_ELAPSED) {
throw new UnsupportedOperationException("64-bit GPU timer queries are not exposed by the Android GLES bindings");
}
GLES30.glEndQuery(target);
}

Expand Down Expand Up @@ -348,16 +359,13 @@ public String glGetProgramInfoLog(int program, int maxLength) {

@Override
public long glGetQueryObjectui64(int query, int pname) {
IntBuffer buff = IntBuffer.allocate(1);
//FIXME This is wrong IMO should be glGetQueryObjectui64v with a LongBuffer but it seems the API doesn't provide it.
GLES30.glGetQueryObjectuiv(query, pname, buff);
return buff.get(0);
throw new UnsupportedOperationException("64-bit query results are not exposed by the Android GLES bindings");
}

@Override
public int glGetQueryObjectiv(int query, int pname) {
IntBuffer buff = IntBuffer.allocate(1);
GLES30.glGetQueryiv(query, pname, buff);
IntBuffer buff = (IntBuffer)tmpBuff.clear();
GLES30.glGetQueryObjectuiv(query, pname, buff);
return buff.get(0);
}

Expand Down Expand Up @@ -786,4 +794,9 @@ public void glGenVertexArrays(IntBuffer arrays) {

}

@Override
public String glGetString(int name, int index) {
return GLES30.glGetStringi(name, index);
}

}
48 changes: 45 additions & 3 deletions jme3-awt-dialogs/src/main/java/com/jme3/awt/AWTSettingsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public interface SelectionListener {
private JComboBox<String> colorDepthCombo = null;
private JComboBox<String> displayFreqCombo = null;
private JComboBox<String> antialiasCombo = null;
private JComboBox<String> rendererCombo = null;
private JLabel icon = null;
private int selection = 0;
private SelectionListener selectionListener = null;
Expand Down Expand Up @@ -463,6 +464,8 @@ public void keyPressed(KeyEvent e) {
displayFreqCombo.addKeyListener(aListener);
antialiasCombo = new JComboBox<>();
antialiasCombo.addKeyListener(aListener);
rendererCombo = setUpRendererChooser();
rendererCombo.addKeyListener(aListener);
fullscreenBox = new JCheckBox(resourceBundle.getString("checkbox.fullscreen"));
fullscreenBox.setSelected(source.isFullscreen());
fullscreenBox.addActionListener(new ActionListener() {
Expand Down Expand Up @@ -549,6 +552,20 @@ public void actionPerformed(ActionEvent e) {
gbc.anchor = GridBagConstraints.WEST;
mainPanel.add(antialiasCombo, gbc);

gbc = new GridBagConstraints();
gbc.insets = new Insets(4, 4, 4, 4);
gbc.gridx = 0;
gbc.gridy = 4;
gbc.anchor = GridBagConstraints.EAST;
gbc.weightx = 0.5;
mainPanel.add(new JLabel(resourceBundle.getString("label.renderer")), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 4;
gbc.gridwidth = 3;
gbc.anchor = GridBagConstraints.WEST;
mainPanel.add(rendererCombo, gbc);

// Set the button action listeners. Cancel disposes without saving, OK
// saves.
ok.addActionListener(new ActionListener() {
Expand Down Expand Up @@ -583,14 +600,14 @@ public void actionPerformed(ActionEvent e) {
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridwidth = 2;
gbc.gridy = 4;
gbc.gridy = 5;
gbc.anchor = GridBagConstraints.EAST;
mainPanel.add(ok, gbc);
gbc = new GridBagConstraints();
gbc.insets = new Insets(4, 16, 4, 4);
gbc.gridx = 2;
gbc.gridwidth = 2;
gbc.gridy = 4;
gbc.gridy = 5;
gbc.anchor = GridBagConstraints.WEST;
mainPanel.add(cancel, gbc);

Expand Down Expand Up @@ -662,6 +679,7 @@ private boolean verifyAndSaveCurrentSelection() {
boolean fullscreen = fullscreenBox.isSelected();
boolean vsync = vsyncBox.isSelected();
boolean gamma = gammaBox.isSelected();
String renderer = (String) rendererCombo.getSelectedItem();

String[] parts = display.split(" x ");
int width = Integer.parseInt(parts[0]);
Expand Down Expand Up @@ -721,7 +739,7 @@ private boolean verifyAndSaveCurrentSelection() {
source.setFullscreen(fullscreen);
source.setVSync(vsync);
source.setGammaCorrection(gamma);
// source.setRenderer(renderer);
source.setRenderer(renderer);
source.setSamples(multisample);

String appTitle = source.getTitle();
Expand Down Expand Up @@ -762,6 +780,30 @@ public void actionPerformed(ActionEvent e) {
return resolutionBox;
}

private JComboBox<String> setUpRendererChooser() {
JComboBox<String> rendererBox = new JComboBox<>();
Set<String> renderers = new LinkedHashSet<>(Arrays.asList(
AppSettings.ANGLE_GLES3,
AppSettings.LWJGL_OPENGL32,
AppSettings.LWJGL_OPENGL33,
AppSettings.LWJGL_OPENGL40,
AppSettings.LWJGL_OPENGL41,
AppSettings.LWJGL_OPENGL42,
AppSettings.LWJGL_OPENGL43,
AppSettings.LWJGL_OPENGL44,
AppSettings.LWJGL_OPENGL45
));
String currentRenderer = source.getRenderer();
if (currentRenderer != null) {
renderers.add(currentRenderer);
}
for (String renderer : renderers) {
rendererBox.addItem(renderer);
}
rendererBox.setSelectedItem(currentRenderer);
return rendererBox;
}

/**
* <code>updateDisplayChoices</code> updates the available color depth and
* display frequency options to match the currently selected resolution.
Expand Down
30 changes: 19 additions & 11 deletions jme3-core/src/main/java/com/jme3/app/DetailedProfiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
package com.jme3.app;

import com.jme3.profile.*;
import com.jme3.renderer.Caps;
import com.jme3.renderer.Renderer;
import com.jme3.renderer.ViewPort;
import com.jme3.renderer.queue.RenderQueue;
Expand Down Expand Up @@ -86,14 +87,16 @@ public void appStep(AppStep step) {
frameTime.setNewFrameValueCpu(System.nanoTime());

frameEnded = false;
for (StatLine statLine : data.values()) {
for (Iterator<Integer> i = statLine.taskIds.iterator(); i.hasNext(); ) {
int id = i.next();
if (renderer.isTaskResultAvailable(id)) {
long val = renderer.getProfilingTime(id);
statLine.setValueGpu(val);
i.remove();
idsPool.push(id);
if (renderer != null) {
for (StatLine statLine : data.values()) {
for (Iterator<Integer> i = statLine.taskIds.iterator(); i.hasNext(); ) {
int id = i.next();
if (renderer.isTaskResultAvailable(id)) {
long val = renderer.getProfilingTime(id);
statLine.setValueGpu(val);
i.remove();
idsPool.push(id);
}
}
}
}
Expand Down Expand Up @@ -222,8 +225,8 @@ private void addStep(String path, long value) {
int id = getUnusedTaskId();
line.taskIds.add(id);
renderer.startProfiling(id);
ongoingGpuProfiling = true;
}
ongoingGpuProfiling = true;
prevPath = path;

}
Expand All @@ -239,8 +242,13 @@ private String getPath(String step, String... subPath) {
}

public void setRenderer(Renderer renderer) {
this.renderer = renderer;
poolTaskIds(renderer);
idsPool.clear();
if (renderer != null && renderer.getCaps().contains(Caps.GpuTimerQuery)) {
this.renderer = renderer;
poolTaskIds(renderer);
} else {
this.renderer = null;
}
}

private void poolTaskIds(Renderer renderer) {
Expand Down
6 changes: 6 additions & 0 deletions jme3-core/src/main/java/com/jme3/renderer/Caps.java
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,12 @@ public enum Caps {
* GPU support for binary shaders.
*/
BinaryShader,

/**
* Supports GPU timer queries with full 64-bit elapsed-time results.
*/
GpuTimerQuery,

/**
* Supporting working with UniformBufferObject.
*/
Expand Down
10 changes: 10 additions & 0 deletions jme3-core/src/main/java/com/jme3/renderer/opengl/GL.java
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,16 @@ public void glCompressedTexSubImage2D(int target, int level, int xoffset, int yo
*/
public String glGetProgramInfoLog(int program, int maxSize);

/**
* Returns whether this GL binding can execute elapsed-time timer queries
* and read their full 64-bit results.
*
* @return true if full GPU timer query support is exposed by the binding
*/
public default boolean supportsGpuTimerQuery() {
return true;
}

/**
* Unsigned version.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ public interface GLES_30 extends GL {

public static final int GL_RGB10_A2 = 0x8059;
public static final int GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368;

public static final int GL_NUM_EXTENSIONS = 0x821D;

public void glBindVertexArray(int array);

public void glDeleteVertexArrays(IntBuffer arrays);

public void glGenVertexArrays(IntBuffer arrays);

public String glGetString(final int name, final int index);

}
Loading
Loading