Skip to content

Commit

Permalink
macOS users crying
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Aug 9, 2023
1 parent 5cfec7b commit e1da424
Show file tree
Hide file tree
Showing 25 changed files with 171 additions and 522 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.lwjgl.opengl.GL11C;
import org.lwjgl.opengl.GL30C;
import org.lwjgl.opengl.GL43C;
import org.lwjgl.opengl.GL46C;

This comment has been minimized.

Copy link
@mrjasonn

mrjasonn Aug 10, 2023

@IMS212 Remember you are also making people with old graphics driver that can't support that cry


import java.io.IOException;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -74,7 +75,7 @@ public void rebuildProgram(int width, int height, ColorSpace colorSpace) {
builder.addDynamicSampler(() -> target, "readImage");

swapTexture = GlStateManager._genTexture();
IrisRenderSystem.texImage2D(swapTexture, GL30C.GL_TEXTURE_2D, 0, GL30C.GL_RGBA8, width, height, 0, GL30C.GL_RGBA, GL30C.GL_UNSIGNED_BYTE, null);
GL46C.glTextureStorage2D(swapTexture, 1, GL30C.GL_RGBA8, width, height);

this.framebuffer = new GlFramebuffer();
framebuffer.addColorAttachment(0, swapTexture);
Expand All @@ -89,7 +90,6 @@ public void process(int targetImage) {
framebuffer.bind();
FullScreenQuadRenderer.INSTANCE.render();
Program.unbind();
framebuffer.bindAsReadBuffer();
IrisRenderSystem.copyTexSubImage2D(targetImage, GL11C.GL_TEXTURE_2D, 0, 0, 0, 0, 0, width, height);
GL46C.glCopyImageSubData(this.swapTexture, GL43C.GL_TEXTURE_2D, 0, 0, 0, 0, targetImage, GL43C.GL_TEXTURE_2D, 0, 0, 0, 0, width, height, 1);
}
}
Loading

0 comments on commit e1da424

Please sign in to comment.