| 1 | package com.mojang.renderpearl.backend.api;
|
| 2 |
|
| 3 | import com.mojang.renderpearl.api.buffers.GpuBuffer;
|
| 4 | import com.mojang.renderpearl.api.buffers.GpuBufferSlice;
|
| 5 | import com.mojang.renderpearl.api.buffers.TransientMemory;
|
| 6 | import com.mojang.renderpearl.api.commands.GpuFence;
|
| 7 | import com.mojang.renderpearl.api.commands.GpuQueryPool;
|
| 8 | import com.mojang.renderpearl.api.commands.RenderPassDescriptor;
|
| 9 | import com.mojang.renderpearl.api.textures.GpuTexture;
|
| 10 | import java.nio.ByteBuffer;
|
| 11 | import net.fabricmc.api.EnvType;
|
| 12 | import net.fabricmc.api.Environment;
|
| 13 | import org.joml.Vector4fc;
|
| 14 |
|
| 15 | @Environment(EnvType.CLIENT)
|
| 16 | public interface CommandEncoderBackend {
|
| 17 | void submit();
|
| 18 |
|
| 19 | TransientMemory transientMemory();
|
| 20 |
|
| 21 | RenderPassBackend createRenderPass(RenderPassDescriptor descriptor);
|
| 22 |
|
| 23 | void submitRenderPass();
|
| 24 |
|
| 25 | void clearColorTexture(GpuTexture colorTexture, Vector4fc clearColor);
|
| 26 |
|
| 27 | void clearColorAndDepthTextures(GpuTexture colorTexture, Vector4fc clearColor, GpuTexture depthTexture, double clearDepth);
|
| 28 |
|
| 29 | void clearColorAndDepthTextures(
|
| 30 | GpuTexture colorTexture,
|
| 31 | Vector4fc clearColor,
|
| 32 | GpuTexture depthTexture,
|
| 33 | double clearDepth,
|
| 34 | int regionX,
|
| 35 | int regionY,
|
| 36 | int regionWidth,
|
| 37 | int regionHeight,
|
| 38 | int mipLevel
|
| 39 | );
|
| 40 |
|
| 41 | void clearDepthTexture(GpuTexture depthTexture, double clearDepth);
|
| 42 |
|
| 43 | void writeToBuffer(GpuBufferSlice destination, ByteBuffer data);
|
| 44 |
|
| 45 | void copyToBuffer(GpuBufferSlice source, GpuBufferSlice target);
|
| 46 |
|
| 47 | void writeToTexture(GpuTexture destination, ByteBuffer source, int mipLevel, int depthOrLayer, int destX, int destY, int width, int height);
|
| 48 |
|
| 49 | void copyBufferToTexture(
|
| 50 | GpuBufferSlice source,
|
| 51 | int sourceX,
|
| 52 | int sourceY,
|
| 53 | int sourceWidth,
|
| 54 | int sourceHeight,
|
| 55 | GpuTexture destination,
|
| 56 | int destinationX,
|
| 57 | int destinationY,
|
| 58 | int copyWidth,
|
| 59 | int copyHeight,
|
| 60 | int mipLevel,
|
| 61 | int arrayLayer
|
| 62 | );
|
| 63 |
|
| 64 | void copyTextureToBuffer(GpuTexture source, GpuBuffer destination, long offset, Runnable callback, int mipLevel);
|
| 65 |
|
| 66 | void copyTextureToBuffer(GpuTexture source, GpuBuffer destination, long offset, Runnable callback, int mipLevel, int x, int y, int width, int height);
|
| 67 |
|
| 68 | void copyTextureToTexture(GpuTexture source, GpuTexture destination, int mipLevel, int destX, int destY, int sourceX, int sourceY, int width, int height);
|
| 69 |
|
| 70 | GpuFence createFence();
|
| 71 |
|
| 72 | void writeTimestamp(GpuQueryPool pool, int index);
|
| 73 | }
|
| 74 |
|