Fix MC-105406 (OpenGL leak in View Frustum) (#3308)

This commit is contained in:
Ben Staddon 2016-10-23 20:32:44 +01:00 committed by LexManos
parent b0558c63de
commit 9ecb005e98

View file

@ -1,6 +1,14 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/RenderGlobal.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/RenderGlobal.java
@@ -548,8 +548,10 @@
@@ -456,6 +456,7 @@
{
this.field_175009_l.clear();
this.field_72755_R.clear();
+ if (field_175008_n != null) field_175008_n.func_178160_a(); // Forge: Fix MC-105406
this.field_175008_n = null;
if (this.field_174995_M != null)
@@ -548,8 +549,10 @@
public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float p_180446_3_)
{
@ -11,7 +19,7 @@
--this.field_72740_G;
}
else
@@ -560,9 +562,12 @@
@@ -560,9 +563,12 @@
this.field_72769_h.field_72984_F.func_76320_a("prepare");
TileEntityRendererDispatcher.field_147556_a.func_190056_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_71476_x, p_180446_3_);
this.field_175010_j.func_180597_a(this.field_72769_h, this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_180446_3_);
@ -24,7 +32,7 @@
Entity entity = this.field_72777_q.func_175606_aa();
double d3 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_180446_3_;
double d4 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_180446_3_;
@@ -574,11 +579,15 @@
@@ -574,11 +580,15 @@
this.field_72777_q.field_71460_t.func_180436_i();
this.field_72769_h.field_72984_F.func_76318_c("global");
List<Entity> list = this.field_72769_h.func_72910_y();
@ -40,7 +48,7 @@
++this.field_72749_I;
if (entity1.func_145770_h(d0, d1, d2))
@@ -601,6 +610,7 @@
@@ -601,6 +611,7 @@
{
for (Entity entity2 : classinheritancemultimap)
{
@ -48,7 +56,7 @@
boolean flag = this.field_175010_j.func_178635_a(entity2, p_180446_2_, d0, d1, d2) || entity2.func_184215_y(this.field_72777_q.field_71439_g);
if (flag)
@@ -637,6 +647,7 @@
@@ -637,6 +648,7 @@
}
}
@ -56,7 +64,7 @@
if (this.func_174985_d() && (!list1.isEmpty() || this.field_184386_ad))
{
this.field_72769_h.field_72984_F.func_76318_c("entityOutlines");
@@ -676,6 +687,7 @@
@@ -676,6 +688,7 @@
this.field_72769_h.field_72984_F.func_76318_c("blockentities");
RenderHelper.func_74519_b();
@ -64,7 +72,7 @@
for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.field_72755_R)
{
List<TileEntity> list3 = renderglobal$containerlocalrenderinformation1.field_178036_a.func_178571_g().func_178485_b();
@@ -684,6 +696,7 @@
@@ -684,6 +697,7 @@
{
for (TileEntity tileentity2 : list3)
{
@ -72,7 +80,7 @@
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity2, p_180446_3_, -1);
}
}
@@ -693,9 +706,11 @@
@@ -693,9 +707,11 @@
{
for (TileEntity tileentity : this.field_181024_n)
{
@ -84,7 +92,7 @@
this.func_180443_s();
@@ -722,7 +737,7 @@
@@ -722,7 +738,7 @@
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
@ -93,7 +101,7 @@
{
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity1, p_180446_3_, destroyblockprogress.func_73106_e());
}
@@ -1213,6 +1228,13 @@
@@ -1213,6 +1229,13 @@
public void func_174976_a(float p_174976_1_, int p_174976_2_)
{
@ -107,7 +115,7 @@
if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p().func_186068_a() == 1)
{
this.func_180448_r();
@@ -1430,6 +1452,12 @@
@@ -1430,6 +1453,12 @@
public void func_180447_b(float p_180447_1_, int p_180447_2_)
{
@ -120,7 +128,7 @@
if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d())
{
if (this.field_72777_q.field_71474_y.func_181147_e() == 2)
@@ -1857,8 +1885,11 @@
@@ -1857,8 +1886,11 @@
double d4 = (double)blockpos.func_177956_o() - d1;
double d5 = (double)blockpos.func_177952_p() - d2;
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
@ -133,7 +141,7 @@
{
if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D)
{
@@ -2304,7 +2335,7 @@
@@ -2304,7 +2336,7 @@
if (block.func_176223_P().func_185904_a() != Material.field_151579_a)
{