mojira.dev
MC-311518

`copyTextureToTexture` passes the width and height coordinates instead of `sourceX + width` and `sourceY + height`

GlCommandEncoder.copyTextureToTexture copies the wrong region whenever sourceX, sourceY, destX or destY is non-zero.

https://mcsrc.dev/2/26.3-snapshot-10/com/mojang/renderpearl/backend/opengl/GlCommandEncoder#L408-436

this.device
   .directStateAccess()
   .blitFrameBuffers(this.readFbo, this.drawFbo, sourceX, sourceY, width, height, destX, destY, width, height, isDepth ? 256 : 16384, 9728);

DirectStateAccess.blitFrameBuffers takes corner coordinates, not an offset and a size:

public abstract void blitFrameBuffers( int source, int dest, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter );

The Vulkan backend is correct: VulkanCommandEncoder.copyTextureToTexture uses srcOffset(sourceX, sourceY, 0), dstOffset(destX, destY, 0) and extent(width, height, 1), which matches the abstraction's offset-plus-size semantics. The two backends therefore produce different images for the same call.

Comments 1

Lolo

(Unassigned)

Community Consensus

Platform G

Low

Rendering

26.3 Snapshot 10

Retrieved