diff --git a/src/main/java/com/seibel/lod/core/render/RenderSystemTest.java b/src/main/java/com/seibel/lod/core/render/RenderSystemTest.java index 387b4b649..d6a6439d1 100644 --- a/src/main/java/com/seibel/lod/core/render/RenderSystemTest.java +++ b/src/main/java/com/seibel/lod/core/render/RenderSystemTest.java @@ -93,12 +93,12 @@ public class RenderSystemTest { // Switch between the two buffers per second if (System.currentTimeMillis() % 2000 < 1000) { - va.bindBufferToBindingPoint(sameContextBuffer.id, 0); GL32.glBindBuffer(GL32.GL_ARRAY_BUFFER, sameContextBuffer.id); + va.bindBufferToAllBindingPoint(sameContextBuffer.id); spamLogger.debug("same context buffer"); } else { - va.bindBufferToBindingPoint(sharedContextBuffer.id, 0); GL32.glBindBuffer(GL32.GL_ARRAY_BUFFER, sharedContextBuffer.id); + va.bindBufferToAllBindingPoint(sharedContextBuffer.id); spamLogger.debug("shared context buffer"); } // Render the square diff --git a/src/main/java/com/seibel/lod/core/render/objects/VertexAttributePreGL43.java b/src/main/java/com/seibel/lod/core/render/objects/VertexAttributePreGL43.java index e03e87b69..545bed56f 100644 --- a/src/main/java/com/seibel/lod/core/render/objects/VertexAttributePreGL43.java +++ b/src/main/java/com/seibel/lod/core/render/objects/VertexAttributePreGL43.java @@ -82,11 +82,7 @@ public final class VertexAttributePreGL43 extends VertexAttribute { @Override // Requires VertexAttribute binded public void setVertexAttribute(int bindingPoint, int attributeIndex, VertexPointer attribute) { - TreeSet intArray = bindingPointsToIndexBuilder.get(bindingPoint); - if (intArray == null) { - intArray = new TreeSet(); - bindingPointsToIndexBuilder.put(bindingPoint, intArray); - } + TreeSet intArray = bindingPointsToIndexBuilder.computeIfAbsent(bindingPoint, k -> new TreeSet()); intArray.add(attributeIndex); while (pointersBuilder.size() <= attributeIndex) {