minecraft-src/com/mojang/blaze3d/systems/RenderPass.java
2025-07-04 03:45:38 +03:00

65 lines
1.9 KiB
Java

package com.mojang.blaze3d.systems;
import com.mojang.blaze3d.DontObfuscate;
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.pipeline.RenderPipeline;
import com.mojang.blaze3d.textures.GpuTexture;
import com.mojang.blaze3d.vertex.VertexFormat;
import java.util.Collection;
import java.util.function.Consumer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import org.jetbrains.annotations.Nullable;
import org.joml.Matrix4f;
@Environment(EnvType.CLIENT)
@DontObfuscate
public interface RenderPass extends AutoCloseable {
void setPipeline(RenderPipeline renderPipeline);
void bindSampler(String string, GpuTexture gpuTexture);
void setUniform(String string, int... is);
void setUniform(String string, float... fs);
void setUniform(String string, Matrix4f matrix4f);
void enableScissor(ScissorState scissorState);
void enableScissor(int i, int j, int k, int l);
void disableScissor();
void setVertexBuffer(int i, GpuBuffer gpuBuffer);
void setIndexBuffer(GpuBuffer gpuBuffer, VertexFormat.IndexType indexType);
void drawIndexed(int i, int j);
void drawMultipleIndexed(Collection<RenderPass.Draw> collection, @Nullable GpuBuffer gpuBuffer, @Nullable VertexFormat.IndexType indexType);
void draw(int i, int j);
void close();
@Environment(EnvType.CLIENT)
public record Draw(
int slot,
GpuBuffer vertexBuffer,
@Nullable GpuBuffer indexBuffer,
@Nullable VertexFormat.IndexType indexType,
int firstIndex,
int indexCount,
@Nullable Consumer<RenderPass.UniformUploader> uniformUploaderConsumer
) {
public Draw(int slot, GpuBuffer vertexBuffer, GpuBuffer indexBuffer, VertexFormat.IndexType indexType, int firstIndex, int indexCount) {
this(slot, vertexBuffer, indexBuffer, indexType, firstIndex, indexCount, null);
}
}
@Environment(EnvType.CLIENT)
public interface UniformUploader {
void upload(String string, float... fs);
}
}