Class GlCommandEncoder
java.lang.Object
com.mojang.renderpearl.backend.opengl.GlCommandEncoder
- All Implemented Interfaces:
CommandEncoderBackend, UncheckedAutoCloseable, AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate final GlDeviceprivate final intprivate final long[]private @Nullable GlRenderPipelineprivate static final org.slf4j.Loggerstatic final intprivate static final longprivate final intprivate final List<@Nullable FrameBufferAttachment> private final GlTransientMemory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitSubmit(long index, long timeoutNS) voidclearColorAndDepthTextures(GpuTexture colorTexture, Vector4fc clearColor, GpuTexture depthTexture, double clearDepth) voidclearColorAndDepthTextures(GpuTexture colorTexture, Vector4fc clearColor, GpuTexture depthTexture, double clearDepth, int regionX, int regionY, int regionWidth, int regionHeight, int mipLevel) voidclearColorTexture(GpuTexture colorTexture, Vector4fc clearColor) voidclearDepthTexture(GpuTexture depthTexture, double clearDepth) voidclearStencilTexture(GpuTexture texture, int value) voidclose()voidcopyBufferToTexture(GpuBufferSlice source, int sourceX, int sourceY, int sourceWidth, int sourceHeight, GpuTexture destination, int destinationX, int destinationY, int copyWidth, int copyHeight, int mipLevel, int arrayLayer) voidcopyTextureToBuffer(GpuTexture source, GpuBuffer destination, long offset, Runnable callback, int mipLevel) voidcopyTextureToBuffer(GpuTexture source, GpuBuffer destination, long offset, Runnable callback, int mipLevel, int x, int y, int width, int height) voidcopyTextureToTexture(GpuTexture source, GpuTexture destination, int mipLevel, int destX, int destY, int sourceX, int sourceY, int width, int height) voidcopyToBuffer(GpuBufferSlice source, GpuBufferSlice target) createRenderPass(RenderPassDescriptor descriptor) longintprotected voidexecuteDraw(GlRenderPass renderPass, int baseVertex, int firstIndex, int drawCount, @Nullable IndexType indexType, int instanceCount, int firstInstance) protected voidexecuteDrawIndirect(GlRenderPass renderPass, @Nullable IndexType indexType, GlBuffer commands, long offset, int drawCount) voidexecuteDraws(GlRenderPass renderPass, @Nullable IndexType indexType, @Nullable org.lwjgl.PointerBuffer firstIndexOffsets, IntBuffer indexCounts, IntBuffer vertexOffsets, int drawCount) (package private) voidpresentTexture(long windowHandle, GpuTextureView textureView, int swapchainWidth, int swapchainHeight) private voidsetupDraw(GlRenderPass renderPass) voidsubmit()voidvoidwriteTimestamp(GpuQueryPool pool, int index) voidwriteToBuffer(GpuBufferSlice slice, ByteBuffer data) voidwriteToTexture(GpuTexture destination, ByteBuffer source, int mipLevel, int depthOrLayer, int destX, int destY, int width, int height)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MAX_SUBMITS_IN_FLIGHT
public static final int MAX_SUBMITS_IN_FLIGHT- See Also:
-
NO_FENCE
private static final long NO_FENCE- See Also:
-
device
-
transientMemory
-
fences
private final long[] fences -
currentSubmitIndex
private long currentSubmitIndex -
readFbo
private final int readFbo -
drawFbo
private final int drawFbo -
lastPipeline
-
lastProgram
-
renderPassColorTextures
-
-
Constructor Details
-
GlCommandEncoder
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceUncheckedAutoCloseable
-
currentSubmitIndex
public long currentSubmitIndex() -
currentSubmitSlot
public int currentSubmitSlot() -
submit
public void submit()- Specified by:
submitin interfaceCommandEncoderBackend
-
awaitSubmit
public boolean awaitSubmit(long index, long timeoutNS) -
transientMemory
- Specified by:
transientMemoryin interfaceCommandEncoderBackend
-
createRenderPass
- Specified by:
createRenderPassin interfaceCommandEncoderBackend
-
clearColorTexture
- Specified by:
clearColorTexturein interfaceCommandEncoderBackend
-
clearColorAndDepthTextures
public void clearColorAndDepthTextures(GpuTexture colorTexture, Vector4fc clearColor, GpuTexture depthTexture, double clearDepth) - Specified by:
clearColorAndDepthTexturesin interfaceCommandEncoderBackend
-
clearColorAndDepthTextures
public void clearColorAndDepthTextures(GpuTexture colorTexture, Vector4fc clearColor, GpuTexture depthTexture, double clearDepth, int regionX, int regionY, int regionWidth, int regionHeight, int mipLevel) - Specified by:
clearColorAndDepthTexturesin interfaceCommandEncoderBackend
-
clearDepthTexture
- Specified by:
clearDepthTexturein interfaceCommandEncoderBackend
-
clearStencilTexture
- Specified by:
clearStencilTexturein interfaceCommandEncoderBackend
-
writeToBuffer
- Specified by:
writeToBufferin interfaceCommandEncoderBackend
-
copyToBuffer
- Specified by:
copyToBufferin interfaceCommandEncoderBackend
-
writeToTexture
public void writeToTexture(GpuTexture destination, ByteBuffer source, int mipLevel, int depthOrLayer, int destX, int destY, int width, int height) - Specified by:
writeToTexturein interfaceCommandEncoderBackend
-
copyBufferToTexture
public void copyBufferToTexture(GpuBufferSlice source, int sourceX, int sourceY, int sourceWidth, int sourceHeight, GpuTexture destination, int destinationX, int destinationY, int copyWidth, int copyHeight, int mipLevel, int arrayLayer) - Specified by:
copyBufferToTexturein interfaceCommandEncoderBackend
-
copyTextureToBuffer
public void copyTextureToBuffer(GpuTexture source, GpuBuffer destination, long offset, Runnable callback, int mipLevel) - Specified by:
copyTextureToBufferin interfaceCommandEncoderBackend
-
copyTextureToBuffer
public void copyTextureToBuffer(GpuTexture source, GpuBuffer destination, long offset, Runnable callback, int mipLevel, int x, int y, int width, int height) - Specified by:
copyTextureToBufferin interfaceCommandEncoderBackend
-
copyTextureToTexture
public void copyTextureToTexture(GpuTexture source, GpuTexture destination, int mipLevel, int destX, int destY, int sourceX, int sourceY, int width, int height) - Specified by:
copyTextureToTexturein interfaceCommandEncoderBackend
-
presentTexture
void presentTexture(long windowHandle, GpuTextureView textureView, int swapchainWidth, int swapchainHeight) -
createFence
- Specified by:
createFencein interfaceCommandEncoderBackend
-
executeDraw
protected void executeDraw(GlRenderPass renderPass, int baseVertex, int firstIndex, int drawCount, @Nullable IndexType indexType, int instanceCount, int firstInstance) -
executeDraws
-
executeDrawIndirect
protected void executeDrawIndirect(GlRenderPass renderPass, @Nullable IndexType indexType, GlBuffer commands, long offset, int drawCount) -
setupDraw
-
submitRenderPass
public void submitRenderPass()- Specified by:
submitRenderPassin interfaceCommandEncoderBackend
-
writeTimestamp
- Specified by:
writeTimestampin interfaceCommandEncoderBackend
-