Class GuiRenderer
java.lang.Object
net.minecraft.client.gui.render.GuiRenderer
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordprivate static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate @Nullable BufferBuilderprivate final MultiBufferSource.BufferSourceprivate final ByteBufferBuilderprivate intstatic final intstatic final intprivate final List<GuiRenderer.Draw> private static final Comparator<GuiElementRenderState> private final FeatureRenderDispatcherprivate intstatic final intstatic final intprivate static final floatprivate final Projectionprivate final ProjectionMatrixBufferprivate @Nullable GuiItemAtlasprivate static final org.slf4j.Loggerprivate static final floatprivate final List<GuiRenderer.MeshToDraw> static final floatprivate final Map<Object, OversizedItemRenderer> private final Map<Class<? extends PictureInPictureRenderState>, PictureInPictureRendererPool<?>> private final Set<PictureInPictureRenderState> private @Nullable RenderPipelineprivate @Nullable ScreenRectangleprivate @Nullable TextureSetupprivate final GuiRenderStateprivate static final Comparator<ScreenRectangle> private final SubmitNodeCollectorprivate static final Comparator<TextureSetup> private final Map<VertexFormat, MappableRingBuffer> -
Constructor Summary
ConstructorsConstructorDescriptionGuiRenderer(GuiRenderState renderState, MultiBufferSource.BufferSource bufferSource, SubmitNodeCollector submitNodeCollector, FeatureRenderDispatcher featureRenderDispatcher, List<PictureInPictureRendererRegistration<?>> pipRendererFactories) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidaddElementToMesh(GuiElementRenderState elementState) private it.unimi.dsi.fastutil.objects.Object2IntMap<VertexFormat> private voidvoidclose()private voiddraw(GpuBufferSlice fogBuffer) private voidenableScissor(ScreenRectangle rectangle, RenderPass renderPass) voidendFrame()private voidprivate voidexecuteDraw(GuiRenderer.Draw draw, RenderPass renderPass, GpuBuffer indexBuffer, VertexFormat.IndexType indexType) private voidexecuteDrawRange(Supplier<String> label, RenderTarget mainRenderTarget, GpuBufferSlice fogBuffer, GpuBufferSlice dynamicTransforms, GpuBuffer indexBuffer, VertexFormat.IndexType indexType, int startIndex, int endIndex) private BufferBuildergetBufferBuilder(RenderPipeline pipeline) private intprivate voidprivate voidprepare()private GuiItemAtlasprepareItemAtlas(Set<Object> itemsInFrame, int slotTextureSize) private voidprivate voidprivate <T extends PictureInPictureRenderState>
booleanpreparePictureInPictureState(T picturesInPictureState, int guiScale, boolean firstPass) private voidprivate voidprivate voidrecordMesh(BufferBuilder bufferBuilder, RenderPipeline pipeline, TextureSetup textureSetup, @Nullable ScreenRectangle scissorArea) voidrender(GpuBufferSlice fogBuffer) private booleanscissorChanged(@Nullable ScreenRectangle newScissor, @Nullable ScreenRectangle oldScissor) private voidsubmitBlitFromItemAtlas(GuiItemRenderState itemState, GuiItemAtlas.SlotView slotView)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MAX_GUI_Z
private static final float MAX_GUI_Z- See Also:
-
MIN_GUI_Z
public static final float MIN_GUI_Z- See Also:
-
GUI_Z_NEAR
private static final float GUI_Z_NEAR- See Also:
-
GUI_3D_Z_FAR
public static final int GUI_3D_Z_FAR- See Also:
-
GUI_3D_Z_NEAR
public static final int GUI_3D_Z_NEAR- See Also:
-
DEFAULT_ITEM_SIZE
public static final int DEFAULT_ITEM_SIZE- See Also:
-
CLEAR_COLOR
public static final int CLEAR_COLOR- See Also:
-
SCISSOR_COMPARATOR
-
TEXTURE_COMPARATOR
-
ELEMENT_SORT_COMPARATOR
-
oversizedItemRenderers
-
renderState
-
draws
-
meshesToDraw
-
byteBufferBuilder
-
vertexBuffers
-
firstDrawIndexAfterBlur
private int firstDrawIndexAfterBlur -
guiProjection
-
guiProjectionMatrixBuffer
-
bufferSource
-
submitNodeCollector
-
featureRenderDispatcher
-
pictureInPictureRendererPools
private final Map<Class<? extends PictureInPictureRenderState>, PictureInPictureRendererPool<?>> pictureInPictureRendererPools -
pictureInPictureRenderStatesScratch
-
itemAtlas
-
cachedGuiScale
private int cachedGuiScale -
previousScissorArea
-
previousPipeline
-
previousTextureSetup
-
bufferBuilder
-
-
Constructor Details
-
GuiRenderer
public GuiRenderer(GuiRenderState renderState, MultiBufferSource.BufferSource bufferSource, SubmitNodeCollector submitNodeCollector, FeatureRenderDispatcher featureRenderDispatcher, List<PictureInPictureRendererRegistration<?>> pipRendererFactories)
-
-
Method Details
-
endFrame
public void endFrame() -
render
-
clearUnusedOversizedItemRenderers
private void clearUnusedOversizedItemRenderers() -
prepare
private void prepare() -
addElementsToMeshes
-
draw
-
executeDrawRange
private void executeDrawRange(Supplier<String> label, RenderTarget mainRenderTarget, GpuBufferSlice fogBuffer, GpuBufferSlice dynamicTransforms, GpuBuffer indexBuffer, VertexFormat.IndexType indexType, int startIndex, int endIndex) -
addElementToMesh
-
prepareText
private void prepareText() -
prepareItemElements
private void prepareItemElements() -
preparePictureInPicture
private void preparePictureInPicture() -
preparePictureInPictureState
private <T extends PictureInPictureRenderState> boolean preparePictureInPictureState(T picturesInPictureState, int guiScale, boolean firstPass) -
submitBlitFromItemAtlas
-
prepareItemAtlas
-
getGuiScaleInvalidatingItemAtlasIfChanged
private int getGuiScaleInvalidatingItemAtlasIfChanged() -
invalidateItemAtlas
private void invalidateItemAtlas() -
recordDraws
private void recordDraws() -
ensureVertexBufferSizes
private void ensureVertexBufferSizes() -
calculatedRequiredVertexBufferSizes
private it.unimi.dsi.fastutil.objects.Object2IntMap<VertexFormat> calculatedRequiredVertexBufferSizes() -
executeDraw
private void executeDraw(GuiRenderer.Draw draw, RenderPass renderPass, GpuBuffer indexBuffer, VertexFormat.IndexType indexType) -
getBufferBuilder
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-