Skip to content
This repository was archived by the owner on Feb 16, 2025. It is now read-only.

Commit 5d2b91d

Browse files
committed
Use surfman that has glow instead of GL_gen
Signed-off-by: sagudev <[email protected]>
1 parent 84c3022 commit 5d2b91d

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

webxr-api/layer.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ use euclid::Rect;
1010
use euclid::Size2D;
1111

1212
use std::fmt::Debug;
13+
use std::num::NonZero;
14+
use std::num::NonZeroU32;
1315
use std::sync::atomic::AtomicUsize;
1416
use std::sync::atomic::Ordering;
1517

@@ -288,9 +290,8 @@ pub struct SubImages {
288290
#[derive(Clone, Debug)]
289291
#[cfg_attr(feature = "ipc", derive(Deserialize, Serialize))]
290292
pub struct SubImage {
291-
pub color_texture: u32,
292-
// TODO: make this Option<NonZeroU32>
293-
pub depth_stencil_texture: Option<u32>,
293+
pub color_texture: Option<NonZeroU32>,
294+
pub depth_stencil_texture: Option<NonZeroU32>,
294295
pub texture_array_index: Option<u32>,
295296
pub viewport: Rect<i32, Viewport>,
296297
}

webxr/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ log = "0.4.6"
3434
openxr = { version = "0.19", optional = true }
3535
serde = { version = "1.0", optional = true }
3636
glow = "0.16"
37-
surfman = { git = "https://github.com/servo/surfman", rev = "c8d6b4b65aeab739ee7651602e29c8d58ceee123", features = [
37+
surfman = { git = "https://github.com/sagudev/surfman", branch = "no_gl_gen", features = [
3838
"chains",
3939
] }
4040

webxr/surfman_layer_manager.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ impl LayerManagerAPI<SurfmanGL> for SurfmanLayerManager {
163163
let texture_array_index = None;
164164
let origin = Point2D::new(0, 0);
165165
let sub_image = Some(SubImage {
166-
color_texture,
167-
depth_stencil_texture: depth_stencil_texture.map(|nt| nt.0.get()),
166+
color_texture: color_texture.map(|nt| nt.0),
167+
depth_stencil_texture: depth_stencil_texture.map(|nt| nt.0),
168168
texture_array_index,
169169
viewport: Rect::new(origin, surface_size),
170170
});
@@ -173,8 +173,8 @@ impl LayerManagerAPI<SurfmanGL> for SurfmanLayerManager {
173173
.viewports
174174
.iter()
175175
.map(|&viewport| SubImage {
176-
color_texture,
177-
depth_stencil_texture: depth_stencil_texture.map(|texture| texture.0.get()),
176+
color_texture: color_texture.map(|nt| nt.0),
177+
depth_stencil_texture: depth_stencil_texture.map(|texture| texture.0),
178178
texture_array_index,
179179
viewport,
180180
})
@@ -185,7 +185,7 @@ impl LayerManagerAPI<SurfmanGL> for SurfmanLayerManager {
185185
contexts,
186186
context_id,
187187
layer_id,
188-
NonZeroU32::new(color_texture).map(gl::NativeTexture),
188+
color_texture,
189189
color_target,
190190
depth_stencil_texture,
191191
);

0 commit comments

Comments
 (0)