mojira.dev
MC-310832

The clear region uses mip 0 dimensions while attaching a different mip level

clearColorAndDepthTextures creates its two attachment views with createTextureView(texture, mipLevel, 1), then sets the render area from colorTexture.getWidth(0) and getHeight(0), so any level above 0 declares an area larger than the attachments it renders to.

The two backends express the clear region differently, and only one of them carries the mip level through. OpenGL has no render area here: it fetches the framebuffer for the requested mip through getFbo(..., mipLevel), whose dimensions come from that mip, and restricts the clear with _scissorBox in mip coordinates, so it stays correct at any level. Vulkan needs an explicit render area for the render pass, and withRenderArea is given the level 0 size rather than the size of the level actually attached. The clear rectangle itself is passed in mip coordinates on both sides, through VkClearRect on the Vulkan side, so only the surrounding area is wrong. Vanilla passes level 0 everywhere, which makes the two values coincide.

Reading the render area from the same mip level as the attached views would make the Vulkan path agree with the OpenGL one at every level.

Comments 1

Lolo

Adrien Givry

Community Consensus

Platform G

Normal

Rendering

26.3 Snapshot 7

26.3 Snapshot 10

Retrieved