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 BufferBuilder
private final MultiBufferSource.BufferSource
private final ByteBufferBuilder
private int
static final int
static final int
private final List
<GuiRenderer.Draw> private static final Comparator
<GuiElementRenderState> private int
private int
static final int
static final int
private static final float
private final CachedOrthoProjectionMatrixBuffer
private int
private int
private GpuTexture
private GpuTexture
private GpuTextureView
private GpuTextureView
private final CachedOrthoProjectionMatrixBuffer
private static final org.slf4j.Logger
private static final float
private static final int
private final List
<GuiRenderer.MeshToDraw> private static final float
private static final int
private final Map
<Object, OversizedItemRenderer> private final Map
<Class<? extends PictureInPictureRenderState>, PictureInPictureRendererPool<?>> private final Set
<PictureInPictureRenderState> private RenderPipeline
private ScreenRectangle
private TextureSetup
(package private) final GuiRenderState
private static final Comparator
<ScreenRectangle> private static final Comparator
<TextureSetup> private final Map
<VertexFormat, MappableRingBuffer> -
Constructor Summary
ConstructorsConstructorDescriptionGuiRenderer
(GuiRenderState pRenderState, MultiBufferSource.BufferSource pBufferSource, List<PictureInPictureRendererRegistration<?>> pPictureInPictureRenderers) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addElementsToMeshes
(GuiRenderState.TraverseRange pTraverseRange) private void
addElementToMesh
(GuiElementRenderState p_419849_, int p_419994_) private int
calculateAtlasSizeInPixels
(int pItemWidth) private it.unimi.dsi.fastutil.objects.Object2IntMap
<VertexFormat> private void
void
close()
private void
createAtlasTextures
(int pAtlasSize) private void
draw
(GpuBufferSlice pBufferSlice) private void
enableScissor
(ScreenRectangle pScissorArea, RenderPass pRenderPass) private void
private void
executeDraw
(GuiRenderer.Draw pDraw, RenderPass pRenderPass, GpuBuffer pBuffer, VertexFormat.IndexType pIndexType) private void
executeDrawRange
(Supplier<String> pDebugGroup, RenderTarget pRenderTarget, GpuBufferSlice pFog, GpuBufferSlice pDynamicTransforms, GpuBuffer pBuffer, VertexFormat.IndexType pIndexType, int pStart, int pEnd) private BufferBuilder
getBufferBuilder
(RenderPipeline pPipeline) private int
void
private void
private void
prepare()
private void
private void
private <T extends PictureInPictureRenderState>
booleanpreparePictureInPictureState
(T p_415554_, int p_415565_, boolean firstPass) private void
private void
private void
recordMesh
(BufferBuilder pBufferBuilder, RenderPipeline pPipeline, TextureSetup pTextureSetup, ScreenRectangle pScissorArea) void
render
(GpuBufferSlice pBufferSlice) private void
renderItemToAtlas
(TrackingItemStackRenderState p_428843_, PoseStack p_416703_, int p_416443_, int p_416400_, int p_416052_) private boolean
scissorChanged
(ScreenRectangle pScissorArea, ScreenRectangle pOldScissorArea) private void
submitBlitFromItemAtlas
(GuiItemRenderState pRenderState, float pX, float pY, int pItemSize, int pAtlasSize)
-
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 pRenderState, MultiBufferSource.BufferSource pBufferSource, List<PictureInPictureRendererRegistration<?>> pPictureInPictureRenderers)
-
-
Method Details
-
incrementFrameNumber
public void incrementFrameNumber() -
render
-
clearUnusedOversizedItemRenderers
private void clearUnusedOversizedItemRenderers() -
prepare
private void prepare() -
addElementsToMeshes
-
draw
-
executeDrawRange
private void executeDrawRange(Supplier<String> pDebugGroup, RenderTarget pRenderTarget, GpuBufferSlice pFog, GpuBufferSlice pDynamicTransforms, GpuBuffer pBuffer, VertexFormat.IndexType pIndexType, int pStart, int pEnd) -
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 p_428843_, PoseStack p_416703_, int p_416443_, int p_416400_, int p_416052_) -
submitBlitFromItemAtlas
private void submitBlitFromItemAtlas(GuiItemRenderState pRenderState, float pX, float pY, int pItemSize, int pAtlasSize) -
createAtlasTextures
private void createAtlasTextures(int pAtlasSize) -
calculateAtlasSizeInPixels
private int calculateAtlasSizeInPixels(int pItemWidth) -
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 pDraw, RenderPass pRenderPass, GpuBuffer pBuffer, VertexFormat.IndexType pIndexType) -
getBufferBuilder
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-