Package com.mojang.blaze3d.opengl
Class GlCommandEncoder
java.lang.Object
com.mojang.blaze3d.opengl.GlCommandEncoder
- All Implemented Interfaces:
CommandEncoder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final GlDevice
private final int
private boolean
private RenderPipeline
private GlProgram
private static final org.slf4j.Logger
private final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
applyPipelineState
(RenderPipeline pPipeline) void
clearColorAndDepthTextures
(GpuTexture pColorTexture, int pClearColor, GpuTexture pDepthTexture, double pClearDepth) void
clearColorAndDepthTextures
(GpuTexture pColorTexture, int pClearColor, GpuTexture pDepthTexture, double pClearDepth, int pScissorX, int pScissorY, int pScissorWidth, int pScissorHeight) void
clearColorTexture
(GpuTexture pTexture, int pColor) void
clearDepthTexture
(GpuTexture pDepthTexture, double pClearDepth) void
clearStencilTexture
(GpuTexture texture, int value) void
copyTextureToBuffer
(GpuTexture pTexture, GpuBuffer pBuffer, int pOffset, Runnable pTask, int pMipLevel) void
copyTextureToBuffer
(GpuTexture pTexture, GpuBuffer pBuffer, int pOffset, Runnable pTask, int pMipLevel, int pX, int pY, int pWidth, int pHeight) void
copyTextureToTexture
(GpuTexture pSource, GpuTexture pDestination, int pMipLevel, int pX, int pY, int pSourceX, int pSourceY, int pWidth, int pHeight) void
copyToBuffer
(GpuBufferSlice p_428848_, GpuBufferSlice p_428840_) createRenderPass
(Supplier<String> pDebugGroup, GpuTextureView pColorTexture, OptionalInt pClearColor) createRenderPass
(Supplier<String> pDebugGroup, GpuTextureView pColorTexture, OptionalInt pClearColor, GpuTextureView pDepthTexture, OptionalDouble pClearDepth) private void
drawFromBuffers
(GlRenderPass pRenderPass, int pFirstIndex, int pIndex, int pIndexCount, VertexFormat.IndexType pIndexType, GlRenderPipeline pPipeline, int pPrimCount) protected void
executeDraw
(GlRenderPass pRenderPass, int pFirstIndex, int pIndex, int pIndexCount, VertexFormat.IndexType pIndexType, int pPrimCount) protected <T> void
executeDrawMultiple
(GlRenderPass pRenderPass, Collection<RenderPass.Draw<T>> pDraws, GpuBuffer pBuffer, VertexFormat.IndexType pIndexType, Collection<String> pUniforms, T pData) void
protected GlDevice
mapBuffer
(GpuBufferSlice pSlice, boolean pRead, boolean pWrite) void
presentTexture
(GpuTextureView pTexture) private boolean
trySetup
(GlRenderPass pRenderPass, Collection<String> pUniforms) private void
verifyColorTexture
(GpuTexture pTexture) private void
verifyDepthTexture
(GpuTexture pTexture) private void
verifyRegion
(GpuTexture pTexture, int pRegionX, int pRegionY, int pRegionWidth, int pRegionHeight) void
writeToBuffer
(GpuBufferSlice pSlice, ByteBuffer pData) void
writeToTexture
(GpuTexture pTexture, NativeImage pImage) void
writeToTexture
(GpuTexture pTexture, NativeImage pImage, int pMipLevel, int pDepthOrLayer, int pX, int pY, int pWidth, int pHeight, int pSourceX, int pSourceY) void
writeToTexture
(GpuTexture pTexture, IntBuffer pBuffer, NativeImage.Format pFormat, int pMipLevel, int pDepthOrLayer, int pX, int pY, int pWidth, int pHeight)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
device
-
readFbo
private final int readFbo -
drawFbo
private final int drawFbo -
lastPipeline
-
inRenderPass
private boolean inRenderPass -
lastProgram
-
-
Constructor Details
-
GlCommandEncoder
-
-
Method Details
-
createRenderPass
public RenderPass createRenderPass(Supplier<String> pDebugGroup, GpuTextureView pColorTexture, OptionalInt pClearColor) - Specified by:
createRenderPass
in interfaceCommandEncoder
-
createRenderPass
public RenderPass createRenderPass(Supplier<String> pDebugGroup, GpuTextureView pColorTexture, OptionalInt pClearColor, @Nullable GpuTextureView pDepthTexture, OptionalDouble pClearDepth) - Specified by:
createRenderPass
in interfaceCommandEncoder
-
clearColorTexture
- Specified by:
clearColorTexture
in interfaceCommandEncoder
-
clearColorAndDepthTextures
public void clearColorAndDepthTextures(GpuTexture pColorTexture, int pClearColor, GpuTexture pDepthTexture, double pClearDepth) - Specified by:
clearColorAndDepthTextures
in interfaceCommandEncoder
-
clearColorAndDepthTextures
public void clearColorAndDepthTextures(GpuTexture pColorTexture, int pClearColor, GpuTexture pDepthTexture, double pClearDepth, int pScissorX, int pScissorY, int pScissorWidth, int pScissorHeight) - Specified by:
clearColorAndDepthTextures
in interfaceCommandEncoder
-
verifyRegion
private void verifyRegion(GpuTexture pTexture, int pRegionX, int pRegionY, int pRegionWidth, int pRegionHeight) -
clearDepthTexture
- Specified by:
clearDepthTexture
in interfaceCommandEncoder
-
clearStencilTexture
- Specified by:
clearStencilTexture
in interfaceCommandEncoder
-
verifyColorTexture
-
verifyDepthTexture
-
writeToBuffer
- Specified by:
writeToBuffer
in interfaceCommandEncoder
-
mapBuffer
- Specified by:
mapBuffer
in interfaceCommandEncoder
-
mapBuffer
- Specified by:
mapBuffer
in interfaceCommandEncoder
-
copyToBuffer
- Specified by:
copyToBuffer
in interfaceCommandEncoder
-
writeToTexture
- Specified by:
writeToTexture
in interfaceCommandEncoder
-
writeToTexture
public void writeToTexture(GpuTexture pTexture, NativeImage pImage, int pMipLevel, int pDepthOrLayer, int pX, int pY, int pWidth, int pHeight, int pSourceX, int pSourceY) - Specified by:
writeToTexture
in interfaceCommandEncoder
-
writeToTexture
public void writeToTexture(GpuTexture pTexture, IntBuffer pBuffer, NativeImage.Format pFormat, int pMipLevel, int pDepthOrLayer, int pX, int pY, int pWidth, int pHeight) - Specified by:
writeToTexture
in interfaceCommandEncoder
-
copyTextureToBuffer
public void copyTextureToBuffer(GpuTexture pTexture, GpuBuffer pBuffer, int pOffset, Runnable pTask, int pMipLevel) - Specified by:
copyTextureToBuffer
in interfaceCommandEncoder
-
copyTextureToBuffer
public void copyTextureToBuffer(GpuTexture pTexture, GpuBuffer pBuffer, int pOffset, Runnable pTask, int pMipLevel, int pX, int pY, int pWidth, int pHeight) - Specified by:
copyTextureToBuffer
in interfaceCommandEncoder
-
copyTextureToTexture
public void copyTextureToTexture(GpuTexture pSource, GpuTexture pDestination, int pMipLevel, int pX, int pY, int pSourceX, int pSourceY, int pWidth, int pHeight) - Specified by:
copyTextureToTexture
in interfaceCommandEncoder
-
presentTexture
- Specified by:
presentTexture
in interfaceCommandEncoder
-
createFence
- Specified by:
createFence
in interfaceCommandEncoder
-
executeDrawMultiple
protected <T> void executeDrawMultiple(GlRenderPass pRenderPass, Collection<RenderPass.Draw<T>> pDraws, @Nullable GpuBuffer pBuffer, @Nullable VertexFormat.IndexType pIndexType, Collection<String> pUniforms, T pData) -
executeDraw
protected void executeDraw(GlRenderPass pRenderPass, int pFirstIndex, int pIndex, int pIndexCount, @Nullable VertexFormat.IndexType pIndexType, int pPrimCount) -
drawFromBuffers
private void drawFromBuffers(GlRenderPass pRenderPass, int pFirstIndex, int pIndex, int pIndexCount, @Nullable VertexFormat.IndexType pIndexType, GlRenderPipeline pPipeline, int pPrimCount) -
trySetup
-
applyPipelineState
-
finishRenderPass
public void finishRenderPass() -
getDevice
-