mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
webgl: Support DEPTH_STENCIL_ATTACHMENT on osmesa.
This commit is contained in:
parent
d179435eab
commit
15e2af0fea
1 changed files with 25 additions and 6 deletions
|
@ -693,12 +693,31 @@ impl WebGLImpl {
|
||||||
ctx.gl().disable(cap),
|
ctx.gl().disable(cap),
|
||||||
WebGLCommand::Enable(cap) =>
|
WebGLCommand::Enable(cap) =>
|
||||||
ctx.gl().enable(cap),
|
ctx.gl().enable(cap),
|
||||||
WebGLCommand::FramebufferRenderbuffer(target, attachment, renderbuffertarget, rb) =>
|
WebGLCommand::FramebufferRenderbuffer(target, attachment, renderbuffertarget, rb) => {
|
||||||
ctx.gl().framebuffer_renderbuffer(target, attachment, renderbuffertarget,
|
let attach = |attachment| {
|
||||||
rb.map_or(0, WebGLRenderbufferId::get)),
|
ctx.gl().framebuffer_renderbuffer(target, attachment,
|
||||||
WebGLCommand::FramebufferTexture2D(target, attachment, textarget, texture, level) =>
|
renderbuffertarget,
|
||||||
ctx.gl().framebuffer_texture_2d(target, attachment, textarget,
|
rb.map_or(0, WebGLRenderbufferId::get))
|
||||||
texture.map_or(0, WebGLTextureId::get), level),
|
};
|
||||||
|
if attachment == gl::DEPTH_STENCIL_ATTACHMENT {
|
||||||
|
attach(gl::DEPTH_ATTACHMENT);
|
||||||
|
attach(gl::STENCIL_ATTACHMENT);
|
||||||
|
} else {
|
||||||
|
attach(attachment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
WebGLCommand::FramebufferTexture2D(target, attachment, textarget, texture, level) => {
|
||||||
|
let attach = |attachment| {
|
||||||
|
ctx.gl().framebuffer_texture_2d(target, attachment, textarget,
|
||||||
|
texture.map_or(0, WebGLTextureId::get), level)
|
||||||
|
};
|
||||||
|
if attachment == gl::DEPTH_STENCIL_ATTACHMENT {
|
||||||
|
attach(gl::DEPTH_ATTACHMENT);
|
||||||
|
attach(gl::STENCIL_ATTACHMENT);
|
||||||
|
} else {
|
||||||
|
attach(attachment)
|
||||||
|
}
|
||||||
|
}
|
||||||
WebGLCommand::FrontFace(mode) =>
|
WebGLCommand::FrontFace(mode) =>
|
||||||
ctx.gl().front_face(mode),
|
ctx.gl().front_face(mode),
|
||||||
WebGLCommand::DisableVertexAttribArray(attrib_id) =>
|
WebGLCommand::DisableVertexAttribArray(attrib_id) =>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue