Skip to content

Commit

Permalink
Minimise patch by removing unnecessary indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
FiniteReality committed Dec 9, 2024
1 parent ef3f2f4 commit b6c5afb
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions patches/com/mojang/blaze3d/pipeline/MainTarget.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,18 @@
}

private void createFrameBuffer(int p_166142_, int p_166143_) {
@@ -30,13 +_,24 @@
@@ -30,6 +_,7 @@
GlStateManager._texParameter(3553, 10242, 33071);
GlStateManager._texParameter(3553, 10243, 33071);
GlStateManager._glFramebufferTexture2D(36160, 36064, 3553, this.colorTextureId, 0);
- GlStateManager._bindTexture(this.depthBufferId);
- GlStateManager._texParameter(3553, 34892, 0);
- GlStateManager._texParameter(3553, 10241, 9728);
- GlStateManager._texParameter(3553, 10240, 9728);
- GlStateManager._texParameter(3553, 10242, 33071);
- GlStateManager._texParameter(3553, 10243, 33071);
- GlStateManager._glFramebufferTexture2D(36160, 36096, 3553, this.depthBufferId, 0);
+ if (this.useDepth) {
+ GlStateManager._bindTexture(this.depthBufferId);
+ GlStateManager._texParameter(3553, 34892, 0);
+ GlStateManager._texParameter(3553, 10241, 9728);
+ GlStateManager._texParameter(3553, 10240, 9728);
+ GlStateManager._texParameter(3553, 10242, 33071);
+ GlStateManager._texParameter(3553, 10243, 33071);
+ GlStateManager._glFramebufferTexture2D(36160, 36096, 3553, this.depthBufferId, 0);
GlStateManager._bindTexture(this.depthBufferId);
GlStateManager._texParameter(3553, 34892, 0);
GlStateManager._texParameter(3553, 10241, 9728);
@@ -37,6 +_,16 @@
GlStateManager._texParameter(3553, 10242, 33071);
GlStateManager._texParameter(3553, 10243, 33071);
GlStateManager._glFramebufferTexture2D(36160, 36096, 3553, this.depthBufferId, 0);
+ }
+ if (this.useStencil) {
+ GlStateManager._bindTexture(this.stencilBufferId);
Expand All @@ -51,9 +44,8 @@
private MainTarget.Dimension allocateAttachments(int p_166147_, int p_166148_) {
RenderSystem.assertOnRenderThreadOrInit();
this.colorTextureId = TextureUtil.generateTextureId();
- this.depthBufferId = TextureUtil.generateTextureId();
+ if (this.useDepth) {
+ this.depthBufferId = TextureUtil.generateTextureId();
this.depthBufferId = TextureUtil.generateTextureId();
+ }
+ if (this.useStencil) {
+ this.stencilBufferId = this.useDepth ? this.depthBufferId : TextureUtil.generateTextureId();
Expand Down

0 comments on commit b6c5afb

Please sign in to comment.