Skip to content

fix(gles): use STREAM_DRAW for PIXEL_PACK_BUFFER (fixes #1595)#2002

Merged
Drakulix merged 1 commit intoSmithay:masterfrom
xdagiz:fix/gles-pbo-stream-draw
Apr 20, 2026
Merged

fix(gles): use STREAM_DRAW for PIXEL_PACK_BUFFER (fixes #1595)#2002
Drakulix merged 1 commit intoSmithay:masterfrom
xdagiz:fix/gles-pbo-stream-draw

Conversation

@xdagiz
Copy link
Copy Markdown
Contributor

@xdagiz xdagiz commented Apr 18, 2026

Description

The GLES renderer was using GL_STREAM_READ when allocating PBOs for
glReadPixels operations (i don't know if this was a bug or intentional). However, PIXEL_PACK_BUFFER is used to pack
pixel data FROM the GPU (GPU writes, CPU reads), so using GL_STREAM_DRAW fixed it.

This caused screenshots in niri to fail with "failed to copy to output" and with debug logs:

ERROR smithay::backend::renderer::gles: [GL] GL_INVALID_ENUM in glBufferData(invalid usage: GL_STREAM_READ)
ERROR smithay::backend::renderer::gles: [GL] GL_INVALID_OPERATION in glReadPixels(out of bounds PBO access)

on older CPUs (particularly Intel integrated graphics), where drivers
enforce the usage hint more strictly.

Checklist

@iggylari
Copy link
Copy Markdown

Works with Niri on i7 L620, thanks

@xdagiz
Copy link
Copy Markdown
Contributor Author

xdagiz commented Apr 19, 2026

@iggylari yeah it also works on my old intel core i2

Copy link
Copy Markdown
Member

@Drakulix Drakulix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Drakulix Drakulix merged commit 8f0e840 into Smithay:master Apr 20, 2026
13 of 14 checks passed
@YaLTeR
Copy link
Copy Markdown
Contributor

YaLTeR commented Apr 20, 2026

Confirming it fixes screenshots on niri on my Eee PC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants