Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depth and stencil buffer blitting #1952

Merged
merged 2 commits into from Jul 28, 2021
Merged

Depth and stencil buffer blitting #1952

merged 2 commits into from Jul 28, 2021

Conversation

tobias93
Copy link
Contributor

Adds support for blitting not only the color, but also the depth buffer and stencil buffer. Fixes issue #1404 .

In total, there are three new functions in glium::Surface: blit_buffers_from_frame, blit_buffers_from_simple_framebuffer and blit_buffers_from_multioutput_framebuffer. They behave identical to the already existing blitting functions, there is just an additional argument of type BlitMask that is used to specify which kind of buffers (color, depth, stencil) should be copied.

There are no breaking changes.

There is one last open problem: I wrote a test to check, that a blit with color+depth works. I am not sure how to check the result though, because I could not figure out how to access the values in the DepthTexture2d after the blit. So for now, it only checks that there are no GL errors.

Copy link
Collaborator

@est31 est31 left a comment

Choose a reason for hiding this comment

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

OK except for code style nits

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
tests/blit.rs Outdated Show resolved Hide resolved
tests/blit.rs Outdated Show resolved Hide resolved
@tobias93
Copy link
Contributor Author

All fixed.

Copy link
Collaborator

@est31 est31 left a comment

Choose a reason for hiding this comment

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

Thanks!

@est31 est31 merged commit 2c6caf9 into glium:master Jul 28, 2021
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.

None yet

2 participants