Class GlCommandEncoder
java.lang.Object
com.mojang.blaze3d.opengl.GlCommandEncoder
- All Implemented Interfaces:
CommandEncoderBackend, AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate final GlDeviceprivate final intprivate final long[]private @Nullable RenderPipelineprivate 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 TypeMethodDescriptionprivate voidapplyPipelineState(RenderPipeline pipeline) booleanawaitSubmit(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) 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) longintprivate voiddrawFromBuffers(GlRenderPass renderPass, int baseVertex, int firstIndex, int drawCount, @Nullable IndexType indexType, GlRenderPipeline pipeline, int instanceCount, int firstInstance) protected 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) protected <T> voidexecuteDrawMultiple(GlRenderPass renderPass, Collection<RenderPass.Draw<T>> draws, @Nullable GpuBuffer defaultIndexBuffer, @Nullable IndexType defaultIndexType, Collection<String> dynamicUniforms, T uniformArgument) voidexecuteDraws(GlRenderPass renderPass, @Nullable IndexType indexType, @Nullable PointerBuffer firstIndexOffsets, IntBuffer indexCounts, IntBuffer vertexOffsets, int drawCount) voidpresentTexture(GpuTextureView textureView, int swapchainWidth, int swapchainHeight) voidsubmit()voidprivate booleantrySetup(GlRenderPass renderPass, Collection<String> dynamicUniforms) private voidvalidateDraw(GlRenderPass renderPass, @Nullable IndexType indexType) voidwriteTimestamp(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
-
lastVertexArray
-
renderPassColorTextures
-
-
Constructor Details
-
GlCommandEncoder
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
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) - 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
-
createFence
- Specified by:
createFencein interfaceCommandEncoderBackend
-
executeDrawMultiple
protected <T> void executeDrawMultiple(GlRenderPass renderPass, Collection<RenderPass.Draw<T>> draws, @Nullable GpuBuffer defaultIndexBuffer, @Nullable IndexType defaultIndexType, Collection<String> dynamicUniforms, T uniformArgument) -
validateDraw
-
executeDraw
protected void executeDraw(GlRenderPass renderPass, int baseVertex, int firstIndex, int drawCount, @Nullable IndexType indexType, int instanceCount, int firstInstance) -
executeDraws
public void executeDraws(GlRenderPass renderPass, @Nullable IndexType indexType, @Nullable PointerBuffer firstIndexOffsets, IntBuffer indexCounts, IntBuffer vertexOffsets, int drawCount) -
executeDrawIndirect
protected void executeDrawIndirect(GlRenderPass renderPass, @Nullable IndexType indexType, GlBuffer commands, long offset, int drawCount) -
drawFromBuffers
private void drawFromBuffers(GlRenderPass renderPass, int baseVertex, int firstIndex, int drawCount, @Nullable IndexType indexType, GlRenderPipeline pipeline, int instanceCount, int firstInstance) -
trySetup
-
applyPipelineState
-
submitRenderPass
public void submitRenderPass()- Specified by:
submitRenderPassin interfaceCommandEncoderBackend
-
writeTimestamp
- Specified by:
writeTimestampin interfaceCommandEncoderBackend
-