Skip to content

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

Closed
jdm wants to merge 1 commit into
servo:masterfrom
jdm:multiple
Closed

jdm wants to merge 1 commit into
servo:masterfrom
jdm:multiple

Conversation

@jdm

@jdm jdm commented Nov 22, 2018

Copy link
Copy Markdown
Member

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

jdm commented Nov 22, 2018

Copy link
Copy Markdown
Member Author
---- 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

Comment thread src/draw_buffer.rs
pub enum ColorAttachment {
Renderbuffer(GLuint),
Texture(GLuint),
Texture(GLuint, GLuint),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Comment thread src/gl_context.rs Outdated
}

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 });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 closed this Mar 5, 2020
@jdm
jdm deleted the multiple branch March 5, 2020 20:32
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.

2 participants