Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 src/main/java/net/vulkanmod/config/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static String determineDE() {
}

public static boolean isWindows() {
return OS == Util.OS.LINUX;
return OS == Util.OS.WINDOWS;
}

public static boolean isLinux() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/vulkanmod/gl/GlUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static ByteBuffer BGRAtoRGBA_buffer(ByteBuffer in) {
for (int i = 0; i < outSize ; i += 4) {
int color = MemoryUtil.memGetInt(srcPtr + i);

color = (color << 24) & 0xFF000000 | (color >> 8) & 0xFFFFFF;
color = (color & 0xFF00FF00) | ((color & 0x00FF0000) >>> 16) | ((color & 0x000000FF) << 16);

MemoryUtil.memPutInt(ptr + i, color);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/vulkanmod/gl/VkGlBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void glBindBuffer(int target, int buffer) {
case GL32.GL_PIXEL_PACK_BUFFER -> pixelPackBufferBound = glBuffer;
case GL32.GL_PIXEL_UNPACK_BUFFER -> pixelUnpackBufferBound = glBuffer;
case GL32.GL_ARRAY_BUFFER -> arrayBufferBound = glBuffer;
default -> throw new IllegalStateException("Unexpected value: " + target);
default -> {}
}
}

Expand Down
16 changes: 10 additions & 6 deletions src/main/java/net/vulkanmod/gl/VkGlFramebuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,17 @@ public static void deleteFramebuffer(int id) {
return;
}

boundFramebuffer = map.remove(id);
VkGlFramebuffer glFramebuffer = map.remove(id);

if (boundFramebuffer == null)
throw new NullPointerException("bound framebuffer is null");

boundFramebuffer.cleanUp(true);
boundFramebuffer = null;
if (glFramebuffer != null) {
if (boundFramebuffer == glFramebuffer) {
boundFramebuffer = null;
}
if (readFramebuffer == glFramebuffer) {
readFramebuffer = null;
}
glFramebuffer.cleanUp(true);
}
}

public static void framebufferTexture2D(int target, int attachment, int texTarget, int texture, int level) {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/net/vulkanmod/render/chunk/RenderSection.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@ public void resetDrawParameters(TerrainRenderType renderType) {
AreaBuffer areaBuffer = drawBuffers.getAreaBuffer(renderType);
int vertexOffset = DrawParametersBuffer.getVertexOffset(ptr);
if (areaBuffer != null && vertexOffset != -1) {
int segmentOffset = vertexOffset * drawBuffers.vertexSize;
areaBuffer.setSegmentFree(segmentOffset);
areaBuffer.freeSegment(vertexOffset);
}

DrawParametersBuffer.resetParameters(ptr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private void parseVersion() {
throw new IllegalStateException("First glsl line must contain #version");
}

advanceToken();
advanceToken(true);

if (!currentToken.value.startsWith("version")) {
throw new IllegalStateException("First glsl line must contain #version");
Expand Down