diff options
Diffstat (limited to 'components/canvas')
-rw-r--r-- | components/canvas/Cargo.toml | 2 | ||||
-rw-r--r-- | components/canvas/webgl_limits.rs | 8 | ||||
-rw-r--r-- | components/canvas/webgl_thread.rs | 13 |
3 files changed, 22 insertions, 1 deletions
diff --git a/components/canvas/Cargo.toml b/components/canvas/Cargo.toml index 941eca52df2..08c060e5364 100644 --- a/components/canvas/Cargo.toml +++ b/components/canvas/Cargo.toml @@ -35,7 +35,7 @@ raqote = {git = "https://github.com/jrmuizel/raqote"} time = { version = "0.1.0", optional = true } pixels = {path = "../pixels"} servo_config = {path = "../config"} -sparkle = "0.1.19" +sparkle = "0.1.20" webrender = {git = "https://github.com/servo/webrender"} webrender_api = {git = "https://github.com/servo/webrender"} webrender_traits = {path = "../webrender_traits"} diff --git a/components/canvas/webgl_limits.rs b/components/canvas/webgl_limits.rs index 1a08dfea945..27a5b0e56dc 100644 --- a/components/canvas/webgl_limits.rs +++ b/components/canvas/webgl_limits.rs @@ -79,6 +79,8 @@ impl GLLimitsDetect for GLLimits { max_vertex_uniform_components, max_fragment_uniform_blocks, max_fragment_uniform_components, + max_3d_texture_size, + max_array_texture_layers, uniform_buffer_offset_alignment, ); if webgl_version == WebGLVersion::WebGL2 { @@ -102,6 +104,8 @@ impl GLLimitsDetect for GLLimits { max_fragment_uniform_blocks = gl.get_integer(gl::MAX_FRAGMENT_UNIFORM_BLOCKS); max_fragment_uniform_components = gl.get_integer(gl::MAX_FRAGMENT_UNIFORM_COMPONENTS); uniform_buffer_offset_alignment = gl.get_integer(gl::UNIFORM_BUFFER_OFFSET_ALIGNMENT); + max_3d_texture_size = gl.get_integer(gl::MAX_3D_TEXTURE_SIZE); + max_array_texture_layers = gl.get_integer(gl::MAX_ARRAY_TEXTURE_LAYERS) } else { max_uniform_block_size = 0; max_uniform_buffer_bindings = 0; @@ -118,6 +122,8 @@ impl GLLimitsDetect for GLLimits { max_fragment_uniform_blocks = 0; max_fragment_uniform_components = 0; uniform_buffer_offset_alignment = 0; + max_3d_texture_size = 0; + max_array_texture_layers = 0; } GLLimits { @@ -148,6 +154,8 @@ impl GLLimitsDetect for GLLimits { max_vertex_uniform_components, max_fragment_uniform_blocks, max_fragment_uniform_components, + max_3d_texture_size, + max_array_texture_layers, uniform_buffer_offset_alignment, } } diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs index 1c0d7ed498f..f01380bfbed 100644 --- a/components/canvas/webgl_thread.rs +++ b/components/canvas/webgl_thread.rs @@ -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. |