Files
NeoForge/patches/com/mojang/renderpearl/backend/opengl/FrameBufferCache.java.patch
T
b160270bd5 Port to 26.3 (#3403)
Co-authored-by: XFactHD <[email protected]>
Co-authored-by: Technici4n <[email protected]>
Co-authored-by: sciwhiz12 <[email protected]>
Co-authored-by: Matyrobbrt <[email protected]>
Co-authored-by: Marc Hermans <[email protected]>
Co-authored-by: Sara Freimer <[email protected]>
2026-09-16 03:08:09 +08:00

29 lines
1.6 KiB
Diff

--- a/com/mojang/renderpearl/backend/opengl/FrameBufferCache.java
+++ b/com/mojang/renderpearl/backend/opengl/FrameBufferCache.java
@@ -51,7 +_,7 @@
}
dsa.bindFrameBufferTextures(
- fbo, colorIds, mipLevels, depthAttachment == null ? 0 : depthAttachment.glId(), depthAttachment == null ? 0 : depthAttachment.fboMipLevel(), 0
+ fbo, colorIds, mipLevels, depthAttachment == null ? 0 : depthAttachment.glId(), depthAttachment == null ? 0 : depthAttachment.fboMipLevel(), 0, depthAttachment != null && depthAttachment.hasStencilAspect()
);
return fbo;
}
@@ -76,7 +_,7 @@
public CacheKey(List<@Nullable FrameBufferAttachment> colorAttachments, @Nullable FrameBufferAttachment depthAttachment, int mipOffset) {
int colorAttachmentCount = colorAttachments.size();
- this.data = new int[(colorAttachmentCount + (depthAttachment != null ? 1 : 0)) * 2];
+ this.data = new int[(colorAttachmentCount * 2) + (depthAttachment != null ? 3 : 0)];
for (int i = 0; i < colorAttachmentCount; i++) {
FrameBufferAttachment attachment = colorAttachments.get(i);
@@ -93,6 +_,7 @@
if (depthAttachment != null) {
this.data[colorAttachmentCount * 2] = depthAttachment.glId();
this.data[colorAttachmentCount * 2 + 1] = depthAttachment.fboMipLevel() + mipOffset;
+ this.data[colorAttachmentCount * 2 + 2] = depthAttachment.hasStencilAspect() ? 1 : 0;
this.associatedAttachments.add(depthAttachment);
}