Use surfman with glow bindings (take II) (#35422)

* Reapply "Use surfman with glow bindings (#34328)" (#35402)

This reverts commit 0fed99590a.

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

* update surfman

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-13 08:26:38 +01:00 committed by GitHub
parent 48e38bcaa2
commit 610a1c2303
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 69 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,
);