| 1 | package com.mojang.renderpearl.api.device;
|
| 2 |
|
| 3 | import com.mojang.renderpearl.api.GpuFormat;
|
| 4 | import com.mojang.renderpearl.api.buffers.GpuBuffer;
|
| 5 | import com.mojang.renderpearl.api.commands.CommandEncoder;
|
| 6 | import com.mojang.renderpearl.api.commands.GpuQueryPool;
|
| 7 | import com.mojang.renderpearl.api.pipeline.CompiledRenderPipeline;
|
| 8 | import com.mojang.renderpearl.api.pipeline.RenderPipeline;
|
| 9 | import com.mojang.renderpearl.api.pipeline.ShaderSource;
|
| 10 | import com.mojang.renderpearl.api.textures.AddressMode;
|
| 11 | import com.mojang.renderpearl.api.textures.FilterMode;
|
| 12 | import com.mojang.renderpearl.api.textures.GpuSampler;
|
| 13 | import com.mojang.renderpearl.api.textures.GpuTexture;
|
| 14 | import com.mojang.renderpearl.api.textures.GpuTextureView;
|
| 15 | import java.nio.ByteBuffer;
|
| 16 | import java.util.List;
|
| 17 | import java.util.OptionalDouble;
|
| 18 | import java.util.concurrent.CompletableFuture;
|
| 19 | import java.util.concurrent.Executor;
|
| 20 | import java.util.function.BooleanSupplier;
|
| 21 | import java.util.function.Supplier;
|
| 22 | import net.fabricmc.api.EnvType;
|
| 23 | import net.fabricmc.api.Environment;
|
| 24 | import org.jspecify.annotations.Nullable;
|
| 25 |
|
| 26 | @Environment(EnvType.CLIENT)
|
| 27 | public interface GpuDevice {
|
| 28 | GpuSurface createSurface(long windowHandle, final BooleanSupplier isIconified);
|
| 29 |
|
| 30 | CommandEncoder createCommandEncoder();
|
| 31 |
|
| 32 | GpuSampler createSampler(
|
| 33 | AddressMode addressModeU, AddressMode addressModeV, FilterMode minFilter, FilterMode magFilter, int maxAnisotropy, OptionalDouble maxLod
|
| 34 | );
|
| 35 |
|
| 36 | GpuTexture createTexture(
|
| 37 | @Nullable Supplier<String> label, @GpuTexture.Usage int usage, GpuFormat format, int width, int height, int depthOrLayers, int mipLevels
|
| 38 | );
|
| 39 |
|
| 40 | GpuTexture createTexture(@Nullable String label, @GpuTexture.Usage int usage, GpuFormat format, int width, int height, int depthOrLayers, int mipLevels);
|
| 41 |
|
| 42 | GpuTextureView createTextureView(GpuTexture texture);
|
| 43 |
|
| 44 | GpuTextureView createTextureView(GpuTexture texture, int baseMipLevel, int mipLevels);
|
| 45 |
|
| 46 | GpuBuffer createBuffer(@Nullable Supplier<String> label, @GpuBuffer.Usage int usage, long size);
|
| 47 |
|
| 48 | GpuBuffer createBuffer(@Nullable Supplier<String> label, @GpuBuffer.Usage int usage, ByteBuffer data);
|
| 49 |
|
| 50 | List<String> getLastDebugMessages();
|
| 51 |
|
| 52 | boolean isDebuggingEnabled();
|
| 53 |
|
| 54 | CompletableFuture<CompiledRenderPipeline.Pending> compilePipeline(RenderPipeline pipeline, ShaderSource shaderSource, Executor executor);
|
| 55 |
|
| 56 | void close();
|
| 57 |
|
| 58 | GpuQueryPool createTimestampQueryPool(int size);
|
| 59 |
|
| 60 | DeviceInfo getDeviceInfo();
|
| 61 | }
|
| 62 |
|