mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add support for WebGL2 FramebufferTextureLayer
Adds support for `FramebufferTextureLayer` WebGL2 call. See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4
This commit is contained in:
parent
61cf25c98a
commit
8389189d94
9 changed files with 145 additions and 39 deletions
|
@ -1974,6 +1974,19 @@ impl WebGLImpl {
|
|||
WebGLCommand::InvalidateSubFramebuffer(target, ref attachments, x, y, w, h) => {
|
||||
gl.invalidate_sub_framebuffer(target, attachments, x, y, w, h)
|
||||
},
|
||||
WebGLCommand::FramebufferTextureLayer(target, attachment, tex_id, level, layer) => {
|
||||
let tex_id = tex_id.map_or(0, WebGLTextureId::get);
|
||||
let attach = |attachment| {
|
||||
gl.framebuffer_texture_layer(target, attachment, tex_id, level, layer)
|
||||
};
|
||||
|
||||
if attachment == gl::DEPTH_STENCIL_ATTACHMENT {
|
||||
attach(gl::DEPTH_ATTACHMENT);
|
||||
attach(gl::STENCIL_ATTACHMENT);
|
||||
} else {
|
||||
attach(attachment)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
// If debug asertions are enabled, then check the error state.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue