Skip to content

[OpenGL ES 3.2] Using GL_COLOR_ATTACHMENT4/5 as drawbuffers being considered invalid? #98

@GamingCity

Description

@GamingCity

Hi,
i want to ask about this because maybe it is a bug in every GLES driver and wrapper that exist or something is missing.

Working on porting a OpenGL 3.2 core game to OpenGL ES 3.2, it already works, im having one feature that im having trouble with and thats is deferred lightning.

For that attachments 4 and 5 are used. For example:

glReadBuffer(GL_COLOR_ATTACHMENT0);
GLenum buffers[] = { GL_COLOR_ATTACHMENT5 };
glDrawBuffers(1, buffers);
glBlitFramebuffer(0, 0, gr_screen.max_w, gr_screen.max_h, 0, 0, gr_screen.max_w, gr_screen.max_h, GL_COLOR_BUFFER_BIT, GL_NEAREST);

While this work on OpenGL core, on ES does not work, and the error is generally this one.

OpenGL Debug: Source:OpenGL Type:Error ID:1 Severity:High Message:GL_INVALID_OPERATION in glDrawBuffers(unsupported buffer GL_COLOR_ATTACHMENT5)
OpenGL Debug: Source:OpenGL Type:Error ID:1 Severity:High Message:GL_INVALID_OPERATION in glBlitFramebuffer(source and destination color buffer cannot be the same)

I saw this error on zink gles wrapper, libmali driver, mesa panfrost and the adreno 22 driver for android, what is the best GLES driver i saw so far.

angle wrapper gives a similar error but in the end its the same.
OpenGL Debug: Source:OpenGL Type:Error ID:1282 Severity:High Message:glDrawBuffers: Ith value does not match COLOR_ATTACHMENTi or NONE.
OpenGL Debug: Source:OpenGL Type:Error ID:1282 Severity:High Message:glBlitFramebuffer: Blit feedback loop: the read and draw framebuffers are the same.

I check on all cases GL_MAX_COLOR_ATTACHMENTS and GL_MAX_DRAW_BUFFERS is 8 so i dont get it. So all drivers are broken with only having 4 functional drawbuffers (the min for ES 3.2) and they are all missreporting GL_MAX_COLOR_ATTACHMENTS and GL_MAX_DRAW_BUFFERS, or, maybe they need to be enabled and its not present or i missed in the documentation?

Any assistance or guidance on this matter will be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions