Description of the bug
When you set your GUI scale to 13 (which should be possible with a 5K monitor) and place at least 82 different items shared between an opened double chest and the player inventory, it will cause spam in the game output log and render some of the items as invisible.
Explanation of what is happening
As of the recent 1.21.6 snapshots, the GUI icons of items now get drawn and cached to an internal buffer, which is then referenced whenever an item’s GUI item needs to be drawn.
The size of this buffer is limited to 2048x2048 pixels, while the size of the individual items on the buffer increases with the used GUI scale. At scale 13, a grid with at least 10 items in one direction (as is necessary with 82 items, since a 9x9 grid can’t hold them) will have 10x16 GUI pixels and with the GUI scale, 10x16x13=2080 actual pixels in that direction. This exceeds the size of the cache buffer, and so it’s impossible for it to hold 82 item icons at GUI scale 13.
When the buffer is full, it gets cleared and repopulated with the items that are currently on screen, but with it being full at only 82 items, it is possible to have them all on screen even in a regular survival world.
It should be possible for a player to get a GUI scale of 13 if their screen is 4160 pixels wide and 3120 pixels tall, according to the formula on the wiki.
Images of an inventory at GUI scale 13
[media][media]