Package net.minecraft.client.gui.render
Class GuiRenderer
java.lang.Object
net.minecraft.client.gui.render.GuiRenderer
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class(package private) static final record(package private) static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<Object, GuiRenderer.AtlasPosition> private BufferBuilderprivate final MultiBufferSource.BufferSourceprivate final ByteBufferBuilderprivate intstatic final intstatic final intprivate final List<GuiRenderer.Draw> private static final Comparator<GuiElementRenderState> private intprivate intstatic final intstatic final intprivate static final floatprivate final CachedOrthoProjectionMatrixBufferprivate intprivate intprivate GpuTextureprivate GpuTextureprivate GpuTextureViewprivate GpuTextureViewprivate final CachedOrthoProjectionMatrixBufferprivate static final org.slf4j.Loggerprivate static final floatprivate static final intprivate final List<GuiRenderer.MeshToDraw> private static final floatprivate static final intprivate final Map<Object, OversizedItemRenderer> private final Map<Class<? extends PictureInPictureRenderState>, PictureInPictureRendererPool<?>> private final Set<PictureInPictureRenderState> private RenderPipelineprivate ScreenRectangleprivate TextureSetup(package private) final GuiRenderStateprivate static final Comparator<ScreenRectangle> private static final Comparator<TextureSetup> private final Map<VertexFormat, MappableRingBuffer> -
Constructor Summary
ConstructorsConstructorDescriptionGuiRenderer(GuiRenderState renderState, MultiBufferSource.BufferSource bufferSource, List<PictureInPictureRendererRegistration<?>> pictureInPictureRenderers) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddElementsToMeshes(GuiRenderState.TraverseRange traverseRange) private voidaddElementToMesh(GuiElementRenderState renderState, int layer) private intcalculateAtlasSizeInPixels(int itemWidth) private it.unimi.dsi.fastutil.objects.Object2IntMap<VertexFormat> private voidvoidclose()private voidcreateAtlasTextures(int atlasSize) private voiddraw(GpuBufferSlice fogUniforms) private voidenableScissor(ScreenRectangle scissorArea, RenderPass renderPass) private voidprivate voidexecuteDraw(GuiRenderer.Draw draw, RenderPass renderPass, GpuBuffer buffer, VertexFormat.IndexType indexType) private voidexecuteDrawRange(Supplier<String> debugGroup, RenderTarget renderTarget, GpuBufferSlice fogUniforms, GpuBufferSlice dynamicTransforms, GpuBuffer buffer, VertexFormat.IndexType indexType, int start, int end) private BufferBuildergetBufferBuilder(RenderPipeline pipeline) private intvoidprivate voidprivate voidprepare()private voidprivate voidprivate <T extends PictureInPictureRenderState>
booleanpreparePictureInPictureState(T p_415554_, int p_415565_, boolean firstPass) private voidprivate voidprivate voidrecordMesh(BufferBuilder bufferBuilder, RenderPipeline pipeline, TextureSetup textureSetup, ScreenRectangle scissorArea) voidrender(GpuBufferSlice bufferSlice) private voidrenderItemToAtlas(TrackingItemStackRenderState renderState, PoseStack poseStack, int x, int y, int size) private booleanscissorChanged(ScreenRectangle scissorArea, ScreenRectangle oldScissorArea) private voidsubmitBlitFromItemAtlas(GuiItemRenderState renderState, float x, float y, int itemSize, int atlasSize)
-
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
private 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:
-
MINIMUM_ITEM_ATLAS_SIZE
private static final int MINIMUM_ITEM_ATLAS_SIZE- See Also:
-
MAXIMUM_ITEM_ATLAS_SIZE
private static final int MAXIMUM_ITEM_ATLAS_SIZE -
CLEAR_COLOR
public static final int CLEAR_COLOR- See Also:
-
SCISSOR_COMPARATOR
-
TEXTURE_COMPARATOR
-
ELEMENT_SORT_COMPARATOR
-
atlasPositions
-
oversizedItemRenderers
-
renderState
-
draws
-
meshesToDraw
-
byteBufferBuilder
-
vertexBuffers
-
firstDrawIndexAfterBlur
private int firstDrawIndexAfterBlur -
guiProjectionMatrixBuffer
-
itemsProjectionMatrixBuffer
-
bufferSource
-
pictureInPictureRendererPools
private final Map<Class<? extends PictureInPictureRenderState>,PictureInPictureRendererPool<?>> pictureInPictureRendererPools -
pictureInPictureRenderStatesScratch
-
itemsAtlas
-
itemsAtlasView
-
itemsAtlasDepth
-
itemsAtlasDepthView
-
itemAtlasX
private int itemAtlasX -
itemAtlasY
private int itemAtlasY -
cachedGuiScale
private int cachedGuiScale -
frameNumber
private int frameNumber -
previousScissorArea
-
previousPipeline
-
previousTextureSetup
-
bufferBuilder
-
-
Constructor Details
-
GuiRenderer
public GuiRenderer(GuiRenderState renderState, MultiBufferSource.BufferSource bufferSource, List<PictureInPictureRendererRegistration<?>> pictureInPictureRenderers)
-
-
Method Details
-
incrementFrameNumber
public void incrementFrameNumber() -
render
-
clearUnusedOversizedItemRenderers
private void clearUnusedOversizedItemRenderers() -
prepare
private void prepare() -
addElementsToMeshes
-
draw
-
executeDrawRange
private void executeDrawRange(Supplier<String> debugGroup, RenderTarget renderTarget, GpuBufferSlice fogUniforms, GpuBufferSlice dynamicTransforms, GpuBuffer buffer, VertexFormat.IndexType indexType, int start, int end) -
addElementToMesh
-
prepareText
private void prepareText() -
prepareItemElements
private void prepareItemElements() -
preparePictureInPicture
private void preparePictureInPicture() -
preparePictureInPictureState
private <T extends PictureInPictureRenderState> boolean preparePictureInPictureState(T p_415554_, int p_415565_, boolean firstPass) -
renderItemToAtlas
private void renderItemToAtlas(TrackingItemStackRenderState renderState, PoseStack poseStack, int x, int y, int size) -
submitBlitFromItemAtlas
private void submitBlitFromItemAtlas(GuiItemRenderState renderState, float x, float y, int itemSize, int atlasSize) -
createAtlasTextures
private void createAtlasTextures(int atlasSize) -
calculateAtlasSizeInPixels
private int calculateAtlasSizeInPixels(int itemWidth) -
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 buffer, VertexFormat.IndexType indexType) -
getBufferBuilder
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-