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

Support swappable textures as the backing for the draw buffer. #131

Closed
wants to merge 1 commit into from

Conversation

@jdm
Copy link
Member

jdm commented Nov 22, 2018

This is required to fix servo/servo#21841. When a frame is complete, a different texture is used as the backing for the framebuffer, allowing the complete texture to be read from at WebRender's leisure.

@jdm
Copy link
Member Author

jdm commented Nov 22, 2018

---- tests::test_multithread_sharing_gl2 stdout ----
thread 'tests::test_multithread_sharing_gl2' panicked at 'assertion failed: `(left == right)`
  left: `[0, 0, 0, 0]`,
 right: `[255, 0, 0, 255]`', src/tests.rs:35:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
---- tests::test_multithread_sharing_gl3 stdout ----
thread 'tests::test_multithread_sharing_gl3' panicked at 'assertion failed: `(left == right)`
  left: `[0, 0, 0, 0]`,
 right: `[255, 0, 0, 255]`', src/tests.rs:35:9
---- tests::test_sharing_gl2 stdout ----
thread 'tests::test_sharing_gl2' panicked at 'assertion failed: `(left == right)`
  left: `[128, 0, 0, 63]`,
 right: `[255, 0, 0, 255]`', src/tests.rs:35:9
---- tests::test_sharing_gl3 stdout ----
thread 'tests::test_sharing_gl3' panicked at 'assertion failed: `(left == right)`
  left: `[0, 0, 0, 255]`,
 right: `[255, 0, 0, 255]`', src/tests.rs:35:9
failures:
    tests::test_multithread_sharing_gl2
    tests::test_multithread_sharing_gl3
    tests::test_sharing_gl2
    tests::test_sharing_gl3
@@ -27,21 +28,43 @@ impl Default for ColorAttachmentType {
#[derive(Debug)]
pub enum ColorAttachment {
Renderbuffer(GLuint),
Texture(GLuint),
Texture(GLuint, GLuint),

This comment has been minimized.

@emilio

emilio Nov 22, 2018

Member

Can you make this ColorAttachment::Texture { active: GLuint, complete: GLuint }?

@@ -224,13 +237,17 @@ impl<Native> GLContext<Native>
self.extensions.clone()
}

fn reset_draw_buffer_contents(&self) {
self.gl().clear_color(0.0, 0.0, 0.0, if !self.attributes.alpha { 1.0 } else { 0.0 });

This comment has been minimized.

@emilio

emilio Nov 22, 2018

Member

This looks like a separate fix / change, is it needed? If so, a comment in the commit message or the code would be appreciated.

@jdm jdm force-pushed the jdm:multiple branch from d4499a4 to f08f1dd Jul 15, 2019
@jdm jdm closed this Mar 5, 2020
@jdm jdm deleted the jdm:multiple branch Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.