mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-23 21:59:44 +00:00
* More Caching * Pull TextureTracker & TextureInfoCache out of Iris and into GLSM * Cache more TextureInfo state * GLSM: glTexParameter, glGetTexParameter(i|f), glGetTexLevelParameteri * Move IrisRenderSystem -> GLSM.RenderSystem * Ensure DSA works properly with GLSM * Further updates to DSA for texParameter/getTexParameter * A few more cached fields for TextureInfo * Properly handle deleteTextures * Ensure anyone crazy enough to use an Int/FloatBuffer for single value params get redirected * Add optional runtime disabling of GLSM * Switch checkGLError from an inject to a redirect, hopefully fewer allocations * Fewer allocations for clearBufferState * Microoptimization for (setup|clear)BufferState
25 lines
801 B
Java
25 lines
801 B
Java
package net.coderbot.iris.gl.image;
|
|
|
|
import com.gtnewhorizons.angelica.glsm.RenderSystem;
|
|
import org.lwjgl.opengl.GL15;
|
|
|
|
import java.util.function.IntSupplier;
|
|
|
|
public class ImageBinding {
|
|
private final int imageUnit;
|
|
private final int internalFormat;
|
|
private final IntSupplier textureID;
|
|
|
|
public ImageBinding(int imageUnit, int internalFormat, IntSupplier textureID) {
|
|
this.textureID = textureID;
|
|
this.imageUnit = imageUnit;
|
|
this.internalFormat = internalFormat;
|
|
}
|
|
|
|
public void update() {
|
|
// We can assume that image bindings are supported here as either the EXT extension or 4.2 core, as otherwise ImageLimits
|
|
// would report that zero image units are supported.
|
|
RenderSystem.bindImageTexture(imageUnit, textureID.getAsInt(), 0, false, 0, GL15.GL_READ_WRITE, internalFormat);
|
|
}
|
|
}
|