Try and fix invalid framebuffer depth/stencil setup, Thanks Ivoforce. Closes #1032

This commit is contained in:
Lex Manos committed 2014-04-15 12:03:31 -07:00
1 parent cc08cb46c8
commit 172ea90c59
3 files changed
+41 -33

No files matched your search

@@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
@@ -134,6 +134,14 @@
@@ -135,6 +135,14 @@
import net.minecraft.world.storage.ISaveFormat;
import net.minecraft.world.storage.ISaveHandler;
import net.minecraft.world.storage.WorldInfo;
@@ -15,7 +15,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.LWJGLException;
@@ -245,7 +253,7 @@
@@ -246,7 +254,7 @@
this.func_71389_H();
this.field_71449_j = p_i1014_1_;
field_147123_G.info("Setting user: " + p_i1014_1_.func_111285_a());
@@ -24,7 +24,7 @@
this.field_71459_aj = p_i1014_5_;
this.field_71443_c = p_i1014_2_;
this.field_71440_d = p_i1014_3_;
@@ -419,7 +427,7 @@
@@ -417,7 +425,7 @@
try
{
@@ -33,7 +33,7 @@
}
catch (LWJGLException lwjglexception)
{
@@ -518,7 +526,7 @@
@@ -516,7 +524,7 @@
this.field_71452_i = new EffectRenderer(this.field_71441_e, this.field_71446_o);
FMLClientHandler.instance().finishMinecraftLoading();
this.func_71361_d("Post startup");
@@ -42,7 +42,7 @@
if (this.field_71475_ae != null)
{
@@ -701,11 +709,6 @@
@@ -699,11 +707,6 @@
public void func_147108_a(GuiScreen p_147108_1_)
{
@@ -54,7 +54,7 @@
if (p_147108_1_ == null && this.field_71441_e == null)
{
p_147108_1_ = new GuiMainMenu();
@@ -715,6 +718,17 @@
@@ -713,6 +716,17 @@
p_147108_1_ = new GuiGameOver();
}
@@ -72,7 +72,7 @@
if (p_147108_1_ instanceof GuiMainMenu)
{
this.field_71474_y.field_74330_P = false;
@@ -1297,7 +1311,7 @@
@@ -1295,7 +1309,7 @@
if (this.field_71439_g.func_82246_f(i, j, k))
{
@@ -81,7 +81,7 @@
this.field_71439_g.func_71038_i();
}
}
@@ -1378,11 +1392,12 @@
@@ -1376,11 +1390,12 @@
int j = this.field_71476_x.field_72312_c;
int k = this.field_71476_x.field_72309_d;
@@ -96,7 +96,7 @@
{
flag = false;
this.field_71439_g.func_71038_i();
@@ -1409,7 +1424,8 @@
@@ -1407,7 +1422,8 @@
{
ItemStack itemstack1 = this.field_71439_g.field_71071_by.func_70448_g();
@@ -106,7 +106,7 @@
{
this.field_71460_t.field_78516_c.func_78445_c();
}
@@ -1608,6 +1624,8 @@
@@ -1606,6 +1622,8 @@
while (Mouse.next())
{
@@ -115,7 +115,7 @@
i = Mouse.getEventButton();
if (field_142025_a && i == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157)))
@@ -2075,6 +2093,11 @@
@@ -2079,6 +2097,11 @@
public void func_71353_a(WorldClient p_71353_1_, String p_71353_2_)
{
@@ -127,7 +127,7 @@
if (p_71353_1_ == null)
{
NetHandlerPlayClient nethandlerplayclient = this.func_147114_u();
@@ -2087,6 +2110,18 @@
@@ -2091,6 +2114,18 @@
if (this.field_71437_Z != null)
{
this.field_71437_Z.func_71263_m();
@@ -146,7 +146,7 @@
}
this.field_71437_Z = null;
@@ -2235,113 +2270,10 @@
@@ -2239,113 +2274,10 @@
if (this.field_71476_x != null)
{
boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d;
@@ -262,7 +262,7 @@
if (flag)
{
j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + this.field_71439_g.field_71071_by.field_70461_c;
@@ -2508,8 +2440,15 @@
@@ -2512,8 +2444,15 @@
p_70001_1_.func_76472_a("gl_max_texture_size", Integer.valueOf(func_71369_N()));
}
@@ -278,7 +278,7 @@
for (int i = 16384; i > 0; i >>= 1)
{
GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null);
@@ -2517,6 +2456,7 @@
@@ -2521,6 +2460,7 @@
if (j != 0)
{
@@ -1,21 +1,29 @@
--- ../src-base/minecraft/net/minecraft/client/shader/Framebuffer.java
+++ ../src-work/minecraft/net/minecraft/client/shader/Framebuffer.java
@@ -6,6 +6,7 @@
@@ -6,6 +6,9 @@
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureUtil;
+import net.minecraftforge.client.MinecraftForgeClient;
+import static org.lwjgl.opengl.EXTPackedDepthStencil.*;
+import static org.lwjgl.opengl.EXTFramebufferObject.*;
import org.lwjgl.opengl.EXTFramebufferObject;
import org.lwjgl.opengl.GL11;
@@ -120,6 +121,11 @@
@@ -118,8 +121,17 @@
if (this.field_147619_e)
{
EXTFramebufferObject.glBindRenderbufferEXT(36161, this.field_147624_h);
+ if (MinecraftForgeClient.getStencilBits() == 0)
+ {
EXTFramebufferObject.glRenderbufferStorageEXT(36161, 33190, this.field_147622_a, this.field_147620_b);
EXTFramebufferObject.glFramebufferRenderbufferEXT(36160, 36096, 36161, this.field_147624_h);
+ if(MinecraftForgeClient.getStencilBits() > 0)
+ }
+ else
+ {
+ EXTFramebufferObject.glRenderbufferStorageEXT(36161, EXTFramebufferObject.GL_STENCIL_INDEX8_EXT, this.field_147622_a, this.field_147620_b);
+ EXTFramebufferObject.glFramebufferRenderbufferEXT(36160, EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, 36161, this.field_147624_h);
+ EXTFramebufferObject.glRenderbufferStorageEXT(36161, GL_DEPTH24_STENCIL8_EXT, this.field_147622_a, this.field_147620_b);
+ EXTFramebufferObject.glFramebufferRenderbufferEXT(36160, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, this.field_147624_h);
+ EXTFramebufferObject.glFramebufferRenderbufferEXT(36160, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, this.field_147624_h);
+ }
}
@@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/server/MinecraftServer.java
+++ ../src-work/minecraft/net/minecraft/server/MinecraftServer.java
@@ -25,6 +25,7 @@
@@ -26,6 +26,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
@@ -8,7 +8,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Random;
@@ -73,6 +74,10 @@
@@ -74,6 +75,10 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -19,7 +19,7 @@
public abstract class MinecraftServer implements ICommandSender, Runnable, IPlayerUsage
{
private static final Logger field_147145_h = LogManager.getLogger();
@@ -89,7 +94,7 @@
@@ -90,7 +95,7 @@
@SideOnly(Side.SERVER)
private String field_71320_r;
private int field_71319_s = -1;
@@ -28,7 +28,7 @@
private ServerConfigurationManager field_71318_t;
private boolean field_71317_u = true;
private boolean field_71316_v;
@@ -106,7 +111,8 @@
@@ -107,7 +112,8 @@
private int field_71280_D;
private int field_143008_E = 0;
public final long[] field_71311_j = new long[100];
@@ -38,7 +38,7 @@
private KeyPair field_71292_I;
private String field_71293_J;
private String field_71294_K;
@@ -182,8 +188,6 @@
@@ -183,8 +189,6 @@
{
this.func_71237_c(p_71247_1_);
this.func_71192_d("menu.loadingLevel");
@@ -47,7 +47,7 @@
ISaveHandler isavehandler = this.field_71310_m.func_75804_a(p_71247_1_, true);
WorldInfo worldinfo = isavehandler.func_75757_d();
WorldSettings worldsettings;
@@ -203,46 +207,21 @@
@@ -204,46 +208,21 @@
worldsettings.func_77159_a();
}
@@ -101,7 +101,7 @@
this.func_147139_a(this.func_147135_j());
this.func_71222_d();
}
@@ -309,6 +288,7 @@
@@ -310,6 +289,7 @@
if (!this.field_71290_O)
{
WorldServer[] aworldserver = this.field_71305_c;
@@ -109,7 +109,7 @@
int i = aworldserver.length;
for (int j = 0; j < i; ++j)
@@ -359,9 +339,16 @@
@@ -360,9 +340,16 @@
for (int i = 0; i < this.field_71305_c.length; ++i)
{
WorldServer worldserver = this.field_71305_c[i];
@@ -126,7 +126,7 @@
if (this.field_71307_n.func_76468_d())
{
this.field_71307_n.func_76470_e();
@@ -586,13 +573,15 @@
@@ -588,13 +575,15 @@
this.field_71304_b.func_76320_a("levels");
int i;
@@ -145,7 +145,7 @@
this.field_71304_b.func_76320_a(worldserver.func_72912_H().func_76065_j());
this.field_71304_b.func_76320_a("pools");
worldserver.func_82732_R().func_72343_a();
@@ -639,9 +628,11 @@
@@ -641,9 +630,11 @@
this.field_71304_b.func_76319_b();
}
@@ -158,7 +158,7 @@
this.field_71304_b.func_76318_c("connection");
this.func_147137_ag().func_151269_c();
this.field_71304_b.func_76318_c("players");
@@ -685,7 +676,13 @@
@@ -688,7 +679,13 @@
public WorldServer func_71218_a(int p_71218_1_)
{
@@ -173,7 +173,7 @@
}
public String func_71249_w()
@@ -944,6 +941,7 @@
@@ -947,6 +944,7 @@
if (worldserver != null)
{
@@ -181,7 +181,7 @@
worldserver.func_73041_k();
}
}
@@ -1414,7 +1412,6 @@
@@ -1417,7 +1415,6 @@
this.field_147141_M = p_155759_1_;
}