Files
MinecraftForge/client/cpw/mods/fml/client/CopySubimageTextureHelper.java
T
Christian 00c7883088 Very significant improvement in performance by using glSubImage to upload data. Inspired by frequent complaints about performance of hires
texture packs. They probably still need a beefy system but should work. Hopefully I can figure out why the subImage GL side copy isn't working
properly for an even more significant speed boost. But this gets things started.
2013-04-09 20:15:14 -04:00

31 lines
851 B
Java

package cpw.mods.fml.client;
import java.nio.ByteBuffer;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.texture.Texture;
import net.minecraft.client.renderer.texture.TextureStitched;
public class CopySubimageTextureHelper extends TextureHelper {
@Override
public void doTextureCopy(Texture atlas, Texture source, int atlasX, int atlasY)
{
if (atlas.func_94282_c() == -1)
{
return;
}
atlas.func_94277_a(0);
ByteBuffer buffer = source.func_94273_h();
buffer.position(0);
GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, atlasX, atlasY, source.func_94275_d(), source.func_94276_e(), GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer);
}
@Override
public void doTextureUpload(TextureStitched source)
{
// NO OP for copysubimage
}
}