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

61 lines
1.9 KiB
Java

package com.mojang.blaze3d.systems;
import com.mojang.blaze3d.DontObfuscate;
import com.mojang.blaze3d.buffers.BufferType;
import com.mojang.blaze3d.buffers.BufferUsage;
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.pipeline.CompiledRenderPipeline;
import com.mojang.blaze3d.pipeline.RenderPipeline;
import com.mojang.blaze3d.shaders.ShaderType;
import com.mojang.blaze3d.textures.GpuTexture;
import com.mojang.blaze3d.textures.TextureFormat;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.function.BiFunction;
import java.util.function.Supplier;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.Nullable;
@Environment(EnvType.CLIENT)
@DontObfuscate
public interface GpuDevice {
CommandEncoder createCommandEncoder();
GpuTexture createTexture(@Nullable Supplier<String> supplier, TextureFormat textureFormat, int i, int j, int k);
GpuTexture createTexture(@Nullable String string, TextureFormat textureFormat, int i, int j, int k);
GpuBuffer createBuffer(@Nullable Supplier<String> supplier, BufferType bufferType, BufferUsage bufferUsage, int i);
GpuBuffer createBuffer(@Nullable Supplier<String> supplier, BufferType bufferType, BufferUsage bufferUsage, ByteBuffer byteBuffer);
String getImplementationInformation();
List<String> getLastDebugMessages();
boolean isDebuggingEnabled();
String getVendor();
String getBackendName();
String getVersion();
String getRenderer();
int getMaxTextureSize();
default CompiledRenderPipeline precompilePipeline(RenderPipeline renderPipeline) {
return this.precompilePipeline(renderPipeline, null);
}
CompiledRenderPipeline precompilePipeline(RenderPipeline renderPipeline, @Nullable BiFunction<ResourceLocation, ShaderType, String> biFunction);
void clearPipelineCache();
List<String> getEnabledExtensions();
void close();
}