Skip to content

Commit

Permalink
Write Buffers Once
Browse files Browse the repository at this point in the history
  • Loading branch information
hammy275 committed Jun 19, 2022
1 parent e3c5cc5 commit f61f732
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,6 @@ public void renderItem(ItemStack item, MatrixStack stack, Vector3d pos, float si
OverlayTexture.NO_OVERLAY,
stack, Minecraft.getInstance().renderBuffers().bufferSource());

// Actually draw what's in our buffer to the screen
Minecraft.getInstance().renderBuffers().bufferSource().endBatch();

stack.popPose();

if (renderItemCounts && item.getCount() > 1) {
Expand All @@ -275,7 +272,6 @@ protected void renderItemGuide(MatrixStack stack, AxisAlignedBB hitbox, float al
cubeModel.render(stack, buffer.getBuffer(RenderType.entityTranslucent(Cube1x1.textureLocation)),
0, 1, 1, alpha, (float) (hitbox.getSize() / 2f));
stack.popPose();
buffer.endBatch();
}
}

Expand All @@ -301,7 +297,6 @@ protected void renderHitbox(MatrixStack stack, AxisAlignedBB hitbox, Vector3d po
WorldRenderer.renderLineBox(stack, buffer.getBuffer(RenderType.LINES),
hitbox.move(-pos.x, -pos.y, -pos.z),
red, green, blue, 1);
buffer.endBatch();
stack.popPose();
}
}
Expand All @@ -323,7 +318,6 @@ public void renderText(ITextComponent text, MatrixStack stack, Vector3d pos, flo
font.drawInBatch(text, size, 0, 0xFFFFFFFF, false,
stack.last().pose(), Minecraft.getInstance().renderBuffers().bufferSource(), false,
0, 15728880);
Minecraft.getInstance().renderBuffers().bufferSource().endBatch();
stack.popPose();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ protected void render(BackpackInfo info, MatrixStack stack, boolean isInVR) {
15728880, OverlayTexture.NO_OVERLAY,
1, 1, 1, 1);

Minecraft.getInstance().renderBuffers().bufferSource().endBatch();
stack.popPose();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.blf02.immersivemc.client.immersive.Immersives;
import net.blf02.immersivemc.client.immersive.info.AbstractImmersiveInfo;
import net.blf02.immersivemc.common.vr.VRPluginVerify;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;

Expand Down Expand Up @@ -36,6 +37,7 @@ protected <I extends AbstractImmersiveInfo> void renderInfos(AbstractImmersive<I
// Skip rendering if the list is modified mid-render
// It's fine, since we were only going to read it anyway!!
}
Minecraft.getInstance().renderBuffers().bufferSource().endBatch(); // Write all our buffers!

}

Expand Down

0 comments on commit f61f732

Please sign in to comment.