mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
webgl: Track the level with texture attachments.
We need this to be able to get the size of the attached texture for completeness validation. Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
08938499a0
commit
59634cf78e
1 changed files with 6 additions and 3 deletions
|
@ -21,7 +21,7 @@ use webrender_traits::{WebGLCommand, WebGLFramebufferBindingRequest, WebGLFrameb
|
||||||
#[derive(JSTraceable, Clone, HeapSizeOf)]
|
#[derive(JSTraceable, Clone, HeapSizeOf)]
|
||||||
enum WebGLFramebufferAttachment {
|
enum WebGLFramebufferAttachment {
|
||||||
Renderbuffer(JS<WebGLRenderbuffer>),
|
Renderbuffer(JS<WebGLRenderbuffer>),
|
||||||
Texture(JS<WebGLTexture>),
|
Texture { texture: JS<WebGLTexture>, level: i32 },
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HeapGCValue for WebGLFramebufferAttachment {}
|
impl HeapGCValue for WebGLFramebufferAttachment {}
|
||||||
|
@ -190,7 +190,10 @@ impl WebGLFramebuffer {
|
||||||
// Note, from the GLES 2.0.25 spec, page 113:
|
// Note, from the GLES 2.0.25 spec, page 113:
|
||||||
// "If texture is zero, then textarget and level are ignored."
|
// "If texture is zero, then textarget and level are ignored."
|
||||||
Some(texture) => {
|
Some(texture) => {
|
||||||
*binding.borrow_mut() = Some(WebGLFramebufferAttachment::Texture(JS::from_ref(texture)));
|
*binding.borrow_mut() = Some(WebGLFramebufferAttachment::Texture {
|
||||||
|
texture: JS::from_ref(texture),
|
||||||
|
level: level }
|
||||||
|
);
|
||||||
|
|
||||||
// From the GLES 2.0.25 spec, page 113:
|
// From the GLES 2.0.25 spec, page 113:
|
||||||
//
|
//
|
||||||
|
@ -282,7 +285,7 @@ impl WebGLFramebuffer {
|
||||||
for attachment in &attachments {
|
for attachment in &attachments {
|
||||||
let matched = {
|
let matched = {
|
||||||
match *attachment.borrow() {
|
match *attachment.borrow() {
|
||||||
Some(WebGLFramebufferAttachment::Texture(ref att_texture))
|
Some(WebGLFramebufferAttachment::Texture { texture: ref att_texture, .. })
|
||||||
if texture.id() == att_texture.id() => true,
|
if texture.id() == att_texture.id() => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue