diff --git a/webxr-api/layer.rs b/webxr-api/layer.rs index b0a607f..2a00452 100644 --- a/webxr-api/layer.rs +++ b/webxr-api/layer.rs @@ -10,6 +10,8 @@ use euclid::Rect; use euclid::Size2D; use std::fmt::Debug; +use std::num::NonZero; +use std::num::NonZeroU32; use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering; @@ -288,9 +290,8 @@ pub struct SubImages { #[derive(Clone, Debug)] #[cfg_attr(feature = "ipc", derive(Deserialize, Serialize))] pub struct SubImage { - pub color_texture: u32, - // TODO: make this Option - pub depth_stencil_texture: Option, + pub color_texture: Option, + pub depth_stencil_texture: Option, pub texture_array_index: Option, pub viewport: Rect, } diff --git a/webxr/Cargo.toml b/webxr/Cargo.toml index d627107..eb1ec68 100644 --- a/webxr/Cargo.toml +++ b/webxr/Cargo.toml @@ -34,7 +34,7 @@ log = "0.4.6" openxr = { version = "0.19", optional = true } serde = { version = "1.0", optional = true } glow = "0.16" -surfman = { git = "https://github.com/servo/surfman", rev = "c8d6b4b65aeab739ee7651602e29c8d58ceee123", features = [ +surfman = { git = "https://github.com/sagudev/surfman", branch = "no_gl_gen", features = [ "chains", ] } diff --git a/webxr/surfman_layer_manager.rs b/webxr/surfman_layer_manager.rs index 33ef961..8dc3ba1 100644 --- a/webxr/surfman_layer_manager.rs +++ b/webxr/surfman_layer_manager.rs @@ -163,8 +163,8 @@ impl LayerManagerAPI for SurfmanLayerManager { let texture_array_index = None; let origin = Point2D::new(0, 0); let sub_image = Some(SubImage { - color_texture, - depth_stencil_texture: depth_stencil_texture.map(|nt| nt.0.get()), + color_texture: color_texture.map(|nt| nt.0), + depth_stencil_texture: depth_stencil_texture.map(|nt| nt.0), texture_array_index, viewport: Rect::new(origin, surface_size), }); @@ -173,8 +173,8 @@ impl LayerManagerAPI for SurfmanLayerManager { .viewports .iter() .map(|&viewport| SubImage { - color_texture, - depth_stencil_texture: depth_stencil_texture.map(|texture| texture.0.get()), + color_texture: color_texture.map(|nt| nt.0), + depth_stencil_texture: depth_stencil_texture.map(|texture| texture.0), texture_array_index, viewport, }) @@ -185,7 +185,7 @@ impl LayerManagerAPI for SurfmanLayerManager { contexts, context_id, layer_id, - NonZeroU32::new(color_texture).map(gl::NativeTexture), + color_texture, color_target, depth_stencil_texture, );