Skip to content

Commit 983dd84

Browse files
committed
fix(gl): align glDrawBuffers indices with attachment points
GLES 3.0 strictly requires that the i-th buffer in `glDrawBuffers` corresponds to `GL_COLOR_ATTACHMENTi`. This fixes a `GL_INVALID_OPERATION` (0x502) error by padding the draw buffers array with `GL_NONE` at index 0, ensuring `GL_COLOR_ATTACHMENT1` is correctly placed at index 1.
1 parent 0cc5b88 commit 983dd84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

librashader-runtime-gl/src/gl/gl3/framebuffer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl FramebufferInterface for Gl3Framebuffer {
131131
);
132132

133133
fb.ctx.read_buffer(glow::COLOR_ATTACHMENT0);
134-
fb.ctx.draw_buffers(&[glow::COLOR_ATTACHMENT1]);
134+
fb.ctx.draw_buffers(&[glow::NONE, glow::COLOR_ATTACHMENT1]);
135135

136136
fb.ctx.blit_framebuffer(
137137
0,

0 commit comments

Comments
 (0)