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

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
  • Loading branch information
sagudev committed Jan 14, 2025
1 parent ade0f62 commit c895d58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 2 additions & 5 deletions webxr/gl_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use glow as gl;
use glow::Context as Gl;
use glow::HasContext;
use std::collections::HashMap;
use std::num::NonZero;
use surfman::Device as SurfmanDevice;
use webxr_api::ContextId;
use webxr_api::GLContexts;
Expand Down Expand Up @@ -108,8 +107,6 @@ impl GlClearer {
let mut clear_color = [0., 0., 0., 0.];
let mut clear_depth = [0.];
let mut clear_stencil = [0];
let color_mask;
let depth_mask;
let mut stencil_mask = [0];
let scissor_enabled = gl.is_enabled(gl::SCISSOR_TEST);
let rasterizer_enabled = gl.is_enabled(gl::RASTERIZER_DISCARD);
Expand All @@ -119,9 +116,9 @@ impl GlClearer {
gl.get_parameter_f32_slice(gl::COLOR_CLEAR_VALUE, &mut clear_color[..]);
gl.get_parameter_f32_slice(gl::DEPTH_CLEAR_VALUE, &mut clear_depth[..]);
gl.get_parameter_i32_slice(gl::STENCIL_CLEAR_VALUE, &mut clear_stencil[..]);
depth_mask = gl.get_parameter_bool(gl::DEPTH_WRITEMASK);
let depth_mask = gl.get_parameter_bool(gl::DEPTH_WRITEMASK);
gl.get_parameter_i32_slice(gl::STENCIL_WRITEMASK, &mut stencil_mask[..]);
color_mask = gl.get_parameter_bool_array::<4>(gl::COLOR_WRITEMASK);
let color_mask = gl.get_parameter_bool_array::<4>(gl::COLOR_WRITEMASK);

// Clear it
gl.bind_framebuffer(gl::FRAMEBUFFER, fbo);
Expand Down
6 changes: 2 additions & 4 deletions webxr/glwindow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ impl DeviceAPI for GlWindowDevice {
.device
.context_surface_info(&self.context)
.unwrap()
.map(|info| info.framebuffer_object)
.flatten();
.and_then(|info| info.framebuffer_object);
unsafe {
self.gl
.bind_framebuffer(gl::FRAMEBUFFER, framebuffer_object);
Expand Down Expand Up @@ -386,8 +385,7 @@ impl GlWindowDevice {
let framebuffer_object = device
.context_surface_info(&context)
.unwrap()
.map(|info| info.framebuffer_object)
.flatten();
.and_then(|info| info.framebuffer_object);
gl.bind_framebuffer(gl::FRAMEBUFFER, framebuffer_object);
debug_assert_eq!(
(gl.get_error(), gl.check_framebuffer_status(gl::FRAMEBUFFER)),
Expand Down

0 comments on commit c895d58

Please sign in to comment.