Skip to content

Commit 60ba9af

Browse files
committed
docs(gl): document GLES limitations regarding glDrawBuffer
1 parent 983dd84 commit 60ba9af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ impl FramebufferInterface for Gl3Framebuffer {
131131
);
132132

133133
fb.ctx.read_buffer(glow::COLOR_ATTACHMENT0);
134+
135+
// GLES 3.0 does not support `glDrawBuffer`, only `glDrawBuffers`.
136+
// GLES requires that `GL_DRAW_BUFFERi` points to `GL_COLOR_ATTACHMENTi` or `GL_NONE`.
137+
// So we must use `glDrawBuffers` and pad the first entry with `GL_NONE` to write to `GL_COLOR_ATTACHMENT1`.
134138
fb.ctx.draw_buffers(&[glow::NONE, glow::COLOR_ATTACHMENT1]);
135139

136140
fb.ctx.blit_framebuffer(

0 commit comments

Comments
 (0)