mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-20 12:29:40 +00:00
Custom images, textures, SSBO, and ShaderPack/ShaderProperties backports
This commit is contained in:
1 parent
6d60477b93
commit
bb52476d27
54 files changed
+2210
-494
No files matched your search
@@ -2,17 +2,22 @@ package net.coderbot.iris.gl.sampler;
|
||||
|
||||
import com.gtnewhorizons.angelica.glsm.RenderSystem;
|
||||
import net.coderbot.iris.gl.state.ValueUpdateNotifier;
|
||||
import net.coderbot.iris.gl.texture.TextureType;
|
||||
|
||||
import java.util.function.IntSupplier;
|
||||
|
||||
public class SamplerBinding {
|
||||
private final TextureType textureType;
|
||||
private final int textureUnit;
|
||||
private final IntSupplier texture;
|
||||
private final int sampler;
|
||||
private final ValueUpdateNotifier notifier;
|
||||
|
||||
public SamplerBinding(int textureUnit, IntSupplier texture, ValueUpdateNotifier notifier) {
|
||||
public SamplerBinding(TextureType type, int textureUnit, IntSupplier texture, GlSampler sampler, ValueUpdateNotifier notifier) {
|
||||
this.textureType = type;
|
||||
this.textureUnit = textureUnit;
|
||||
this.texture = texture;
|
||||
this.sampler = sampler == null ? 0 : sampler.getId();
|
||||
this.notifier = notifier;
|
||||
}
|
||||
|
||||
@@ -25,6 +30,7 @@ public class SamplerBinding {
|
||||
}
|
||||
|
||||
private void updateSampler() {
|
||||
RenderSystem.bindTextureToUnit(textureUnit, texture.getAsInt());
|
||||
RenderSystem.bindSamplerToUnit(textureUnit, sampler);
|
||||
RenderSystem.bindTextureToUnit(textureType.getGlType(), textureUnit, texture.getAsInt());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user