Use surfman with glow bindings (#34328)

* Use glowing surfman

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Port https://github.com/servo/webxr/pull/255

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixups rebase

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fmt

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update surfman

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix stale TODO

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Samson 2025-02-05 07:13:21 +01:00 committed by GitHub
parent fdbfecf7dd
commit 503bb10c5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 70 additions and 97 deletions

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::collections::HashMap;
use std::num::NonZeroU32;
use std::ops::Deref;
use std::sync::{Arc, Mutex};
use std::time::Duration;
@ -767,15 +766,13 @@ impl LayerManagerAPI<SurfmanGL> for OpenXrLayerManager {
})?;
let color_texture = device.surface_texture_object(color_surface_texture);
let color_target = device.surface_gl_texture_target();
let depth_stencil_texture = openxr_layer
.depth_stencil_texture
.map(|texture| texture.0.get());
let depth_stencil_texture = openxr_layer.depth_stencil_texture;
let texture_array_index = None;
let origin = Point2D::new(0, 0);
let texture_size = openxr_layer.size;
let sub_image = Some(SubImage {
color_texture,
depth_stencil_texture,
color_texture: color_texture.map(|t| t.0),
depth_stencil_texture: depth_stencil_texture.map(|t| t.0),
texture_array_index,
viewport: Rect::new(origin, texture_size),
});
@ -784,8 +781,8 @@ impl LayerManagerAPI<SurfmanGL> for OpenXrLayerManager {
.viewports
.iter()
.map(|&viewport| SubImage {
color_texture,
depth_stencil_texture,
color_texture: color_texture.map(|t| t.0),
depth_stencil_texture: depth_stencil_texture.map(|t| t.0),
texture_array_index,
viewport,
})
@ -795,7 +792,7 @@ impl LayerManagerAPI<SurfmanGL> for OpenXrLayerManager {
contexts,
context_id,
layer_id,
NonZeroU32::new(color_texture).map(glow::NativeTexture),
color_texture,
color_target,
openxr_layer.depth_stencil_texture,
);